473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

header... nop!

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?

Jun 7 '07 #1
3 1550
..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
Jun 7 '07 #2
At Thu, 07 Jun 2007 18:04:04 +0000, vinnie let h(is|er) monkeys type:

>
<?php
if ($_POST[name])
{
header ("Location: http://www.XXXXYYYY.com/home.html");
exit;
}
?>
What's wrong?
Is any output sent before the header? (spaces or emptylines oustside <?PHP
?tags included)

--
Schraalhans Keukenmeester - sc*********@the.Spamtrapexample.nl
[Remove the lowercase part of Spamtrap to send me a message]

"strcmp('apples','oranges') < 0"

Jun 8 '07 #3
On Jun 7, 2:59 pm, Michael Fesser <neti...@gmx.dewrote:
.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
Thanks, it worked!!!!

Jun 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: John | last post by:
Hi. I am having a few header problems at the moment with a login page. I don't have my headers at the top of the page where I've learned I need to have them. However, I also know I'm supposed...
11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do...
3
by: Saurabh Aggrawal | last post by:
Hi, if (iter->m_name.compare(pstrName) == 0) { // Provide our object. *ppunkItem = iter->m_pUnknown; // Addref our object... iter->m_pUnknown->AddRef(); break; }
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
18
by: John Smith | last post by:
Hi all What does the group think of the practise of including one header file from inside another? I have some legacy code where this has been done, and it creates a dependency on a module...
6
by: Jason Collins | last post by:
There seems to be an inconsistency (bug?) in the way the Set-Cookie header is handled by the WebHeaderCollection. That is, the values of Set-Cookie, when an Expires is specified, contain the ","...
8
by: Randy Given | last post by:
When I look at the IL, using ILDASM, why does the VB.NET version have so many NOP statements? The C# version doesn't seem to. What gives?
0
by: Dean Hallman | last post by:
Hello, I am developing a BHO that should add a custom HTTP header on a specific domain only. Don't want the header globally, otherwise I could just add a registry key. So, on...
11
by: TefJlives | last post by:
Can someone please expain what is a NOP pointer, or give a good link? Thanks. Greg
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.