bejayel
09-08-2003, 09:04 AM
ok ok ok, so i have this problem. i recently installed php 4.2.3 into iis. (i used the zipped binaries, not the exe installer) now here is my problem. none of my scripts really work properly, for instance it wont show the ip address, or the browser the person is using. a lot of help woudl be greatly appreciated. phpinfo() can be found at
http://64.110.196.151/test2.php
and a few examples of what is going wrong can be found at
http://64.110.196.151/test1.php
<? print (date("F d, Y")); ?>
<br>
<br>
<?
if ($weapon=="windforce" || $weapon=="gul") {
if ($weapon=="windforce") {
print "You picked a windforce";
} elseif ($weapon=="gul") {
print "You picked a gul.";
}
}
?>
that is the script i used for test 2, but ti doesnt want to work... please help me. thanks in advance.
Originally posted by shockertwin009
<? print (date("F d, Y")); ?>
<br>
<br>
<?
if ($weapon=="windforce" || $weapon=="gul") {
if ($weapon=="windforce") {
print "You picked a windforce";
} elseif ($weapon=="gul") {
print "You picked a gul.";
}
}
?>
clicking on the test1 link, it shows the date just fine. i don't see any data setting the value for the $weapon before the if statements in your example coding, so nothing else is printed out as expected. perhaps try this...
<?php
if($weapon=="windforce"){
echo "You picked a windforce.";
} elseif($weapon=="gul") {
echo "You picked a gul.";
} else {
echo "You do not have any weapon picked.";
}
?>
bejayel
09-08-2003, 10:23 PM
soo close, now all it shows is the else statement. and nothing but what is in it. How about this, my target is sending somethign through the url to have it show something differant depending on what is in the url, obviously. anyway when i put in teh url
http://64.110.196.151/test1.php?weapon=gul
or
http://64.110.196.151/test1.php?weapon=windforce
it still only shows the what is under the else part of the code...
and no matter hwo i send it through, either form or link, or simply by typing it, it doesnt want to work at all. thanks again.
try changing...
$weapon
in your coding into this...
$_GET['weapon']
that should grab the value from the URL.
bejayel
09-09-2003, 03:41 AM
lol that never worked like that under php 5.0
oh well thanks you soo much. thats why i downgraded to 4.2.3 cause its kinda wut i learned with... but yeah thank you sooooo much. very very much appreciated.
Originally posted by shockertwin009
lol that never worked like that under php 5.0
5?
i thought we are up to 4.3.3 so far.
perhaps 5 is a beta?
and using the GET, POST or REQUEST super globals are now considered the correct way of doing things as the "php.ini" file may have normal globals turned off for security reasons. so that means normal variables will not be able to capture the values like before.