Forum Moderators: coopster
the run down ..... i was trying to figure out how 2 sets of ppl can go to a webpage and based off there IP address <192 = usersetA and 32 =usersetb> goto the same webpage but a different set of CSS load.
the code
HTML page
<html>
<script type="text/javascript" src="ip.php"></script>
<body>
<script>
var confirmJS=<?php echo ($rest);?>;
if (confirmJS!=1)
{
document.writeln("correct");
}
else
{
document.writeln("hmmmmmmm");
}
document.writeln("<br>" + "The divisor is " + divisor);
// end hiding code -->
</script>
</body>
</html>
the PHP page
<?
//"ip.php" example- display user IP address on any page
Header("content-type: application/x-javascript");
$serverIP=$_SERVER['REMOTE_ADDR'];
$rest = substr($serverIP,0, 1);
echo "document.write(\"Your IP address is: <b>" . $rest . "</b>\")";
right now it doesnt look like the php is passing the var over everything comes up as a true statement.....
NEWBIE that is lost....
If you are reloading the page with each CSS request then just stick to PHP as this will be parsed each time the page is reloaded anyway.