Jump to content

[SOLVED] Going to URL in php script


wlindy27

Recommended Posts

Hi, I am new to php and love it already, even though I am bad :)

 

The code I am trying to use is as follows:

    <?php

    $to = "[email protected]";

    $subject = " Invite";

    $body = $_REQUEST['Email'] ;

    $URL = "http://www.mysite.com/index.php?p=1_9";

    if (mail($to, $subject, $body)) {

   

 

header ('Location: '.$URL);

     

}

 

      else {

      echo("<p>Message delivery failed...</p>");

    }

    ?>

When I want it to navigate to my url in the header, I get this error:

 

 

Warning: Cannot modify header information - headers already sent by (output started at /home/Username/public_html/email.php:1) in /home/Username/public_html/email.php on line 9

 

Any help would be appreciated!

Link to comment
https://forums.phpfreaks.com/topic/177234-solved-going-to-url-in-php-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.