What"s wrong with header = ("location: pagename.php") ?

What"s wrong with header = ("location: pagename.php") ?

am 04.10.2007 02:34:28 von Big Moxy

I'm sorry if this turns out to be a double post but I got an error
during the first attempt.

I'm perplexed at the error in the header = ('location: index.php'); I
have used this before successfully but this time the syntax checker at
http://www.meandeviation.com/tutorials/learnphp/php-syntax-c heck/
issues this message: Parse error: parse error, unexpected '=' in
quickform.php on line 48.
48: header = ('location: index.php');

Could someone please point me in the right direction?

Thank you!
- tim

session_start();
error_reporting(E_ALL);
$to = "tim@website.com";
$subject = "Quick Form";
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: $emailaddress\r\n";
$today_mm = date("M");
$today_dd = date("j");
$today_yyyy = date("Y");
$today = $today_mm." ".$today_dd.", ".$today_yyyy;
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$name = $_POST['firstname']." ".$_POST['lastname'];
$homephone = $_POST['homephone'];
$workphone = $_POST['workphone'];
$time2contact = $_POST['time2contact'];
$emailaddress = $_POST['emailaddress'];
$propertyaddress = $_POST['propertyaddress'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$reason = $_POST['reason'];
$amountowed = $_POST['amountowed'];
$leastamount = $_POST['leastamount'];
$propertylocation = $city." ".$state." ".$zipcode;

$message = "Date: " . $today . "
";
$message.= "Name: " . $name . "
";
$message.= "Home Phone: " . $homephone . "
";
$message.= "Work Phone: " . $workphone . "
";
$message.= "Email Address: " . $emailaddress . "
>";
$message.= "Property Address: " . $propertyaddress .
"
";
$message.= "Property Location: " . $propertylocation .
"
";
$message.= "Amount Owed: " . $amountowed . "
";
$message.= "Lowest Offer Accepted: " . $leastamount . "
>";
$message.= "Reason for Selling: " . $reason . "
";
$message.= "Additional Information
";
$message.= "Requestor IP Address: " . $ip . "
";
$message.= "Requestor IP Address: " . $ip . "
";
$message.= "Requestor Browser Type: " . $httpagent . "
";
$message.= "Referring URL: " . $httpref . "
";

$_SESSION['sent_message'] = "Thank you for your request! Someone will
be contacting you soon.";
mail($to_address, $subject, $message, $headers);
header = ('location: index.php');
?>
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



Thank You!






Re: What"s wrong with header = ("location: pagename.php") ?

am 04.10.2007 03:14:01 von Shelly

"Big Moxy" wrote in message
news:1191458068.443880.280090@g4g2000hsf.googlegroups.com...
> I'm sorry if this turns out to be a double post but I got an error
> during the first attempt.
>
> I'm perplexed at the error in the header = ('location: index.php'); I
> have used this before successfully but this time the syntax checker at
> http://www.meandeviation.com/tutorials/learnphp/php-syntax-c heck/
> issues this message: Parse error: parse error, unexpected '=' in
> quickform.php on line 48.

That should read:
header('location: index.php');

The error message was quite explicit!

Shelly

Re: What"s wrong with header = ("location: pagename.php") ?

am 04.10.2007 08:45:30 von celalo

just write
header ('location: index.php');
instead of
header = ('location: index.php');

header is a function not a variable. dont get confused with the
$headers variable you used. They are tottally different.

On Oct 4, 4:14 am, "Shelly" wrote:
> "Big Moxy" wrote in message
>
> news:1191458068.443880.280090@g4g2000hsf.googlegroups.com...
>
> > I'm sorry if this turns out to be a double post but I got an error
> > during the first attempt.
>
> > I'm perplexed at the error in the header = ('location: index.php'); I
> > have used this before successfully but this time the syntax checker at
> >http://www.meandeviation.com/tutorials/learnphp/php-syntax- check/
> > issues this message: Parse error: parse error, unexpected '=' in
> > quickform.php on line 48.
>
> That should read:
> header('location: index.php');
>
> The error message was quite explicit!
>
> Shelly

Re: What"s wrong with header = ("location: pagename.php") ?

am 04.10.2007 08:51:40 von luiheidsgoeroe

On Thu, 04 Oct 2007 08:45:30 +0200, celalo@gmail.com =
=

wrote:

> just write
> header ('location: index.php');
> instead of
> header =3D ('location: index.php');
>
> header is a function not a variable. dont get confused with the
> $headers variable you used. They are tottally different.

Actually it should be:
header ('Location: http://www.example.com/index.php');

Allthough by the grace of UA's they normally use the current domain, thi=
s =

is not in the specs.
-- =

Rik Wasmus

Re: What"s wrong with header = ("location: pagename.php") ?

am 04.10.2007 14:01:18 von colin.mckinnon

On 4 Oct, 07:51, "Rik Wasmus" wrote:
> On Thu, 04 Oct 2007 08:45:30 +0200, cel...@gmail.com
> wrote:
>
> > just write
> > header ('location: index.php');
> > instead of
> > header = ('location: index.php');
>
> > header is a function not a variable. dont get confused with the
> > $headers variable you used. They are tottally different.
>
> Actually it should be:
> header ('Location:http://www.example.com/index.php');
>
> Allthough by the grace of UA's they normally use the current domain, this
> is not in the specs.
> --
> Rik Wasmus

Actually it should be a 307 redirect (which needs to be explicitly
set)- not a 302 (default for Location: header).

C.

Re: What"s wrong with header = ("location: pagename.php") ?

am 04.10.2007 19:05:27 von Bucky Kaufman

"C. (http://symcbean.blogspot.com/)" wrote in
message news:1191499278.856207.310900@g4g2000hsf.googlegroups.com...

> Actually it should be a 307 redirect (which needs to be explicitly
> set)- not a 302 (default for Location: header).

I've never had a problem using the header location tag.
On what kind of setup is that 307 HTTP error required?

Re: What"s wrong with header = ("location: pagename.php") ?

am 05.10.2007 17:12:21 von Michael Fesser

..oO(Sanders Kaufman)

>"C. (http://symcbean.blogspot.com/)" wrote in
>message news:1191499278.856207.310900@g4g2000hsf.googlegroups.com...
>
>> Actually it should be a 307 redirect (which needs to be explicitly
>> set)- not a 302 (default for Location: header).
>
>I've never had a problem using the header location tag.
>On what kind of setup is that 307 HTTP error required?

It's a temporary redirect, while the 302 is rather unspecific. The 307
indicates that the target of the redirection might change or that the
entire redirect will be removed one day. But this is not the case here,
so I think the 302 is fine.

Micha