darkfreaks Posted April 21, 2008 Share Posted April 21, 2008 anyone have an idea why ??? <?php include ("inc/header.inc.php"); $headers = 'To: Ashley <viciousvamp@gmail.com>, Ashley <viciousvamp@gmail.com>' . "\r\n"; $headers .= 'From: $email <$email>' . "\r\n"; $email=strip_tags(trim($_POST['email'])); $name=strip_tags(trim($_POST['name'])); $name=strip_tags(trim($_POST['name'])); $action= $_SERVER['PHP_SELF']; function checkEmail($email) { if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email)) { return FALSE; } list($Username, $Domain) = split("@",$email); if(getmxrr($Domain, $MXHost)) { return TRUE; } else { if(fsockopen($Domain, 25, $errno, $errstr, 30)) { return TRUE; } else { return FALSE; } } } if (!isset($email)||!isset($name)||!isset($message)||empty($email)||empty($name)||empty($message)||checkEmail($email)==FALSE) { echo' <<<HTML <div id="contact"> <h2>You have an error please check your message and try again!</h2> <form id="contact_form" name="contact_form" method="post" action="'$action'"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div> HTML'; } elseif (isset($email)||isset($name)||isset($message)||!empty($message)||!empty($email)||!empty($name)) { echo '<<<HTML <div id="contact"> <form enctype="multipart/form-data" name="contact_form" method="post" action="'$action'"> <br /><br /><Br /><br /><b> Thank You,<br /><br /> Vicious Vamp will review your message soon!<br /><br /></b> </form> </div> HTML'; mail('viciousvamp@gmail.com','Mail for ViciousVamp',$message,$headers); } else echo '<<<HTML <div id="contact"> <form id="contact_form" name="contact_form" method="post" action="'$action'"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div> HTML'; include ("inc/footer.inc.php"); ?> Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted April 21, 2008 Share Posted April 21, 2008 <?php else { //missing echo '<<<HTML <div id="contact"> <form id="contact_form" name="contact_form" method="post" action="'$action'"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div> HTML'; } //missing the last else. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 21, 2008 Author Share Posted April 21, 2008 now i get unexpected t variable on line 48 which is like halfway down the form html ??? Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted April 21, 2008 Share Posted April 21, 2008 yer, delete all the <<<<html, (are the spose to be comments or <html>)?? comments in PHP are // on one line or /* */ on more than one Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 21, 2008 Author Share Posted April 21, 2008 nope doesnt work still get the error anyone else ??? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 yer, delete all the <<<<html, (are the spose to be comments or <html>)?? comments in PHP are // on one line or /* */ on more than one Wrong. You can leave that. It's a special type of echo. I forget what it's called. Anyway, it's fine. Which line specifically is the error on? Post it please. =) Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 21, 2008 Author Share Posted April 21, 2008 line 48 is <br /> <br /> but i think it is a problem with $action in the form??? Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted April 21, 2008 Share Posted April 21, 2008 <?php echo'<div id="contact"> <h2>You have an error please check your message and try again!</h2> <form id="contact_form" name="contact_form" method="post" action="$_SERVER['PHP_SELF']"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div> '; } elseif (isset($email)||isset($name)||isset($message)||!empty($message)||!empty($email)||!empty($name)) { echo ' <div id="contact"> <form enctype="multipart/form-data" name="contact_form" method="post" action="$_SERVER['PHP_SELF']"> <br /><br /><Br /><br /><b> Thank You,<br /><br /> Vicious Vamp will review your message soon!<br /><br /></b> </form> </div> '; mail('viciousvamp@gmail.com','Mail for ViciousVamp',$message,$headers); } else { echo ' <div id="contact"> <form id="contact_form" name="contact_form" method="post" action="$_SERVER['PHP_SELF']"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div>'; } include ("inc/footer.inc.php"); ?> Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 21, 2008 Author Share Posted April 21, 2008 that wont work Quote Link to comment Share on other sites More sharing options...
DarkWater Posted April 21, 2008 Share Posted April 21, 2008 Wrong. =( <?php echo'<div id="contact"> <h2>You have an error please check your message and try again!</h2> <form id="contact_form" name="contact_form" method="post" action="{$_SERVER['PHP_SELF']}"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div> '; } elseif (isset($email)||isset($name)||isset($message)||!empty($message)||!empty($email)||!empty($name)) { echo ' <div id="contact"> <form enctype="multipart/form-data" name="contact_form" method="post" action="$_SERVER['PHP_SELF']"> <br /><br /><Br /><br /><b> Thank You,<br /><br /> Vicious Vamp will review your message soon!<br /><br /></b> </form> </div> '; mail('viciousvamp@gmail.com','Mail for ViciousVamp',$message,$headers); } else { echo ' <div id="contact"> <form id="contact_form" name="contact_form" method="post" action="{$_SERVER['PHP_SELF']}"> <label>Name:<br /> <input name="name" type="text" class="form" id="name" /> </label> <br /><br /> <label>Email:<br /> <input name="email" type="text" class="form" id="email" /> </label> <br /><br /> Message:<br /> <label> <textarea name="message" cols="45" rows="5" class="form" id="message"></textarea> </label> <br /><br /> <label> <input name="submit" type="submit" class="form_button" id="submit" value="Submit" /> </label> </form> </div>'; } include ("inc/footer.inc.php"); ?> That should work. Copy and paste it where the form is. (just don't copy the PHP tags. Lol) Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted April 21, 2008 Share Posted April 21, 2008 is it the same error? or different line Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted April 21, 2008 Author Share Posted April 21, 2008 screw it i will just take the action out SOVLED@ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.