Welcome to Law-Forums.org!    Latest blog post: Research Law Professors Before Choosing Law Schools

Advertisments:




Sponsor Links:

Discount Legal Forms
Discounted Legal Texts


$_SERVER['REQUEST_URI'] in Form Action returning to Wordpress Page with NO CONTENT?

Dealing with a class action? Discuss it here

$_SERVER['REQUEST_URI'] in Form Action returning to Wordpress Page with NO CONTENT?

Postby stephon14 » Wed Mar 14, 2012 3:31 am

I am trying to process a PHP form to stay on the same page in Wordpress but after I submit the form, everything works and it stays on the correct page, but the Wordpress Content Disappears. Is says "NOTHING FOUND" in the content area and it also has a search box.

I want the page to stay exactly like it was with the content except process my PHP Mailer and Echo Validation Message.


Here is my code:


<?php


if (!empty($_POST['submit'])) {

$name = $_POST['name'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$info = $_POST['info'];

$admin_email = get_option('admin_email');

$to = $admin_email;
$subject = 'Contact a Lawyer Form';
$msg = "YOUR INFORMATION:\n" .
"---------------------------------------… .
" Your Name: $name\n" .
" Your Phone: $phone\n" .
" Your Email Address: $email\n" .
" Additional Information: $info\n";

mail ($to, $subject, $msg, 'From: ' . $email);

/* Prepare autoresponder subject */
$respond_subject = "Your Information has been submitted and is being reviewed!";

/* Prepare autoresponder message */
$respond_message = "Hello $name!

Thank you for your submission! We will get back to you
as soon as possible! Your Information has been Submitted and is being reviewed
by our representatives! You will hear from an Associate as soon as possible!

Yours sincerely,
OUR NAME

www.OurDomain.com ";

/* Send the message using mail() function */
mail($email, $respond_subject, $respond_message, 'From: OurNAME');
}

?>
<div class="requestform">
<div class="formdiv">
Contact a Lawyer Today!

<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>" id="contactform">
<ol>
<li>
<label for="name">Full Name:</label>
<input id="name" name="name" class="text" style="width: 178px; height: 16px;" />
</li>
<li>
<label for="email">Your email:</label>
<input id="email" name="email" class="text" style="width: 178px; height: 16px;" />
</li>
<li>
<label for="company">Your Phone:</label>
<input id="company" name="phone" class="text" style="width: 178px; height: 16px;" />
</li>
<li>
<label class="brief1">Briefly Describe Your Legal Issue:</label>
<textarea cols="20" name="info" rows="3" style="width: 272px; height: 50px;"></textarea></li>

<li class="buttons">
<input type="image" name="submit" value="submit" alt="Submit Information" src="<?php echo get_option('siteurl') ?>/wp-content/themes/azure-basic/images/… height="42" width="272" />
<div class="clr"></div>
</li>
</ol>
</form>
<?php

if (!empty($_POST['submit'])) {

echo '<div class="disclaimerdiv-confirm">Your Message Has Been Submitted!</div>';

}
else {

echo '<div class="disclaimerdiv"><a href="' . get_option('siteurl') . '/divorce-attorneys-privacy-policy/">Dis… & Privacy Policy</a></div>';


}
?>
stephon14
 
Posts: 10
Joined: Fri Apr 01, 2011 1:34 pm
Top

Return to Class Action

 


  • Related topics
    Replies
    Views
    Last post