Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
$_GET and URL problem
Old 03-17-2011, 08:34 PM $_GET and URL problem
Skilled Talker

Posts: 87
Trades: 0
So, here is the scenario. I'm creating an application that requires users to log in. If they are not logged in, I redirect them to the login page, where after they log in, they can access specific pages. For example:

- User tries to access mywebsite.com/app/somepage.php?var1=boo&var2=foo&var3=bar&var4=garpl y
- User is not currently logged in
- User is redirected to the log in page
- User logged in successfully
- User is redirected back to mywebsite.com/app/somepage.php?var1=boo&var2=foo&var3=bar&var4=garpl y

I'm having a problem with the redirection page to the specific page part. If I pass the return address to the log in page and then use the $_GET statement to get the URL, it only gets mywebsite.com/app/somepage.php?var1=boo. The rest of the arguments get chopped off... how do I do something like this correctly?
__________________

Please login or register to view this content. Registration is FREE
- The most comprehensive online resource for students and educators.
yuechen is offline
Reply With Quote
View Public Profile Visit yuechen's homepage!
 
 
Register now for full access!
Old 03-18-2011, 02:02 PM Re: $_GET and URL problem
Super Spam Talker

Posts: 880
Name: Paul W
Trades: 0
See http://us.php.net/manual/en/wrappers.php.php or you can get the data from globals $_GET and HTTP_REFERER and reconstruct the URL and get string
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 03-18-2011, 02:31 PM Re: $_GET and URL problem
Skilled Talker

Posts: 87
Trades: 0
I'm afraid I don't quite understand... could you please elaborate?
__________________

Please login or register to view this content. Registration is FREE
- The most comprehensive online resource for students and educators.
yuechen is offline
Reply With Quote
View Public Profile Visit yuechen's homepage!
 
Old 03-18-2011, 02:45 PM Re: $_GET and URL problem
Super Spam Talker

Posts: 880
Name: Paul W
Trades: 0
Sorry, memory going:

Come in to page http://x.om/z.php?b=1&c=2 The bit before the ? is available in one variable and the bit after in another.

PHP Code:
$target_url $_SERVER['HTTP_REFERER'] . "?" $_SERVER['QUERY_STRING']; 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to $_GET and URL problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13889 seconds with 12 queries