D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
ipuco
/
www
/
Filename :
sendemailreg.php
back
Copy
<?php include('superadmin/include/connection.php'); ?> <?php if(isset($_POST['submit'])) { date_default_timezone_set('Asia/Kolkata'); $name=addslashes($_POST['name']); $lname=addslashes($_POST['lname']); $email=addslashes($_POST['email']); $phone=addslashes($_POST['phone']); $comment=addslashes($_POST['comment']); $postdate=date("Y-m-d"); $posttime=date('H:i:s'); $status='0'; if(mysqli_query($conn,"insert into contact values('','$name','$lname','$email','$phone','$comment','$postdate','$posttime')")) { ?> <script type="text/javascript"> alert("Thank you for sharing valuable contact!"); window.location="index.php"; </script> <?php } else { ?> <script type="text/javascript"> alert("Error! Data Not Inserted"); //window.location="index.php"; </script> <?php echo mysql_error(); } } if($_REQUEST) { echo '<pre>'; print_r($_POST);die; $to="admission@ipu.co.in"; $subject="Enquiry through Website sendmail2"; $body ="Name : ".$_POST['name'] ."\r\n"; $body.="lname : ".$_POST['lname'] ."\r\n"; $body.="E-Mail : ".$_POST['email'] ."\r\n"; $body.="Phone : ".$_POST['phone'] ."\r\n"; $body.="Comments/Query for IPU. : ".$_POST['comment'] ."\r\n"; $header = "From: ".$_POST['email']."\r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: text/plain; charset=utf-8\r\n"; $header.= "X-Priority: 1\r\n"; $send_contact = mail($to,$subject,$body,$header); $err_msg="Enquiry sends successfully"; if($send_contact) { echo "<center><strong>Thank you for your enquiry!<br /><br />We will get back to you within 24 Hrs.<br /><br /> Redirecting.....</strong><br /><br /> <img src='loading-spiral.gif'> </center><META HTTP-EQUIV='Refresh' CONTENT='3; URL=https://ipuadmission.com/'>"; } else { echo "ERROR"; } } ?>