Jump to content

HELP PHP FORM SHOWING SERVER INFORMATION IN EMAIL?!?


webshark360

Recommended Posts

I have a question regarding my email form submission. The email seems to work fine, but the recipient of the email can view my server information (see attached image for example) there are many website hosted on my server and i would like to hide the server info on form submissions. does anyone know of a way to do this? thanks

post-133873-13482403511149_thumb.png

Link to comment
Share on other sites

Here is the code for my form and send script what exactly is the problem?

 

FORM CODE

 

<head>

<script type="text/javascript" language="javascript" src="js/validation_contact.js"></script>

</head>



<section id="enquiry_frm">

	<form id="cform" name="cform" method="post"  onsubmit="return ccheckform()" action="send_form.php">

    	<aside class="left">

        	<h2>Contact Us <span>Today</span></h2>

        	<input type="text" value="Name" name="cname" id="cname" onFocus="if (this.value == 'Name') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Name';}"  />

          <input type="text" value="Email" name="cemail" id="cemail" onFocus="if (this.value == 'Email') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Email';}"/>

            <input type="text" value="Phone Number" name="cphone" id="cphone" onFocus="if (this.value == 'Phone Number') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Phone Number';}"/>

    

    	</aside>

        

        

        

        <aside class="right">

        	<textarea rows="" cols="" name="cmessage" id="cmessage" onFocus="if (this.value == 'Message') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Message';}" >Message</textarea>

      <center><input type="submit" value=""/></center>

    	</aside>

    

    </form>

<img src="images/social_icons.png" alt="" style="float:right;margin-top:16px;">

<section class="clear"></section>





</section>

 

 

SEND FORM CODE

 

<?php
//$to = "MyEmail@gmail.com";
$to = "MyEmail@gmail.com";
$from= "Webshark360.com.com";
$subject="webshark360.com form has been submitted by $cname";
$cname=$_REQUEST['cname'];
$cphone=$_REQUEST['cphone'];
$cemail=$_REQUEST['cemail'];
$cmessage= $_REQUEST['cmessage']; 

$SpamErrorMessage="No Websites URLs permitted";
if (preg_match("/http/i", "$cname")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$cphone")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$cemail")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$cmessage")) {echo "$SpamErrorMessage"; exit();}



$message="
Name -$cname
Phone-$cphone
Email ID-$cemail
Message-$cmessage";
$sent = mail($to, $subject, $message,$headers) ;
if($sent)
{
header("location:thanks.php");
}
?>

Link to comment
Share on other sites

you can omit the $from variable and put it in your headers.

 

$headers = 'From: Webshark360.com.com' . "\r\n" .
    'Reply-To: Webshark360.com.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

 

alternately you can use phpmailer  which uses SMTP email settings to achieve the same desired result.

 

 

 

PHpmailer example:

 

 

<?php

require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();  // telling the class to use SMTP
$mail->Host     = "smtp.example.com"; // SMTP server

$mail->From     = "Webshark360.com.com"; //from your other adress
$mail->AddAddress("MyEmail@gmail.com"); //sends the email to you

$mail->Subject  = "ebshark360.com form has been submitted by $cname";
$mail->Body     = "Name -$cname
Phone-$cphone
Email ID-$cemail
Message-$cmessage";
?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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