You are here: Re: [PHP] Why this doesn't work ? « PHP « IT news, forums, messages
Re: [PHP] Why this doesn't work ?

Posted by Jochem Maas on 05/24/05 17:38

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@example.com"; ?>

>
> 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
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация