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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -