PHP - ^= Means What In Php Language?
I came across usage of ^= in one the password hashing codes and am trying to find what this operator means in PHP. Similar TutorialsHello everyone For a multilingual website we have to be able to open 1 page in 4 different languages. For example, product 'A' is in Dutch, English, French and German. How can I open the right language file? At the moment I use Code: [Select] http://www.zinncosmetics.nl/shop/product_info.php?products_id=36?language=de but it doesn't work. It allways opens the default Dutch pages. What do I do wrong? I don't have very much php experience (newbie) so please don't make it too difficult for me. Thanks for all help! It's not PHP, but if anyone could tell me what that means and how I can edit it I would be eternally grateful. <Directory /var/www/vhosts/webaddress.co.uk/httpdocs> RMode config RUidGid (username) psacln </Directory> Can you please tell me what each of these lines of code means?
$allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); $length = 20; $newfilename = $_SESSION['user_id'].$_FILES["file"]["name"]; $thumbnail = $newfilename . "." . $extension; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail); $sql = "INSERT INTO videos ( filename ) VALUES( $thumbnail )"; mysql_query($sql); $file_location = '<a href="http://www.--.com/upload/' . $thumbnail . '">' . $thumbnail . '</a>'; $description = $description . " \n " . $newfilename; Hello friends, in my database table or even php files i always find within the text something like this i love people\n i love world\n i love anything and sometimes \r and something \n\r so what does it mean is it like <br> or what ? thanks hi everyone
i keep seeing the following Comparison Operators:
<>i see it used in the following context: if ($connection <> 'SSL') { $connection = 'NONSSL'; }be grateful if somone would tell me what it means, i looked online but could not find the symbol thanks What means this syntax line: $comments = (array) $comments thanks in advance hello friends what does this type of array means ? $data[] = $row; Code: [Select] <?php class Point { public $x; public $y; } // Random values 0 - 1 function random_float ($min,$max) { return ($min+lcg_value()*(abs($max-$min))); } // Fuzzy C Means Algorithm function distributeOverMatrixU($num_of_clusters, $arr,$m) { global $MatrixCentroids; $num_of_data = sizeof($arr); $MatrixPointX = $arr; // Fill the $MatrixU table with random values from 0 to 1 for($j = 0; $j < $num_of_data; $j++) { $sum = 0; for($i = 0; $i < $num_of_clusters; $i++) { $MatrixU[$j][$i] = random_float(0,1); $sum += $MatrixU[$j][$i]; } // Normalize Data for($i = 0; $i < $num_of_clusters; $i++) { $MatrixU[$j][$i] = $MatrixU[$j][$i]/$sum; } } // repeat 200 for($a = 0; $a<200; $a++) { for($i = 0; $i < $num_of_clusters; $i++) { $tempAx = 0; $tempBx = 0; $tempAy = 0; $tempBy = 0; for($j = 0 ; $j < $num_of_data; $j++) { $tempAx = $tempAx + pow($MatrixU[$j][$i],$m); $tempBx += pow($MatrixU[$j][$i],$m) * $MatrixPointX[$j]->x; $tempAy = $tempAy + pow($MatrixU[$j][$i],$m); $tempBy += pow($MatrixU[$j][$i],$m) * $MatrixPointX[$j]->y; } $MatrixCentroids[$i] = new Point(); $MatrixCentroids[$i]->x = $tempBx / $tempAx; $MatrixCentroids[$i]->y = $tempBy / $tempAy; } // Cluster Centers for($j = 0 ; $j < $num_of_data; $j++) { $tempSum = 0; for($i = 0; $i < $num_of_clusters; $i++) { // Distance between 2 points $distance1 = pow(($MatrixPointX[$j]->x - $MatrixCentroids[$i]->x),2); $distance2 = pow(($MatrixPointX[$j]->y - $MatrixCentroids[$i]->y),2); $distance = $distance1 + $distance2; $distance = sqrt($distance); $MatrixU[$j][$i] = pow(1/$distance , 2/($m-1)); $tempSum += pow(1/$distance, 2/($m-1)); } for($i = 0; $i < $num_of_clusters; $i++) { $MatrixU[$j][$i] = ($MatrixU[$j][$i]/$tempSum); } $sum = 0; for($i = 0; $i < $num_of_clusters; $i++) { $sum += $MatrixU[$j][$i]; } // Norm Data for($i = 0; $i < $num_of_clusters; $i++) { $MatrixU[$j][$i] = $MatrixU[$j][$i]/$sum; } } } //print_r($MatrixCentroids); return $MatrixU ; } // Connect to DB $my_num = $_GET["cluster_number"]; $fuzz = $_GET["fuzz"]; require('db_connection.php'); $resultx=mysql_query("SELECT * FROM xdata"); $result=mysql_query("SELECT * FROM ydata"); // &#916;&#953;&#945;&#946;&#940;&#950;&#959;&#965;&#956;&#949; &#972;&#955;&#945; &#964;&#945; &#948;&#949;&#948;&#959;&#956;&#941;&#957;&#945; while ($a_row = mysql_fetch_array($result)) { for($j = 1 ; $j < 17; $j++) { $tmp_data[$j] = $a_row[ay.$j]; } } while ($x_row = mysql_fetch_array($resultx)) { for($j = 1; $j <17; $j++) { $p = new Point(); $p->x = $x_row[ax.$j]; $p->y = $tmp_data[$j]; $arr[] = $p; } } // Execute algorithm $data_in_clusters = distributeOverMatrixU($my_num, $arr,$fuzz); $size = sizeof($arr); $result=@mysql_query('select * from cluster0 limit 1', $link); if ($result) { echo "O &#960;&#943;&#957;&#945;&#954;&#945;&#962; &#965;&#960;&#940;&#961;&#967;&#949;&#953; &#954;&#945;&#953; &#960;&#961;&#941;&#960;&#949;&#953; &#957;&#945; &#948;&#953;&#945;&#947;&#961;&#945;&#966;&#959;&#973;&#957; &#959;&#953; &#960;&#961;&#959;&#951;&#947;&#959;&#973;&#956;&#949;&#957;&#949;&#962; &#949;&#947;&#947;&#961;&#945;&#966;&#941;&#962;...<BR>"; echo "&#916;&#953;&#945;&#947;&#961;&#945;&#966;&#942;...<BR>"; for($i = 0; $i <100; $i++) { $query="DROP TABLE cluster$i"; mysql_query($query,$link); } echo "H &#948;&#953;&#945;&#947;&#961;&#945;&#966;&#942; &#941;&#947;&#953;&#957;&#949; &#956;&#949; &#949;&#960;&#953;&#964;&#965;&#967;&#943;&#945;..."; } for($j = 0; $j < $my_num; $j++) { $query_c = "CREATE TABLE cluster$j(data_points_x FLOAT NOT NULL,data_points_y FLOAT NOT NULL)"; mysql_query($query_c,$link); } for($i = 0; $i < $size ; $i++) { $max = 0; $pos = 0; for($j = 0; $j < $my_num; $j++) { $tmp_point = $data_in_clusters[$i][$j]; if($tmp_point > $max) { $max = $tmp_point; $pos = $j; } } $xxxx = $arr[$i]->x; $yyyy = $arr[$i]->y; $query="INSERT INTO cluster$pos(data_points_x,data_points_y) values('$xxxx','$yyyy')";; mysql_query($query,$link); } echo "<br>"; echo "<img src='db_scatter.php' border=0 align=center width =600 height=400>"; // &#917;&#956;&#966;&#940;&#957;&#953;&#963;&#951; &#928;&#943;&#957;&#945;&#954;&#945; &#956;&#949; &#964;&#945; &#945;&#960;&#959;&#964;&#949;&#955;&#941;&#963;&#956;&#945;&#964;&#945; echo "<table width='500' border='2'>"; echo "<TR><TD><B>Points</B><BR></TD>"; for($i = 0; $i < $my_num; $i++){ $xxx = $MatrixCentroids[$i]->x; $yyy = $MatrixCentroids[$i]->y; echo "<TD>Cluster $i Centoid:<br><b>X:$xxx Y:$yyy</b></TD>"; } echo "</tr>"; for($i = 0; $i < $size ; $i++) { $x = $arr[$i]->x; $y = $arr[$i]->y; echo "<TR>"; echo "<TD><b>x:$x</b><br><b>y:$y</b></TD>"; for($j = 0; $j < $my_num; $j++) { $tmp_point = $data_in_clusters[$i][$j]; echo "<TD> $tmp_point</TD>"; } echo "</TR>"; } echo "</TABLE>"; ?> i created a insert php code which successfully submit to database but i was lost at some point because what i really wanted was a php code that will print on the next page after submission to db I have textfield for signature in my form, I m checking if the signature was sent ( if(!empty($_POST['signature'])) and if it's not empty I m putting it into the db. The problem is that, I have noticed a greek user has entered something in greek letters, and function could not deal with it and saved it as it is.( DB field supports greek charset ) I just want to allow english and german chars with special chars ( ",',< etc. ) , no other charset like greek. How can I do that? any function for this purpose ? Hi again PHP Freaks.
So I would like to code something similar to the buy menu of Counter-strike: Global offensive in-game module, just in a browser and for a project of mine. I've made the design in photoshop to illustrate better.
I just don't know what I should look into to make this kind of menu, I would love if someone could explain me what languages that this would require. (I'm guessing HTML, CSS and jQuery but I am not sure) more specific help like which particular codes would be much appreciated.
Here is a picture of what I would like to create. (Also attached)
http://i1227.photobu...zps4195288a.png
Attached Files
CSGOKeyz.png 149.81KB
0 downloads Hi, I am trying to append a language session like this: Code: [Select] $ATC_itemWeight = floatval("".$row_productos_RS['capacidad_'.$_SESSION['session_idioma'].'']; but I get this error Code: [Select] Parse error: syntax error, unexpected ';' in /usr/home/mysite.com/web/productos_esp.php on line 121 what am I doing wrong? Thanks I got site wirch I like tu turn to multilanguage. Code: [Select] <?=$home_jezik?>This is my variable for language code. So I wonna add it to Code: [Select] <?php echo $redak['novost_naslov_hr']; ?>so that "hr" change to "en" or any other language. I try with this but nothing happens Code: [Select] <?php echo $redak['novost_naslov_.$home_jezik']; ?> Hello, I am currently making a small website that requires two languages. This is the class I made: Code: [Select] <?php class languages { public function __construct() { if(!isset($_SESSION['language'])) { $_SESSION['language'] = 'nl'; } $lang = isset($_GET['lang']) ? $_GET['lang'] : ""; $languages = array('en', 'nl'); if(in_array($lang, $languages)) { $_SESSION['language'] = $lang; } } } $languages = new languages; $language = $_SESSION['language']; ?> Now as soon I use index.php?lang=en, the website will display it self in English but, as soon I remove the &lang=en from the URI, the language gets not stored in the session and it displays nl agian. Can somebody help me? Thank you! Hi! I want to have a first page on my website where you as visitor can choose the preferred language. No login at all. I want to save this choice in a cookie or something. The easiest way So next time he/she visits, the language choice is already made for he/she. Any good suggestions for a php code that works? are all languages possible to be inserted into database and be retrieved directly?? eg: write down the japanese words in the textbox and INSERT those into table and retrieve it using mysql_fetch_array() Is that as simple as that, or i have to modify certain script...for certain language? thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321347.0 At the minute i am using variables in my tpl files in place of plain text so users can change the language the page is shown in. eg. the tpl file would include: $lang->hello; and the replacement would be $lang['hello'] = 'hello'; the php file would include the language class which replaces the variable in the language file with the array value in the relevant language file. but what happens when i have a phrase with a needed variable in the middle? $lang['msgs'] = 'you have '.$msgs.' messages'; i cant have 'you have' and 'messages' as seperate lang variables as phrases are constructed differently in other languages? so how do i accomplish this? hopefully i habe explained this ok. what's the best way to have a website in 2 languages? I already have the website duplicated in the 2nd language but I'm thinking on the best way to do the language change. should I just append variables to the URL when clicking on the flag icon on each page to change to the 2nd language? any other ideas?? hello, would anyone could point me in the right direction. ?? i have 2 language buttons along the top on my web site. Code: [Select] <div class="flags"> <ul> <li><a href="#"><img src="templates/template1/images/flags/France.png" alt="France"/></a></li> <li><a href="#" class="current"><img src="templates/template1/images/flags/United Kingdom(Great Britain).png" alt="United kingdom" /></a></li> </ul> </div><!-- #flats --> how do i make it so that if i click on one it will change the sites language. ??? i have it all set up in the db so that there is a default language and if i change the default language the language changes but what code do i need to use to make my buttons changes the language? could anyone point me to some jscript or ajax or something please... many thanks rick |