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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -