You are here: Re: header... nop! « PHP Programming Language « IT news, forums, messages
Re: header... nop!

Posted by Michael Fesser on 06/07/07 18:59

..oO(vinnie)

>i insert the header in the name.php file that a basic form use to go
>to a specific page if something happen, but it does not work...
>Here is the code i use:
>
><?php
>if ($_POST[name])
> {
> header ("Location: http://www.XXXXYYYY.com/home.html");
> exit;
> }
>?>
>
>What's wrong?

Nothing, except for the missing quotes around your array key:

if ($_POST['name']) {
...
}

Set error_reporting to E_ALL in your php.ini to see such mistakes. The
rest of the code is correct, so the questions are

* How is your form submitted (GET or POST)?
* Does $_POST contain anything at all? Check with var_dump().
* Does $_POST['name'] contain a value that evaluates to TRUE? Remember
that empty strings and '0' will evaluate to FALSE.
* What do you expect $_POST['name'] to be?

Micha

 

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

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