PHP - Moved: Can Anyone Explain In Plain English What The <div> Tag Is Used For Mainly?
This topic has been moved to HTML Help.
http://www.phpfreaks.com/forums/index.php?topic=331697.0 Similar TutorialsHello, I dont really understand the for and while loops. And I have bad vocabulary so, can explain these two things in plain english. Thanks This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=330152.0 Hy i read the topic about the md5 insecurity and the collision possibility.... And now i have a following question. Is it not MUCH more secure to store the actual password in the DB then the md5 value of it?? Because you with it eliminate the collision possibility of the md5 completely. And I am aware of the possibility that someone could break into my DB but if I am dumb enough to let someone access my db, but that is not an issue. I can always use a 2way encryption to store the data. I have a php script that I am trying to run ( I dindt write it) but the index.php file loads basically all of the php file in plain text instead of running it. Any sugguestions? PHP is isntalled since other php scripts work.
Thanks
hello dear php-experts,
well i want to do some data-saving in the next few days. i have some data amount to store in a mysql-db.
well i am pretty sure this is a easy question for php-freaks
the question is: from plain-text to mysql-db: how to store a triple / array? how to store this data into a mysql-db have a dataset of 10 000 lines: {'data_1': 'data_2', 'data_3': 'data_4', 'data_5': 'data_6', 'data_7': 'data_8'} how to store this dataset into the mysql db ? love to hear from you greetings Im inserting HTML into a database, and then outputting it on a PHP page. Its an iframe code, so when I output it, it shows the iframe. I need it to just display the HTML code. How can I do this? I thought it would be something simple but I can find anyway to do it. Help very appreciated!! Thanks I have a comment form in which the users type thier comment in english.Those pcomments should appear in the native laguage other than english in my website.Is there any php code to do this.i dont have any idea of creating a site other than english. I'm getting data from a third party API and the first_name and last_name fields from this third party are sometimes not in english and they come out quite odd looking. Example... "first_name": "Pesh\u042fo", "last_name": "\u062d\u0633\u064a\u0646" How could I normalize that using PHP to make it readable again? Europe's biggest gaming company are looking to take on up to 10 PHP Developers to join their expanding development team working on new game releases.
They can offer relocation assistance and most interviews take place purely over Skype, or they can fly you over if required.
Its an English speaking company and could be making you an offer in the next week!
Please email me @ stuart.day@quantica.co.uk asap.
in the following code I am unable to understand the purpose of @ Code: [Select] function get_categories(){ //query database for a list of categories $conn = db_connect(); $query ="select catid, catname from categories"; $result = @$conn->query($query); if (!$result){ return false; } $num_cats = @$result->num_rows; if($num_cats==0) { return false; } $result = db_result_to_array($result); return false; } function db_result_to_array($result) { $res_array = array(); for ($count=0; $row = $result->fetch_assoc(); $count++){ $res_array[$count] = $row; } return $res_array; } the more source code i see this in, =. , the more intrigued i am by it, i cant find tuts on it anywhere it cant be searched. please explain what it is and how to use it please. If a user is using internet explorer, display error "You are not using a browser that is supported. Please reload in Google Chrome or Mozilla Firefox to access content", otherwise display page. Not sure if this is possible with an if else statement, or even php for that matter. Does anyone know what I'm talking about, and if so, any suggestions? I am working with wordpress. I am coding some custom meta boxes following some code someone else had written. My code is working but I am not sure if I need to do it the way I am doing it. The person who wrote the code added the option like so Code: [Select] $custom = get_post_meta($post->ID); $item_link = $custom["item_link"][0]; According to the wordpress codex, get_post_meta($post->ID) Returns a multidimensional array with all custom fields of a particular post or page. so when I added a second option, I followed with this Code: [Select] $item_text = $custom["item_text"][0]; I guess my question would be..Do i need to add the index 0 to every option or should I increase it by 1 for every new option I add? function quote_smart($value, $handle) { if (get_magic_quotes_gpc()) { $value = stripslashes($value); } if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value, $handle) . "'"; } return $value; } how this script works and this script not linked to any variable or any other place so how this scripts works without linked or connected to anywhere (sorry if this ques is dumb but i m newbie in php Can anyone explain to me why this isn't working , and explain how i would rectify the problem, Many Thanks. Code: [Select] <? $rawr = mysql_real_escape_string($_GET['type']); "SELECT COUNT(id) FROM items Where type = $rawr" ?> I have some code that is supposed to get data from a site and then insert the gathered data into a database. The code does start adding data to database but it isn't adding data that it is getting from site that has starting data. What I mean is this. This code gets current player scores and such from gametracker and adds that to the database. then it will get player scores from my own tracker and add new scores to the ones that weere adde3d from game tracker. We did this so that our game servers continue tracking the scores for our new server trackers and not start out at zero initially. How ever when we run the code it says data was not written to database probably because server does not exists in database when in fact it really does. SO if someone could explain the code to me as to what it is doing then maybe I can figure out why it isn't working. Code: [Select] function InitializeServer( $sid, $ip, $name, &$totalplayers ) { !mysql_query( "DROP TABLE ".SERVER_TABLE_NAME.$sid.";" ); // we don't care if this fails if table didn't exist before if( !mysql_query( "CREATE TABLE ".SERVER_TABLE_NAME.$sid." (" ." `name` varchar(32), `score` int, `goal` int default 0, `leader` int default 0, `enemy` int default 0, `kia` int default 0, `roe` int default 0," ." PRIMARY KEY(`name`) );" ) ) { die( "Error creating table: ".mysql_error() ); } $id = 1; $page = 1; $done = FALSE; while( !$done ) { $data = http_request( "www.gametracker.com", "/server_info/".$ip."/top_players/?searchipp=50&searchpge=$page" ); $pos = 0; $out = ""; while( !$done ) { $num = GetStringInMiddle( $data, $pos, '<td class="c01">', '</td>' ); if( $num == NULL && $id > 1 ) break; if( $num != $id || $num == NULL ) { $done = TRUE; break; } $name = GetStringInMiddle( $data, $pos, '/">', '</a>' ); if( $name === NULL ) break; $score = GetStringInMiddle( $data, $pos, '<td class="c04">', '</td>' ); //$timePlayed = GetStringInMiddle( $data, $pos, '<td class="c05">', '</td>' ); //$scorePerMinute = GetStringInMiddle( $data, $pos, '<td class="c06">', '</td>' ); if( $out != "" ) $out .= ",\n"; $out .= "('$name', '$score')"; $id ++; $totalplayers ++; } // Write data to database, if any if( $out != "" ) { $cmd = "INSERT INTO ".SERVER_TABLE_NAME.$sid." (`name`, `score`) VALUES ".$out.";"; if( !mysql_query( $cmd ) ) { echo "Error with insert: ".mysql_error()."\n[$cmd]"; } } echo ($id-1)." "; flush(); ob_flush(); $page++; } if( $id > 1 ) echo "\nInitalized server #$sid: ".$ip." - ".$name." - ".($id-1)." players added<br />"; else echo "\nServer #$sid: ".$ip." - ".$name." - no players added (server probably not in database)<br />"; flush(); ob_flush(); } $sid, $ip and such are defined in other files that are included in the same file as this code is included in. Hi guys, for a long time now I have been using the same block of code to include my content pages into my layout, I understand what it does as a whole, but I have never understood what the individual parts do, could someone explain the main parts please. Thanks. here's the code: Code: [Select] <?php if (isset($_GET['page'])) { if (strpos($_GET['page'], "/")) { $direc = substr(str_replace('..', '', $_GET['page']), 0, strpos($_GET['page'], "/")) . "/"; $file = substr(strrchr($_GET['page'], "/"), 1); if (file_exists($direc.$file.".php")) { require($direc.$file.".php"); } else { require("error.php"); } } else { if (file_exists(basename($_GET['page']).".php")) { require(basename($_GET['page']).".php"); } else { require("error.php"); } } } else { require("default.php"); } ?> Hi everyone! I'm making friends with DOM+PHP+XML. I found an example in w3school tutorial but there are some things I don't understand. Code: [Select] <?php $q=$_GET["q"]; $xmlDoc = new DOMDocument(); $xmlDoc->load("cd_catalog.xml"); $x=$xmlDoc->getElementsByTagName('ARTIST'); for ($i=0; $i<=$x->length-1; $i++) { //Process only element nodes if ($x->item($i)->nodeType==1) { if ($x->item($i)->childNodes->item(0)->nodeValue == $q) { $y=($x->item($i)->parentNode); } } } $cd=($y->childNodes); for ($i=0;$i<$cd->length;$i++) { //Process only element nodes if ($cd->item($i)->nodeType==1) { echo("<b>" . $cd->item($i)->nodeName . ":</b> "); echo($cd->item($i)->childNodes->item(0)->nodeValue); echo("<br />"); } } ?> This part I understand, it's a PHP method: Code: [Select] $xmlDoc = new DOMDocument(); $xmlDoc->load("cd_catalog.xml"); $x=$xmlDoc->getElementsByTagName('ARTIST'); but I don't get the rest , and what is this Code: [Select] $x->length-1 means? What does this mean? Code: [Select] nodeType==1 what do the numbers represent? Can anyone give me the URL of a good XML PHP tutorial? Thank you i found some code that is helping me extract a table. Currently it works and extracts every single table row however it duplicates some of the rows. I am new to XPATH and would appreciate if someone could comment the following code so that I can alter it to meet my needs. Thanks. $newDom->appendChild($newDom->importNode($item,true)); $xpath = new DOMXPath( $newDom ); foreach ($item->attributes as $attribute) { for ($node = $item->firstChild; $node !== NULL; $node = $node->nextSibling) { if (($attribute->nodeName =='valign') && ($attribute->nodeValue=='top')) { print($node->nodeValue); } else { print("<br>".$node->nodeValue); } } print("<br>"); Sorry this may sound insane. Is there anyway to accomplish this, using paypal you can creat buy it now buttons and whatnot. The problem with these is you set the price of the time when making the button. Is there a way to set the price with php thus creating a dynamic price instead of a static one? I know you can send paypal vars. but is there a way to edit the price? Thanks I hope that makes sense at all |