Jump to content


Photo

querystring question


  • Please log in to reply
3 replies to this topic

#1 lin

lin
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationSomewhere in the United Kingdom, I think!

Posted 23 April 2006 - 01:45 PM

hi all


just a question about query strings. I know how to make simple ones but how would i make a querystring like:

[a href=\"http://www.domain.com/account/login/?continue=redirect_url\" target=\"_blank\"]http://www.domain.com/account/login/?continue=redirect_url[/a]

i am guessing index page is in the /login/ folder which display the login part but on the last bit how does the browser know to redirect to the redirect_url when login is successful.

thanks

lin

#2 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 23 April 2006 - 02:37 PM

if you omit the 'index.php'/'index.htm' part, they will just default to that. so in your above example, it is equivalent of:
[a href=\"http://www.domain.com/account/login/index.php?continue=redirect_url\" target=\"_blank\"]http://www.domain.com/account/login/?continue=redirect_url[/a]

as for redirecting afterwards, the $_GET array and 'header' function is used.

$redirect_to = $_GET['continue'];
header("Location: $redirect_to");
exit;

cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#3 lin

lin
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationSomewhere in the United Kingdom, I think!

Posted 23 April 2006 - 03:16 PM

[!--quoteo(post=367690:date=Apr 23 2006, 09:37 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Apr 23 2006, 09:37 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
if you omit the 'index.php'/'index.htm' part, they will just default to that. so in your above example, it is equivalent of:
[a href=\"http://www.domain.com/account/login/index.php?continue=redirect_url\" target=\"_blank\"]http://www.domain.com/account/login/?continue=redirect_url[/a]

as for redirecting afterwards, the $_GET array and 'header' function is used.

$redirect_to = $_GET['continue'];
header("Location: $redirect_to");
exit;

cheers
Mark
[/quote]

where does the url go which it redirect to

thanks

paul

#4 lin

lin
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • LocationSomewhere in the United Kingdom, I think!

Posted 23 April 2006 - 06:29 PM

[!--quoteo(post=367699:date=Apr 23 2006, 10:16 AM:name=lin)--][div class=\'quotetop\']QUOTE(lin @ Apr 23 2006, 10:16 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
where does the url go which it redirect to

thanks

paul
[/quote]

dont worry i got it now cheers




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users