Re: javascript & php

From: Date: Mon, 28 Jul 2003 11:02:41 +0000
Subject: Re: javascript & php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157159@lists.php.net to get a copy of this message
Hi Roman, I'm not sure if I understand what you want to do - but if you try to set your PHP-Variable with JavaScript it couldn't work. JavaScript is Clientside interpreted and PHP is Serverside interpreted, that means your PHP-Code is done before the JavaScript-Code. So the Webserver reads your $color Variable and sees that it is set to "<script><!--document.write(screen.colorDepth) file://--></script>" This value is obviously not in your database. Then the Webserver sends the resulting HTML to your browser. > $color = "<script><!-- > document.write(screen.colorDepth) > file://--> > </script>"; > > $query = mysql_query("select id from color where color = '$color' "); > $a = mysql_num_rows($query); Greetings Kristin Schesonka

« previous php.general (#157159) next »