
Useanarray:$areas=array('apple'=>'Apple','lemon'=>'Lemon','orange'=>'Orange','banana'=>'Banana');Thenusethatarraytoprinttheselect:<select><?phpforeach($areasas$value=>$text):?><optionvalue="<?phpecho$value;?>"<?phpif($user_data[$area]==$value){echo'selected';}?>><?phpecho$text;?></option><?phpendforeach;?></select>Iamusing...
Iamanewbie,butIwasfinallyabletosolvethisproblembymovingthelocationofthemysqli_close().Ihaditrightafterthelast},butthenImoveditrightbeforeitanditworked.<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://http://www.zjjv.com///TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://http://www.zjjv.com///1999/xhtml"xml:lang="en"lang="en">&l...
Igettheseerrors:/home/nordic/www/Nordiceliteversiontwobeta/phpcron/_cron_minute.php:line1:?php:Nosuchfileordirectory/home/nordic/www/Nordiceliteversiontwobeta/phpcron/_cron_minute.php:line2:syntaxerrornearunexpectedtoken`{'/home/nordic/www/Nordiceliteversiontwobeta/phpcron/_cron_minute.php:line2:`if($_SERVER['PHP_SELF']!="/phpcron/_cron_minute"){'mycodeis:<?phpif($_SERVER...

Ifyoureallywanttoredirecttoanewpage,header('Location:<yournewURL>')isaboutassimpleasitgets.However,youcouldjustwriteyourPHPsuchthatthesamepagedoesdifferentthingsdependingoniftheuserisfoundornot.Thisisespeciallyusefulifwhateverdatabaseinteractionyouaredoingisexpensive,andyou'drathernotrepeatitmorethannecessary.Inaddition,someothercommentsmentionedthatyouarevulnerabletoSQLinjecti...

Dec.4-5,2013RedwoodCity,CATicketsonSaleNowPHP‘screatorRasmusLerdorfdidnotintendtocreateanentirelynewprogramminglanguage.Over20yearsago,theDanishsoftwareengineerwaslookingforabetterwaytofixwhathedescribedasa“youngproblem.”ThePHPprojectkickedoffin1995andwouldeventuallybecomeaserver-sidescriptinglanguageandgeneral-purposeprogramminglanguageusedbytechgiantslikeFac...