Jump to content

My PHP form isn't sending- I get a blank page. here is the form >


oavs

Recommended Posts

Hi

 

I was wondering if someone have quick look at my code below to see why its not working. CSimpleHitCounter.php and hits.txt is not essential but it used to work before until server backed up from the old files and don't know how I had it going.

 

Thanking you in advance.

 

 

 

<?php 

include_once("CSimpleHitCounter.php");  

$counter = new CSimpleHitCounter("hits.txt"); 
$counter->update_hits_file();


// EMAIL SENT TO THE VISITOR //
$to = "[email protected]";
$headers = 
 "From: OOOO - XYZ ts <[email protected]>"  . "\r\n" .
     "Subject: Your Login Details for your Art Work" .
     "Reply-To: [email protected]" . "\r\n" .
     "cc:$Email" . "\r\n" .
     "X-Mailer: PHP/" . phpversion();

$from_header = 
"Hello $Name, 

Thankyou for allowing us to create and ammend your artwork commissioned to OOOO .

Please use following login details to see your project. 
Click on to the URL link below to visit the website. Then select LOGIN - Client Project Login from the navigation menu and enter your user name and pasword listed below. 

URL: http://www.oooo.com.au
Username: admin 
Password: enter 

$Name, so far you have seen your artwork ".$counter->get_page_loads()." times

We have received following contact details from you. 

Name: $Name $Surname,
Company: $Company
Phone: $Phone 
Email: $Email 

You have also accepted OOOO Terms and Conditions of viewing your logo commissioned to OOOO
";

if($Name != "")
if($Surname != "")
if($Company != "")
if($Phone != "")
if($Email != "")
{
   //send mail - $subject & $contents come from surfer input
  // mail($to, $Company, $from_header, "Bcc: $Email" . $headers);
  mail($to, $subject, $from_header, $headers);



   // redirect back to url visitor came from
   header("Location: select.php");
}
  else
{
   print("<HTML><BODY>Error, no comments were submitted!");
   print("</BODY></HTML>");
}
?>

If you add error_reporting( E_ALL ) to the top of your code do you see any errors?

 

Sometimes blank pages can be because of runtime errors and the server not being

set to show them.  In some cases you may need to upload a .htaccess that sets the PHP

flag display_errors

Thanks but did and its reporting this. What is that mean?

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/oavscom/public_html/ecomail/send.php on line 17

 

Line  16 >    "cc:$Email"

Line 17 >    "X-Mailer: PHP/" . phpversion();

Line 18 >                            ......................... blank line

Line 19 >      $from_header =

Line 20 >      "Hello $Name,

Line 21 >                            ......................... blank line

 

etc 

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.