FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Dynamic redirect - losing variable
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Dynamic redirect - losing variable [message #179894] Mon, 17 December 2012 17:23 Go to next message
budatlitho is currently offline  budatlitho
Messages: 4
Registered: December 2012
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Hi:
I'm struggling with adding to a redirect url - I lose the $id value. What am I missing?
THANKS in advance.

$redirect_url = "<meta http-equiv='refresh' content='1;URL=http://www.districtnine.org/login.php?id='".$id." />";
echo $redirect_url;
Re: Dynamic redirect - losing variable [message #179895 is a reply to message #179894] Mon, 17 December 2012 17:32 Go to previous messageGo to next message
Christoph Becker is currently offline  Christoph Becker
Messages: 91
Registered: June 2012
Karma: 0
Member
add to buddy list
ignore all messages by this user
budatlitho wrote:
> Hi:
> I'm struggling with adding to a redirect url - I lose the $id value. What am I missing?
> THANKS in advance.
>
> $redirect_url = "<meta http-equiv='refresh' content='1;URL=http://www.districtnine.org/login.php?id='".$id." />";
> echo $redirect_url;

You're excluding the $id from the value of the "content" attribute. Try:

$redirect_url = "<meta http-equiv='refresh'
content='1;URL=http://www.districtnine.org/login.php?id=".$id."' />";

You might consider to do the redirect "directly" by sending the
appropriate "Location" HTTP response header, instead of letting the
browser do the redirect.

--
Christoph M. Becker
Re: Dynamic redirect - losing variable [message #179897 is a reply to message #179895] Mon, 17 December 2012 18:54 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
add to buddy list
ignore all messages by this user
Christoph Becker wrote:

> budatlitho wrote:
>> I'm struggling with adding to a redirect url - I lose the $id value. What
>> am I missing? THANKS in advance.
>>
>> $redirect_url = "<meta http-equiv='refresh'
>> content='1;URL=http://www.districtnine.org/login.php?id='".$id." />";
>> echo $redirect_url;
>
> You're excluding the $id from the value of the "content" attribute. Try:
>
> $redirect_url = "<meta http-equiv='refresh'
> content='1;URL=http://www.districtnine.org/login.php?id=".$id."' />";
>
> You might consider to do the redirect "directly" by sending the
> appropriate "Location" HTTP response header, instead of letting the
> browser do the redirect.

No, they definitely SHOULD: <www.w3.org/QA/Tips/reback>


PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
Re: Dynamic redirect - losing variable [message #179904 is a reply to message #179895] Tue, 18 December 2012 09:44 Go to previous message
budatlitho is currently offline  budatlitho
Messages: 4
Registered: December 2012
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
On Monday, December 17, 2012 5:32:22 PM UTC-5, Christoph Becker wrote:
> budatlitho wrote:
>
>> Hi:
>
>> I'm struggling with adding to a redirect url - I lose the $id value. What am I missing?
>
>> THANKS in advance.
>
>>
>
>> $redirect_url = "<meta http-equiv='refresh' content='1;URL=http://www.districtnine.org/login.php?id='".$id." />";
>
>> echo $redirect_url;
>
>
>
> You're excluding the $id from the value of the "content" attribute. Try:
>
>
>
> $redirect_url = "<meta http-equiv='refresh'
>
> content='1;URL=http://www.districtnine.org/login.php?id=".$id."' />";
>
>
>
> You might consider to do the redirect "directly" by sending the
>
> appropriate "Location" HTTP response header, instead of letting the
>
> browser do the redirect.
>
>
>
> --
>
> Christoph M. Becker

Christoph:
THANKS- that's what I needed. The reason I need to script this way is that two different URLs are needed based on whether $id has a value, and if $id does have a value, it populates a field on a login page, resulting in the user just having to enter their password. Otherwise, the user is directed to a different page to establish a non-member account. This is all triggered by scanning a dynamic QR on the mailing label.
There may be an easier way to do it, but this will (now!) work.
Bud :-))
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Re: Converting file from word.doc to pdf...
Next Topic: Gettting values from URL in PHP 5.4
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Dec 11 18:02:19 EST 2017

Total time taken to generate the page: 0.00646 seconds