session_start();
$string = '';
for ($i = 0; $i < 5; $i++) {
// this numbers refer to numbers of the ascii table (lower case)
$string .= chr(rand(97, 122));
}
$_SESSION['rand_code'] = $string;
?>
If(!isset($_POST['submit'])){
echo "";
?>
}Else{
include_once "db.php";
$contact_person=$_POST['contact_person'];
$mobile_number=$_POST['mobile_number'];
$email_address=$_POST['email_address'];
$query_suggestion=$_POST['query_suggestion'];
$str_contact_person=str_replace(" ","_",$contact_person);
$msg1="Sri Sadguru Services thanking you for enquiry on our Website.";
$msg2="Enquiry from ".$contact_person." (".$mobile_number.") - ".$query_suggestion;
$sent2server=file_get_contents("http://groupsms.co.in/api/sendmsg.php?user=ARCHER&pass=ARCHER_786&sender=THANKS&phone=$mobile_number&priority=ndnd&stype=normal&text=".urlencode($msg1));
$sent2server=file_get_contents("http://groupsms.co.in/api/sendmsg.php?user=ARCHER&pass=ARCHER_786&sender=WebENQ&phone=9500027882&priority=ndnd&stype=normal&text=".urlencode($msg2));
$query="insert into feedback(contact_person,mobile_number,email_address,query_suggestion,stamp) values('$contact_person',$mobile_number,'$email_address','$query_suggestion',now())";
$result=mysql_query($query) or die('Could not insert data records because : '.mysql_error());
echo "
Thank you for your feedback/enquiry.";
}
?>