
PHPisaveryhandy--andwidespread--Webprogramminglanguage.ButasTomScottdemonstratesinthevideobelow,it'salsoquitevulnerabletoabasicSQLinjectionattackthatcouldgiveahackeraccesstoasite'sunderlyingdatabase.AsScottexplains,PHP'ssimplicitycanalsobeitsundoing.WithjustafewinputsstructuredasSQLqueries,athirdpartycanendupretrieving,altering,ordeletingtheentiredatabase.Somuchfordatasecurity!...

WebCraftsmanship&CommentaryNov2013WebAdvent2013In2007,overwhelmedwithmyjealousyofthePerlcommunity'sawesomeAdventcalendar,IdecidedPHPneededone,too.Ofcourse,thisthoughtdidn'toccurtomeuntiltheveryendofNovember.Nonetheless,tha…Apr2013DarkPatternsDarkpatternshavebeenaroundforacoupleofyears,butitseemsliketheconceptisgainingsteamlately.It’snormalfordesign(andcopy)totr...
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...