Javascript write content into a PHP var to use in IF statement not working -
this code:
<script language="javascript" src="http://gd.geobytes.com/gd?after=-1&variables=geobytescountry,geobytescity"> </script> <?php $city = '<script language="javascript"> document.write(sgeobytescity); </script>'; if($city=='tijuana'){echo'this tijuana';} ?> i want use result document.write() inside php var validate city, i'm sure i'm doing right cause if echo $city var prints string s not working when using var inside if statement.
php executes on server , javascript executes on client. can pass values php javascript, not vice versa without ajax or post or method.
Comments
Post a Comment