Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #7826 > unrolled thread

Dynamic redirect - losing variable

Started bybudatlitho@gmail.com
First post2012-12-17 14:23 -0800
Last post2012-12-18 06:44 -0800
Articles 4 — 3 participants

Back to article view | Back to comp.lang.php


Contents

  Dynamic redirect - losing variable budatlitho@gmail.com - 2012-12-17 14:23 -0800
    Re: Dynamic redirect - losing variable Christoph Becker <cmbecker69@gmx.de> - 2012-12-17 23:32 +0100
      Re: Dynamic redirect - losing variable Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-18 00:54 +0100
      Re: Dynamic redirect - losing variable budatlitho@gmail.com - 2012-12-18 06:44 -0800

#7826 — Dynamic redirect - losing variable

Frombudatlitho@gmail.com
Date2012-12-17 14:23 -0800
SubjectDynamic redirect - losing variable
Message-ID<20d8e05a-6cb1-4b19-8b2f-58346c116352@googlegroups.com>
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;

[toc] | [next] | [standalone]


#7827

FromChristoph Becker <cmbecker69@gmx.de>
Date2012-12-17 23:32 +0100
Message-ID<kao6fb$otm$1@speranza.aioe.org>
In reply to#7826
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

[toc] | [prev] | [next] | [standalone]


#7829

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-18 00:54 +0100
Message-ID<2832974.UPYZDPpjPl@PointedEars.de>
In reply to#7827
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

[toc] | [prev] | [next] | [standalone]


#7836

Frombudatlitho@gmail.com
Date2012-12-18 06:44 -0800
Message-ID<6d397881-884a-4a6d-ac2a-46965658e223@googlegroups.com>
In reply to#7827
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 :-))

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web