Forums

This topic is locked

Pass URL to a page through login page in PHP

Posted 28 Feb 2005 22:00:15
1
has voted
28 Feb 2005 22:00:15 Ric A posted:
I try to pass a variable through login page to a content page, and I want to pass this variable to login page if the user not logged, but this don't work.
Example
I have a link in page1.php (page2.php?video=1), the page2.php is protect by username and password. If the users already logged they can view the content of the page, but if they don't logged I want to redirect to login.php page with the variable (login.php?video=1). After they logins return to the page2.php for view the content, that they already clicked in page1.php.

If somebody help me?
How can I do to retreive the variable from the page2.php to login.php and sent it to page2.php?

Thanks
Ric

Replies

Replied 28 Feb 2005 23:49:23
28 Feb 2005 23:49:23 Chris Charlton replied:
I'd make an <i>If statement</i> at the top of the login page, checking if the var (or any page-routing var) is set, then just tuck that away in a SESSION var. Allow the login script to do its thing, then on the logged in page, run another <i>If statement</i> checking for that pass-along var and redirect as needed.

Hope that helps some. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

~ ~ ~ ~ ~ ~ ~
Chris Charlton <i>- DMXzone Manager</i>
<font size=1>[ Studio MX/MX2004 | PHP/ASP | SQL | XHTML/CSS | XML | Actionscript | Web Accessibility | MX Extensibility ]</font id=size1>
Replied 01 Mar 2005 12:35:41
01 Mar 2005 12:35:41 Ric A replied:
Thanks, but Is somebody help me about the script?
I found a script that it sent a URL to login.php, but How can I decode the URL:
this is the url that I receive from page2.php with this function
&lt;?php echo urldecode($QUERY_STRING); ?&gt;<b></b>
and the result is this:
movie=&accesscheck=/video.php?movie=1<b></b>
How can I take only the part of the url (movie=1)?

Thanks
Ric

Edited by - pulls on 01 Mar 2005 13:31:14
Replied 16 Mar 2007 04:06:55
16 Mar 2007 04:06:55 Ninja Coder replied:
I'm trying to do a similar thing. OK...You know how on firefox you can login to a site with the name/pass in the url? like this:

<pre id=code><font face=courier size=2 id=code>username<img src=../images/fwzone/forum/icon_smile_tongue.gif border=0 align=middle> </font id=code></pre id=code>

well I was wondering if i could do this to log into a forum like phpbb or smf. Is this possible? If so then please tell me how! <img src=../images/fwzone/forum/icon_smile.gif border=0 align=middle>

Thank You,

~Ninja Coder

<img src="http://www.locohacker.net/paltalk/userpix/24031_Ninja_Banner3_1.jpg" border=0>

Edited by - 777Ninja777 on 16 Mar 2007 04:09:13
Replied 16 Mar 2007 04:06:59
16 Mar 2007 04:06:59 Ninja Coder replied:
I'm trying to do a similar thing. OK...You know how on firefox you can login to a site with the name/pass in the url? like this:

username<img src=../images/fwzone/forum/icon_smile_tongue.gif border=0 align=middle>

well I was wondering if i could do this to log into a forum like phpbb or smf. Is this possible? If so then please tell me how! <img src=../images/fwzone/forum/icon_smile.gif border=0 align=middle>

Thank You,

~Ninja Coder

<img src="http://www.locohacker.net/paltalk/userpix/24031_Ninja_Banner3_1.jpg" border=0>
Replied 16 Mar 2007 04:11:45
16 Mar 2007 04:11:45 Ninja Coder replied:
hey wait! wuts wrong here!? how do i disable smilies..lol....that smily is not supposed to be between username and password..lol...and why are there two of my same post???

<img src="http://www.locohacker.net/paltalk/userpix/24031_Ninja_Banner3_1.jpg" border=0>

Reply to this topic