Jump to content

Search the Community

Showing results for tags 'form 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 2 results

  1. Hi guys, my form works fine but I want the thank you message on the same page in red font, At the moment I am redirecting to thanks.htm and my form is on contme.php, how do i do that? script below: <?php $Email_address ='sam@yahoo.com '; session_start(); $errors = ''; $name = ''; $visitor_email = ''; $user_message = ''; if(isset($_POST['submit'])) { $name = $_POST['name']; $visitor_email = $_POST['email']; $user_message = $_POST['message']; if(empty($name)||empty($visitor_email)) { $errors .= "\n Name and Email are required fields. "; } if(IsInjected($visitor_email)) { $errors .= "\n Bad email value!"; } if(empty($_SESSION['6_letters_code'] ) || strcasecmp($_SESSION['6_letters_code'], $_POST['6_letters_code']) != 0) { $errors .= "\n The captcha code does not match!"; } if(empty($errors)) { $to = $Email_address; $subject="loverman"; $from = $Email_address; $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : ''; $body = "$name contacted you by submitting the message below:\n\n". "Name: $name\n\n". "Email: $visitor_email \n\n". "Message: \n\n ". "$user_message\n\n". "IP: $ip\n"; $headers = "From: $from \r\n"; $headers .= "Reply-To: $visitor_email \r\n"; mail($to, $subject, $body,$headers); //header('Location: ?success'); //echo "your enquiry was submitted successfully, thank you,"; header('Location: contme.php'); echo "Form submitted succesfully, thank you"; } else { echo "Form failed to send"; } } function IsInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } ?>
  2. please friends i have a problem trying to create a form for my web site please this is the code <?php $required=array("fname" => "Firstname", "lname" => "Lastname", "email" => "Email address", "password" => "Password"); foreach ($required as $field => $label) { if (!$_post[$field]) { $warnings[$field] = "Required"; } } if ($_POST["email"] && !ereg("^[^@]+@([a-z\-]+\.)+[a-z]{2,4}$", $_POST["email"])) $warnings["email"] = "Invalid email"; if ($_POST["telephone"] && !ereg("^\([[:digit:]]{3}\)[[:digit:]]{3}-[[:digit:]]{4}$", $_POST["telephone"])) $warnings["telephone"] = "Must be (555)555-5555"; if (count($warnings) > 0) { ?> <form action = "register.php" method=post> <table border=0> <tr> <td>Firstname:</td> <td><input type=text size=30 name="fname" value="<?php echo $_post ["fname"];?>" > </td> <td><?php echo $warnings["fname"];?> </td> </tr><br/> <tr> <td>Lastname:</td> <td><input type=text size=30 name="lname" value="<?php echo $_post ["lname"];?>"> </td> <td><?php echo $warnings["lname"];?> </td> </tr> <tr> <td>Email address:</td> <td><input type=text size=30 name="email" value="<?php echo $_post["email"];?>"> </td> <td><?php echo $warnings["email"];?> </td> </tr> <tr> <td>Password:</td> <td><input type=text size=30 name="password" value="<?php echo $_post["password"];?>"> </td> <td><?php echo $warnings["password"];?> </td> </tr> <tr> <td>Telephone:</td> <td><input type=text size=30 name="telephone" value="<?php echo $_post["telephone"]?>"> </td> <td><?php echo $warnings["telephone"];?> </td> </tr> <tr> <td>Sex</td> <td><script src="sex.php"> </script></td> </tr> <tr> </TABLE> <INPUT TYPE=SUBMIT VALUE="Register"> </form> <?php } else { echo "Thank you for registering"; } ?> and this are the error messages, am a newbie to php please help and this is the error message Notice: Undefined variable: _post in C:\xampp\htdocs\form.php on line 8 Notice: Undefined variable: _post in C:\xampp\htdocs\form.php on line 8 Notice: Undefined variable: _post in C:\xampp\htdocs\form.php on line 8 Notice: Undefined variable: _post in C:\xampp\htdocs\form.php on line 8 Notice: Undefined index: email in C:\xampp\htdocs\form.php on line 13 Notice: Undefined index: telephone in C:\xampp\htdocs\form.php on line 16 please help me out
×
×
  • 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.