Jump to content

Search the Community

Showing results for tags 'probably not a big problem'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi, i have a php contact form that is managed with ajax, but i cant get it to work properlly. Here is the contact form on my demo site: http://www.bcpdemo.8...om/contact.html I receive the name and the message but not the email, instead of email i get a subject filled with the name. Thanks alot for the help guys. here is how it looks in my yahoo inbox: here is how it looks when i enter the message: and here is the php script: 1.config_php <?php define("WEBMASTER_EMAIL", 'yourname@email.com'); ?> 2.contact.php include 'config.php'; error_reporting(E_ALL ^ E_NOTICE); $post = (!empty($_POST)) ? true : false; if ($post) { include 'functions.php'; $name = stripslashes($_POST['name']); $email = trim($_POST['email']); $message = stripslashes($_POST['message']); $error = ''; // Check name if (!$name) { $error .= 'Please enter your name.<br />'; } // Check email if (!$email) { $error .= 'Please enter your e-mail adress.<br />'; } if ($email && !ValidateEmail($email)) { $error .= 'Invalid e-mail adress !<br />'; } // Check message (length) if (!$message || strlen($message) < 1) { $error .= "Please enter your message."; } if (!$error) { $subject = "your subject"; $messageform = stripslashes($_POST['message']); $message = "Subject: " . $subject . "\n\nFrom: " . $name . "\n\nMessage: " . $messageform; $mail = mail(WEBMASTER_EMAIL, $subject, $message, "From: " . $name . " <" . $email . ">\r\n" . "Reply-To: " . $email . "\r\n" . "X-Mailer: PHP/" . phpversion()); if ($mail) { echo 'OK'; } } else { echo '<div class="notification_error">' . $error . '</div>'; } } ?> 3.functions.php <?php function ValidateEmail($email) { $regex = '/([a-z0-9_.-]+)'. # name '@'. # at '([a-z0-9.-]+){2,255}'. # domain & possibly subdomains '.'. # period '([a-z]+){2,10}/i'; # domain extension if($email == '') { return false; } else { $eregi = preg_replace($regex, '', $email); } return empty($eregi) ? true : false; } ?> Thanks alot for your help guys.
×
×
  • 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.