Results 1 to 2 of 2

Thread: PHP Contact form file

  1. #1

    PHP Contact form file

    I have devloped a contact form with PHP code. It work perfectly. when you submit the form all the information e-mail to you perfectly. After submitting the contact form it will take you back to you same contact page. Know want to make some changes in it. When some one submit the contact form a message appear "Thanks for contacting us we will reply you withing in 5 business days" and then return to you on contact page. I try to modify the code myself but can't able to do that.

    PHP Code:
    if(!$_POST) exit;
    $email $_POST['email'];
    //$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS';
    if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){
    $error.="Invalid email address entered";
    $errors==1) echo $error;
    $values = array ('URL','email','Keyword','Title');
    $required = array('URL','email','Keyword','Title');
    $your_email "info@bannistermarketinggroup.co.uk";    
    $email_subject "Bannister Marketing Group: ".$_POST['subject'];
    $email_content "Following is the keyword report:\n";
    $values as $key => $value){
                if (
    $key != 'subject' && $key != 'company') {
                  if( empty(
    $_POST[$value]) ) { echo 'PLEASE FILL IN REQUIRED FIELDS'; exit; }
    $email_content .= $value.': '.$_POST[$value]."\n";
    mail($your_email,$email_subject,$email_content)) {
    //echo 'thanks you we receive report witing 24hr';
    //else {
                //echo 'ERROR!';
    **HTML CODE**

    HTML Code:
    <form action="contact.php" method="post">
                        	<Div class="fieldbox">
                            	<div class="textname">URL:</div>
                                <div class="field"><input type="text" id="URL" name="URL" /></div>
                                <div class="******"><img src="images/URLicon.jpg" /></div>
                            <Div class="fieldbox">
                            	<div class="textname">Title:</div>
                                <div class="field"><input id="Title" type="text" name="Title" /></div>
                                <div class="******"><img src="images/titleicon.jpg" /></div>
                              <Div class="fieldbox">
                            	<div class="textname">Keyword:</div>
                                <div class="field"><input id="Keyword" type="text" name="Keyword" />  </div>
                                <div class="******"><img src="images/keywordicon.jpg" /></div>
                            <Div class="fieldbox">
                            	<div class="textname">E-mail:</div>
                                <div class="field"><input id="name" type="text" name="email" />  </div>
                                <div class="******"><img src="images/emailicon.jpg" /></div>
                            <div class="button">
                            <input type="image" type="text" src="images/submit.jpg" />	

    Any once can help me please.Need to done it as soon as possible.

  2. #2
    Join Date
    Aug 2004
    Instead of using the header() function to do your redirect, have the success message instead be output as part of a HTML page which includes a "meta refresh tag" in the head section which includes the redirect URL.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center