|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Zealot
![]() ![]() Join Date: Jul 2006
Location: Closer than you think
Posts: 149
|
Redirect and $_SERVER['Request_URI']
I am trying to allow a redirect after logging in which is great when I have one variable.
On Page1.php I have PHP Code:
PHP Code:
ex. Page1.php?val1=1&val2=1 It will redirect me to Page1.php?val=1 Obvious when I am redirected to the login it's not copying correctly Login.php?r=/page1.php?val1=Page1.php?val1=1&val2=1 $_GET['r'] is equal to /page1.php?val1=Page1.php?val1 The & is starting another Variable. Any suggestions on this? |
|
|
|
|
|
#2 |
|
✯✯✯
![]() ![]() ![]() Join Date: Mar 2006
Posts: 5,009
|
PHP Code:
|
|
|
|
|
|
#3 |
|
SitePoint Wizard
![]() Join Date: Mar 2006
Posts: 6,132
|
dont forget to call exit(); after sending a redirect header unless you want your script to continue executing.
|
|
|
|
|
|
#4 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Apr 2004
Location: germany
Posts: 4,321
|
Quote:
Redirect to a relative url is a violation of the HTTP standard which states you must use only absolute urls (starting with protocol and host name). Direct ouputting unfiltered user input is always a security concern. You should at least validate request parameter to make sure it is really what you expect it to be. |
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 21:43.












Linear Mode
