What is the output of this?
If he is receiving those emails, than yes, PHP
is enabled. If PHP was disabled, he would not be receiving any mails...
@CircleOfLinks
Did you try sending yourself test messages? Not saying that the script doesn't work... looks like it does and works correctly...
Check if you have monofont.ttf in the same directory that your CaptchaSecurityImages.php is located in.
Try the following...
- <?php
- session_start();
- if(isset($_POST['submit']))
- {
- // remember to set permissions for this script! If not, you
- // may not get the email.....
-
- $to = "danny@swiftproductions.com.au"; //Your Email ADDRESS!!!!!!!!!!!!!!
- $subj = 'Swiftproductions Contact Form';
- $cr = "\n";
-
- $name = $_POST['name'];
- $company = $_POST['company'];
- $telephone = $_POST['telephone'];
- $email = $_POST['email'];
- $messagebox = $_POST['messagebox'];
- $web = $_POST['web'];
- $graphic = $_POST['graphic'];
- $print = $_POST['print'];
- $updates = $_POST['updates'];
- $general = $_POST['general'];
- $seo = $_POST['seo'];
-
-
- if(($_SESSION['security_code'] == $_POST['security_code']) && (!empty($_SESSION['security_code'])) ) {
- $body .= 'Name: ' . $name . $cr . 'Company: ' . $company . $cr . 'Telephone: ' . $telephone . $cr;
- $body .= $body . 'email: ' . $email . $cr . 'Message Box: ' . $messagebox . $cr . $cr;
- $body .= $body . 'Web: ' . $web . $cr . 'Graphic: ' . $graphic . $cr . 'Print: ' . $print . $cr;
- $body .= $body . 'Updates: ' . $updates . $cr . 'General: ' . $general . $cr . 'seo: ' . $seo;
-
- mail($to, $subj, $body);
- unset($_SESSION['security_code']);
- } else {
- die('<p>The security image was wrong... please go back and try again.</p>'."\n");
- }
- }
- ?>
- <script type="text/javascript">
- gradualFader.init() //activate gradual fader
- </script>
If that doesn't work try the following script... It's a bit different and one page (Except the captchasecurityimage.php) but it still does the same thing...
- <?php
- session_start();
- ?>
- <!-- This page is mail.php //-->
- <?php
- if(empty($_POST['submit']))
- {
- ?>
- <form action="mail.php" method="post">
- <div>
- *Name: <input type="text" name="name" size="20" /><br />
- Company: <input type="text" name="company" size="20" /><br />
- *Telephone: <input type="text" name="telephone" size="20" /><br />
- *E-Mail: <input type="text" name="email" size="20" /><br />
- Send To: <select name="to">
- <option value="">Select Option</option>
- <option value="CustomerService">Customer Service</option>
- <option value="CustomerSupport">Customer Support</option>
- </select><br />
- Subject: <input type="text" name="subject" size="20" /><br />
- *Message:<br />
- <textarea rows="10" cols="25" name="message"></textarea><br />
- Choose an option:<br />
- <input type="checkbox" name="WD" value="Web Design"> Web Design
- <input type="checkbox" name="GD" value="Graphic Design"> Graphic Design
- <input type="checkbox" name="WU" value="Web Updates"> Web Updates
- <input type="checkbox" name="GE" value="General Enquiry"> General Enquiry<br />
- <input type="checkbox" name="PW" value="Print Work"> Print Work
- <input type="checkbox" name="H" value="Hosting"> Hosting
- <input type="checkbox" name="SEO" value="SEO Work"> SEO Work<br />
- Security Image:<br />
- <img src="CaptchaSecurityImages.php?width=100&height=40&characters=5" alt="Security Code" />
- <input id="sCode" name="security_code" type="text" size="33.5" /><br />
- <input type="submit" name="submit" value="submit" class="submit" /> <input type="reset" name="reset" value="reset" class="submit" />
- </div>
- </form>
- <p>* = Required Field</p>
- <?php
- } else {
- //Stripping the submitted information from HTML
- $_POST = array_map('strip_tags', $_POST);
-
- //Setting the values
- $name = $_POST['name'];
- $company = $_POST['company'];
- $telephone = $_POST['telephone'];
- $email = $_POST['email'];
- $to = $_POST['to'];
- $subject = $_POST['subject'];
- $message = $_POST['message'];
- $wd = $_POST['WD'];
- $gd = $_POST['GD'];
- $wu = $_POST['WU'];
- $ge = $_POST['GE'];
- $pw = $_POST['PW'];
- $h = $_POST['H'];
- $seo = $_POST['SEO'];
-
- //Setting the variables
- $adminEmail = "danny@swiftproductions.com.au"; //The default email (YOURS)
- $mMax = '5000'; //Max characters for the message
- $sMax = '25'; //Max characters for the subject
- $nMax = '30'; //Max characters for the name
-
- //Validating the fields...
- if(empty($name)) //Checking if the name is filled in
- {
- $error[] = "<li>You forgot to fill in your name</li>\n";
- } elseif(!preg_match('$[a-z]{3,'. $nMax .'}$', $name)) {
- $error[] = "<li>Your name is too long, has to be no longer than $nMax characters</li>\n";
- }
-
- if(empty($email)) //Checking if the email is filled in
- {
- $error[] = "<li>You forgot to fill in your email</li>\n";
- } elseif(!preg_match('/[_a-z0-9-]+(.[_a-z0-9-]+)*@[_a-z0-9-]+(.[_a-z0-9-]+)*(.[_a-z]{2,3})$/', $email)) {
- $error[] = "<li>Your E-Mail is of incorrect format... it has to be in <strong>yourname@domain.tld</strong> format</li>\n";
- }
-
- if(empty($telephone)) //Checking if the phone is filled in
- {
- $error[] = "<li>You didn't put in your phone number</li>\n";
- } elseif(!preg_match_all('$.*[[0-9]{1,2}+[-]+[0-9]{1,3}]*.$',$telephone,$matched)) {
- $error[] = "<li>Your phone is of incorrect format... it has to be in <strong>###-####</strong> format</li>\n";
- }
-
- if(!empty($to))
- {
- if($to == 'CustomerService')
- {
- $to = "sales@swiftproductions.com.au";
- } elseif($to = 'CustomerSupport') {
- $to = "support@swiftproductions.com.au";
- } else {
- $to = $adminEmail;
- }
- } else {
- $to = $adminEmail;
- }
-
- if(empty($subject))
- {
- $subject = "Web Site Mailer";
- }
-
- if(empty($message))
- {
- $error[] = "<li>You didn't put in a message</li>\n";
- } elseif(strlen($message) > $mMax) {
- $error[] = "<li>You message is too long, has to be no longer than $mMax characters</li>\n";
- }
-
- if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) )
- {
- unset($_SESSION['security_code']);
- } else {
- $error[] = "<li>The security image doesn't match with what you put in</li>\n";
- }
-
- //Finding out which of the checkboxes were filled in
- if(isset($wd))
- {
- $chose .= $wd ."<br />\n";
- }
-
- if(isset($gd))
- {
- $chose .= $gd ."<br />\n";
- }
-
- if(isset($wu))
- {
- $chose .= $wu ."<br />\n";
- }
-
- if(isset($ge))
- {
- $chose .= $ge ."<br />\n";
- }
-
- if(isset($pw))
- {
- $chose .= $pw ."<br />\n";
- }
-
- if(isset($h))
- {
- $chose .= $h ."<br />\n";
- }
-
- if(isset($seo))
- {
- $chose .= $seo ."<br />\n";
- }
-
- $message = nl2br($message);
- $cnt = count($error);
- if($cnt > '0')
- {
- echo "You made $cnt errors in the form";
- echo "<ol>\n";
- foreach($error as $value)
- {
- echo $value;
- }
- echo "</ol>\n";
- echo "<a href=\"mail.php\">Try Again</a>\n";
- } else {
- $body .= "<strong>Name:</strong> $name<br />\n";
- $body .= "<strong>Company:</strong> $company<br />\n";
- $body .= "<strong>Telephone:</strong> $telephone<br />\n";
- $body .= "<strong>E-Mail:</strong> $email<br />\n";
- $body .= "<strong>Message:</strong> $message<br />\n";
- $body .= "<br />\n";
- $body .= "$name chose the following options:<br />\n";
- $body .= "<strong>$chose</strong>";
- //Contact subject
- $subject2 = $subject;
-
- //Details
- $message2 = $message;
-
- //Mail of sender
- $mail_from = $eMail;
-
- //From
- $header = "From: $name <$email>";
-
- //Enter your email address
- $to = $adminEmail;
-
- $send_contact = mail($to,$subject,$body,$header);
- if($send_contact)
- {
- echo '<p>We have successfully recieved your email</p>'."\n";
- echo "You submitted:<br />\n <p>$body</p>";
- } else {
- echo '<p>An error occured with the transaction. The message has not being sent</p>'."\n";
- }
- }
- }
- ?>
Make sure that CaptchaSecurityImages.php and monofont.ttf are in the same directory as this file... (I named it mail.php at this example... if you want to change it just change the action at the form...
Hope that this helped you out...
[EDIT] If you copy/paste from here it may give you the line numbers at the beginning... to get the whole thing correctly, quote me and copy the code like that... (I think you know what I mean by that

)
[EDIT 2] A function was added to the "thing". Also, it's a bit different from the one I sent to you VIA PM.