Jump to content

Megan

Members
  • Posts

    7
  • Joined

  • Last visited

Megan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am not sure what is sending me there? I do not know why it is going to where it is going?
  2. Hi, i have a contact form with this code: <?php if(isset($_POST['submit'])) { $flag=1; if($_POST['yourname']=='') { $flag=0; echo "Please Enter Your Name<br>"; } else if(!preg_match('/[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*/',$_POST['yourname'])) { $flag=0; echo "Please Enter Valid Name<br>"; } if($_POST['email']=='') { $flag=0; echo "Please Enter E-mail<br>"; } else if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email'])) { $flag=0; echo "Please Enter Valid E-Mail<br>"; } if($_POST['subject']=='') { $flag=0; echo "Please Enter Subject<br>"; } if($_POST['message']=='') { $flag=0; echo "Please Enter Message"; } if ( empty($_POST) ) { print 'Sorry, your nonce did not verify.'; exit; } else { if($flag==1) { wp_mail(get_option("admin_email"),trim($_POST[yourname])." sent you a message from StraightForwardLegal.com".get_option("blogname"),stripslashes(trim($_POST['message'])),"From: ".trim($_POST['yourname'])." <".trim($_POST['email']).">\r\nReply-To:".trim($_POST['email'])); echo "Thank you for contacting us!<br> We have received your email. <br> One of our Workers' Compensation Attorneys <br> will be in touch with you as soon as possible"; header ("location: http://www.straightforwardlegal.com"); exit; } } } ?> and then, <div class="frontForm"> <form method="post" id="contactus_form"><span style="font-size: 12px;> <div class="left"> Name*:<br><input type="text" name="yourname" id="yourname" rows="1" maxlength="35"><br> Email*:<br><input type="text" name="email" id="email" rows="1" value=""><br> Phone*:<br><input type="text" name="subject" id="subject" rows="1" columns="8" style= "max-height: 18px; min-height: 18px;" value="" /></td></tr> </div> <div class="right" style="margin-top: -120px;"/> Message*:<textarea name="message" id="message" rows="5" style="height: 90px;"></textarea><br><br> <input type="submit" name="submit" id="submit" value="Send"/></span> </form> </div> </div> </div> </div> I used header ("location: http://www.straightforwardlegal.com"); exit; but, it does not work. After submitting my contact form, the user gets taken to my contact page instead of going to my home page? I was wondering if someone could let me know what I have done wrong? Thank you, Megan
  3. Thank you for the information and the article. It was very helpful. Unfortuately, I have played around with this for a few days and am still getting an error using the code below. Any advise? <?php if (isset($_POST['formSubmit'])) { //START A SESSION session_start(); //CREATE SESSION VARIABLES $_SESSION['name'] = $name; $_SESSION['email'] = $email; $_SESSION['phone'] = $phone; $_SESSION['message'] = $message; // //REDIRECT VISITOR header("location: http://www.pearsonkoutcherlaw.com/abl-form-submit/"); exit; } ?> Thank you.
  4. I apologize, please ignore my last comment. What I am aiming to do, is have the user submit and then go to this URL (http://www.pearsonko...bl-form-submit/), which will have what that user had written on the contact form on it.
  5. I do not believe that I can do it that way because I created a template page in wordpress.
  6. Thank you for your reply, but i am very new at this and do not think that I really understand? I replaced, $_POST with $_SESSION and now when I fill out the contact form, instead of redirecting, it just refreshed to the original URL? Could you please explain what you mean by "more those vars" Thank you for your time.
  7. I have created the below code for my website www.pearsonkoutcherlaw.com: <?php if (isset($_POST['formSubmit'])) { header("location: http://www.pearsonkoutcherlaw.com/abl-form-submit/"); exit; print "<p style=\"font-weight:bold;\">Form has been sent!</p>"; print '<p>Thank you for your submission. </p>'; print "<p>What You Sent</p>"; print "<b>Name:</b><br/>".$name."<br/><br/>"; print "<b>Email:</b><br/>".$email."<br/><br/>"; print "<b>Phone:</b><br/>".$phone."<br/><br/>"; print "<b>Message:</b><br/>".$message."<br/><br/>"; } else { ?>`` So, after submission, the user is redirected to http://www.pearsonkoutcherlaw.com/abl-form-submit/. However, I also want the print functions, "Form has been sent", "Thank you for your submission." to appear on the redirect page? How do I do that? Thanks, Megan
×
×
  • 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.