Jump to content

[SOLVED] page shows blank?


darkfreaks

Recommended Posts

anyone have an idea why ???

 

 

<?php
include ("inc/header.inc.php");
$headers = 'To: Ashley <[email protected]>, Ashley <[email protected]>' . "\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('[email protected]','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");

?>

Link to comment
https://forums.phpfreaks.com/topic/102069-solved-page-shows-blank/
Share on other sites

<?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.

 

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. =)

<?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('[email protected]','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");

?>

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('[email protected]','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)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.