By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,743 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,743 IT Pros & Developers. It's quick & easy.

Sending a variable

P: n/a
In foo.php I do (essentialy)

header("Location: http://x.y.z/bar.php?".a000=1&Vtmpfname=".$Vtmpfname;

where $Vtmpfname has a proper value, atleast I can see it if I echo it in
foo.php.

But in bar.php, I don't get any value for a000 or Vtmpfname.
I thought I would get those variables.

Can anyone here help me spot the error?
Thank you.
--
I didn't know sci.bio.paleontology was that low traffic until I tried read
the thread "Where is everyone?" and found it to be expired.
Jan 31 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 31 Jan, 16:58, Gunnar G <deb...@comhem.sewrote:
In foo.php I do (essentialy)

header("Location:http://x.y.z/bar.php?".a000=1&Vtmpfname=".$Vtmpfname;

where $Vtmpfname has a proper value, atleast I can see it if I echo it in
foo.php.

But in bar.php, I don't get any value for a000 or Vtmpfname.
I thought I would get those variables.

Can anyone here help me spot the error?
Thank you.
--
I didn't know sci.bio.paleontology was that low traffic until I tried read
the thread "Where is everyone?" and found it to be expired.
You missed the closing bracket on the header call.

Jan 31 '07 #2

P: n/a
Rik
Captain Paralytic <pa**********@yahoo.comwrote:
On 31 Jan, 16:58, Gunnar G <deb...@comhem.sewrote:
>In foo.php I do (essentialy)

header("Location:http://x.y.z/bar.php?".a000=1&Vtmpfname=".$Vtmpfname;

where $Vtmpfname has a proper value, atleast I can see it if I echo it
in
foo.php.

But in bar.php, I don't get any value for a000 or Vtmpfname.
I thought I would get those variables.
You missed the closing bracket on the header call.
That's not the only thing he missed.
Let's break it down:

"Location:http://x.y.z/bar.php?" -string
.. -concatenate
a000 -defined constant ?
= -assignment operator
1 -integer
& -bitwise AND
Vtmpfname -defined constan ?
= -assignment
".$Vtmpfname; -unclosed string.

I'd definetely say this cannot be the real code :-).

Now, anough teasing, let's help the OP:
$a000 & $Vtempfname will only be available in bar.php if register_globals
is enabled. This would not be a wise choice. To access the variables use
$_GET['a000'] & $_GET['Vtempfname'].
--
Rik Wasmus
Jan 31 '07 #3

P: n/a
>>In foo.php I do (essentialy)
That's not the only thing he missed.
Notice the word essentialy ;-)
Now, anough teasing, let's help the OP:
$a000 & $Vtempfname will only be available in bar.php if register_globals
is enabled. This would not be a wise choice. To access the variables use
$_GET['a000'] & $_GET['Vtempfname'].
Oh my... I'm going to set fire to my old PHP programming book and get me one
that covers PHP 5.
Thanks!
Jan 31 '07 #4

P: n/a
Rik
Gunnar G <de****@comhem.sewrote:
>>>In foo.php I do (essentialy)
That's not the only thing he missed.
Notice the word essentialy ;-)
>Now, anough teasing, let's help the OP:
$a000 & $Vtempfname will only be available in bar.php if
register_globals
is enabled. This would not be a wise choice. To access the variables use
$_GET['a000'] & $_GET['Vtempfname'].
Oh my... I'm going to set fire to my old PHP programming book and get me
one
that covers PHP 5.
Well, PHP 4.2 actually (that's when it defaulted to off). You're right
though that books assuming register_globals is on are outdated, sloppy, or
both :)
--
Rik Wasmus
Jan 31 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.