PHP Configuration Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rkrames
Forum Newbie
Posts: 4
Joined: Tue Oct 21, 2003 10:01 am

PHP Configuration Question

Post by rkrames »

I'm not an expert but it seems the function "requestType" is not passing variables. Does anyone have anb idea what my be wrong?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

What exactly is function 'requestType' ?
Any time i see "is not passing variables" i immediately think register_globals is Off.
If register_globals is Off then you will need to use $_POST['var'] and/or $_GET['var'] instead of where you would normally just use $var;
rkrames
Forum Newbie
Posts: 4
Joined: Tue Oct 21, 2003 10:01 am

Post by rkrames »

requestType is the name of a button that we use in a <form>, it is a POST method. The value is "Agree" and used to show up in requestType when the user clicked the "Agree" button. Now that we upgraded PHP the requestType variable stays empty, even if the form posts.

We found register_globals = Off and changed it to on but still no luck. Anything else we should look at?

Thanks!
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Did you restart the web server after changing register_globals? Check a <?php phpinfo() ?> page to be sure.

register_globals being Off is prefered by the way but of course sometimes changing all your code to work with them Off isn't practical ;)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

and some more infos would be nice. e.g. the output of the script at viewtopic.php?t=8815#65245 and maybe some of your code so we can spot possible errors
rkrames
Forum Newbie
Posts: 4
Joined: Tue Oct 21, 2003 10:01 am

Post by rkrames »

The problem was our php.ini file was in the wrong place, but now that that problem has been corrected, we have a new problem. It seems that our cookie is not getting stored for the session, so the user just keeps getting sent to our agree to terms page where the cookie is supposed to be passed. Any ideas?

Code: Select all

echo "request type:".$requestType;
	
	if($requestType=="Agree"){
		$expire=time()+60*60*24*30;
		setcookie("agreeDate", "10/15/2003",$expire);
		echo "<html><head><title></title></head><body>";
		echo "<script language='JavaScript'>window.location='doc_dl.php'</script></body></html>";
		die();
	}
rkrames
Forum Newbie
Posts: 4
Joined: Tue Oct 21, 2003 10:01 am

Post by rkrames »

problem solved thanks for the help
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

always help if you post the solution you found incase anyone else has the same problem in the future.

Mark
Post Reply