
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...