Mailform
Moderator: General Moderators
Mailform
Hi im new on this forum, i have a problem with a mailform, onsubmit it sends the mail, but dosent return the new php-page....
Anyone please!
This is my code:
<?$to_email="michael.blomberg@automotorsport.se";
$subject="Intresserad av en bil";
$message="Hej jag heter $namn\nJag ar intresserad av en bil som du har ilager\nDu kan ringa mig pa telefonnummer:$tel\neller skicka ett mail till $dinmail\n";
mail($to_email,$subject,$message);
header("Location: tackar.php");------But this dosent work!!
exit;?>
Im getting this in the browser window:
Warning: Cannot add header information - headers already sent by (output started at /home/httpd/html/linden/mail.php:2) in /home/httpd/html/linden/mail.php on line 2
Anyone please!
This is my code:
<?$to_email="michael.blomberg@automotorsport.se";
$subject="Intresserad av en bil";
$message="Hej jag heter $namn\nJag ar intresserad av en bil som du har ilager\nDu kan ringa mig pa telefonnummer:$tel\neller skicka ett mail till $dinmail\n";
mail($to_email,$subject,$message);
header("Location: tackar.php");------But this dosent work!!
exit;?>
Im getting this in the browser window:
Warning: Cannot add header information - headers already sent by (output started at /home/httpd/html/linden/mail.php:2) in /home/httpd/html/linden/mail.php on line 2
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
the header function dosen't work with relative url's. try using this:
edit
-----
do not include the color stuff in the middle theren dosen't work with relative url's. try using this:
edit
-----
dl's. try using this:
edit
-----
do not include the color stuff in the mi http://" . $_SERVER['HTTP_HOST'] . "/takar.php");
[/php:1:fe889e9e2n dosen't work with relative url's. try using this:
n dosen't work with relative url's. try using this:
edit
-----
do not include the color stuff in the middle therer stuff in the middle thererl's. try using this:
edit
-----
do not include the color stuff in the middle thereHeader("Location: http://" . $_SERVER['HTTP_HOST'] . "/takar.php");
edit
-----
do not include the color stuff in the middle there
Code: Select all
Header("Location: http://" . $_SERVER['HTTP_HOST'] . "/takar.php");-----
do not include the color stuff in the middle theren dosen't work with relative url's. try using this:
Code: Select all
Header("Location: http://" . $_SERVERї'HTTP_HOST'] . "/takn dosen't work with relative url's. try using this:Code: Select all
Header("Location: http://" . $_SERVER['HTTP_HOST'n dosen't work with relative url's. try using this:Code: Select all
Header("Location: http://" . $_SERVERї'HTTP_HOST'] . "/takar.php");
[/php:1:fe889e9n dosen't work with relative url's. try using this:Code: Select all
Header("Location: http://" . $_SERVERї'HTTP_HOST'] . "/takar.php");
[/n dosen't work with relative url's. try using this:Code: Select all
Header("Location: http://" . $_SERVERї'HTTP_HOST'] . "/takar.php");-----
dl's. try using this:
Code: Select all
Header("Location: http://" . $_SERVER['HTTP_HOST'] . "/takar.php");-----
do not include the color stuff in the mi http://" . $_SERVER['HTTP_HOST'] . "/takar.php");
[/php:1:fe889e9e2n dosen't work with relative url's. try using this:
Code: Select all
Header("Location: http://" . $_SERVERї'HTTP_HOST'] . "/takar.php");Code: Select all
Header("Location: http://" . $_SERVER['HTTP_HOST'] . "/tn dosen't work with relative url's. try using this:Code: Select all
Header("Location: http://" . $_SERVER['HTTP_HOST'] . "/takar.php");-----
do not include the color stuff in the middle therer stuff in the middle thererl's. try using this:
Code: Select all
Header("Location: http://" . $_SERVER['HTTP_HOST'] . "/takar.php");-----
do not include the color stuff in the middle thereHeader("Location: http://" . $_SERVER['HTTP_HOST'] . "/takar.php");
edit
-----
do not include the color stuff in the middle there
Thanks again you guys are to kind......This is my code:
<?$to_email="michael.blomberg@automotorsport.se";
$subject="Intresserad av en bil";
$message="Hej jag heter $namn\nJag ar intresserad av en bil som du har ilager\nDu kan ringa mig pa telefonnummer:$tel\neller skicka ett mail till $dinmail\n";
mail($to_email,$subject,$message);
Header("Location: http://". $_SERVER['HTTP_HOST'] . "/tackar.php");
exit;?>
And now im getting this again:
Warning: Cannot add header information - headers already sent by (output started at /home/httpd/html/linden/mail.php:2) in /home/httpd/html/linden/mail.php on line 2
<?$to_email="michael.blomberg@automotorsport.se";
$subject="Intresserad av en bil";
$message="Hej jag heter $namn\nJag ar intresserad av en bil som du har ilager\nDu kan ringa mig pa telefonnummer:$tel\neller skicka ett mail till $dinmail\n";
mail($to_email,$subject,$message);
Header("Location: http://". $_SERVER['HTTP_HOST'] . "/tackar.php");
exit;?>
And now im getting this again:
Warning: Cannot add header information - headers already sent by (output started at /home/httpd/html/linden/mail.php:2) in /home/httpd/html/linden/mail.php on line 2
Change the URL back to what you had originally.
header("Location: tackar.php");
That is the way I do header stuff and never had any problem.
Mike
header("Location: tackar.php");
That is the way I do header stuff and never had any problem.
Mike
Last edited by mikeq on Thu May 23, 2002 3:25 am, edited 1 time in total.