Re: Why this doesn't work ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mário Gamito wrote:
Hi,

hi,

the subject line of your post is not so good - make the subject relevant
to your question, asking 'why doesn't this work' is like asking 'why are we here'.

its liable to get you either:

a, no answers.
b, answers like this one.
c, really useful answer like '42'

ok on with the show....


Hi have this bit of code:

-----------------------------------------------------
echo"
 <script language=\"JavaScript\">
  window.location=\"valid_cv_insert.php?email=$email\"
 </script>";
-----------------------------------------------------

but when passing to file valid_cv_insert.php, $email value doesn't go along.

inside valid_cv_insert.php $email will only be set by the GET query if the ini setting register_globals is on.

try doing this inside valid_cv_insert.php:

<? var_dump( $_GET, $GET['email'] ); ?>

(depending on your version of php $_GET may or not exist in any case
check this out (read it carefully!):

http://php.net/en/language.variables.predefined



as a sidenote, make sure you're doing some dumb like:

<? $email = 'xxxxx'; echo $emial; ?>

... its the kind fo thing I have wasted literally days on in the past.

The page that has this code "knows" tha value of $email variable.

how does it know it? possibly because you do something like?:

<? $email = "joe@xxxxxxxxxxx"; ?>


How can i turn this around ?

you won't find much useful info on the back of your monitor ;-) it wasn't too clear exactly what you were looking for but the gist seems to be that you need to read up a bit on what register_globals is, the fact that the default has gone from 'On' to 'Off' somewhere in the not so distance past and what the consequences are for your code.

still stuck? go read the manual a bit... then come back and ask some more. :-)

good luck.


Thanking you in advance.

Warm regards,
Mário Gamito


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux