Re: Sending a variable



Captain Paralytic <paul_lautman@xxxxxxxxx> wrote:

On 31 Jan, 16:58, Gunnar G <deb...@xxxxxxxxx> wrote:
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
.



Relevant Pages

  • Re: Sending a variable
    ... where $Vtmpfname has a proper value, atleast I can see it if I echo it in ... I don't get any value for a000 or Vtmpfname. ...
    (comp.lang.php)
  • Sending a variable
    ... where $Vtmpfname has a proper value, atleast I can see it if I echo it in ... I don't get any value for a000 or Vtmpfname. ...
    (comp.lang.php)