PHP - User Validation Via Email
I am working on user validation through email and I am having some problems with it. I can get it to work but it gives me probloms some times.
This is the link that is sent to the users after they sign up Code: [Select] mydomain/confirm.php?id=".$id."&userkey=".$userkey and this is what i have for the confirm page Code: [Select] <?php //connection info $userquery = mysql_query("SELECT * FROM user"); $active=mysql_result($userquery, "active"); $userid=mysql_result($userquery, "id"); $userkey=mysql_result($userquery, "userkey"); if ($active == 1) { printf("This account has already been activated"); echo "<br />"; } elseif($userkey != $posteduserkey){ printf("We are sorry but the data offered does not match data listed, plese contact system admin."); } else{ $query="UPDATE user SET active='1' WHERE id='$id'"; mysql_query($query) or die (mysql_error()); echo "You have activated your account"; ?> <div align="center"><br /><a href="login.php" class="nav">Back to the log in page</a></div> <?php } ?> This is the fun part. I checked that the id and userkey are correct in the link, and they are. I then replaced the & in the link with & it works in gmail but not yahoo email address. I'm not sure where else to look. Thanks in advance Similar TutorialsActually, what i want to do is to use the email to fetch the $email,$password and $randomnumber from database after Hi, I have setup a standard contact form that sends an email using php "mail" function in my new website. Today, I received an email from a potential client through my website. However, unfortunately, I did not receive the user's email address because (as I discovered after wards), there was a syntax problem in the function, so all I received is their name and message. I am certain that the user has entered their email address because the form has validation, it just didn't send me the address so I have no way to contact that client... Is there a way to retrieve the lost email address from the server somehow? Thanks in advance Feel free to move this post if it is in the incorrect category. I was using a validation method for usernames on my website but I would like to make some improvements on it. You typed in your name and it would search and pop-up whether it was available or not. I am looking for a method similar to the one used on this website and many others that checks when the field loses focus. The php code and easiest example I have found is he http://shawngo.com/wp/blog/gafyd/index.html Code: [Select] $username = $_POST['username']; // get the username $username = trim(htmlentities($username)); // strip some crap out of it $file = '/home/js4hire/public_html/gafyd/data.csv'; // Here's the file. Notice the full path. echo check_username($file,$username); // call the check_username function and echo the results. function check_username($file_in,$username){ $username=strtolower($username); $file = file($file_in); foreach ($file as $line_num => $line) { $line = explode(',',$line); $user = trim(str_replace('"','',$line[0])); if($username == strtolower($user)){ return '<span style="color:#f00">Username Unavailable</span>'; } } return '<span style="color:#0c0">Username Available</span>'; } That example uses a flat file CSV, but I would like to use my MySQL database instead. I have included a snippet from my previous that I believe would tie into this, I'm just not sure how exactly: Code: [Select] require_once dirname(__FILE__).'/../includes/common.inc.php'; require_once dirname(__FILE__).'/../includes/user_functions.inc.php'; $output=''; if (!empty($_POST['user'])) { $user=sanitize_and_format($_POST['user'],TYPE_STRING,$__field2format[FIELD_TEXTFIELD]); if (get_userid_by_user($user) || $user=='guest') { $output=1; } } echo $output; That common.inc.php calls for the database connection in session.inc.php: Code: [Select] $josh_dblink=db_connect(_DBHOST_,_DBUSER_,_DBPASS_,_DBNAME_); if (!defined('NO_SESSION')) { require _BASEPATH_.'/includes/sessions.inc.php'; } I don't want to have to call the db connection again in that file but I need to get the relevant information and pass it through the php. Any help would be appreciated! Hi, I have done email validation. At present it shows invalid email address if I kept blank but in the same time inserted the records in database. I want user to stay at the same page if anything is invalid. if(!empty($_POST['emailId'])){ if(preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/", $_POST['emailId'])){ $records['Email']=$_POST['emailId']; } else{ $emsg="Please enter valid Email address"; }} else{ $emsg="Please enter valid Email address"; } And I have used like <tr><td>Email id</td><td><input type="text" name="emailId"></td><td><?php echo ".$emsg." ;?></td></tr> Can anybody help me in this regard? Hey guys.. I'm completely done with my contact form data validation except I cannot seem to get one part. For my email field I need to make sure that it is a valid email address and not just words. Also, I would like to make the phone number specific length. Any ideas on how to go about this? thanks guys! <?php ini_set('display_errors', '0'); //Define Variables. $FirstName = $_GET['FirstNameTextBox']; $LastName = $_GET['LastNameTextBox']; $PhoneNumber = $_GET['PhoneNumberTextBox']; $EmailAddress = $_GET['EmailAddressTextBox']; $Address = $_GET['AddressTextBox']; $City = $_GET['CityTextBox']; $State = $_GET['StateDropDownBox']; $Zip = $_GET['ZipTextBox']; $error1='*Please enter a First Name<br>'; $error2='*Please enter a Last Name<br>'; $error3='*Please enter a Phone Number<br>'; $error4='*Please choose a state<br>'; $error5='*Please enter a valid email address<br>'; $day2 = mktime(0,0,0,date("m"),date("d")+2,date("Y")); $day3 = mktime(0,0,0,date("m"),date("d")+3,date("Y")); $day7 = mktime(0,0,0,date("m"),date("d")+7,date("Y")); // Array to collect messages $messages = array(); //Display errors. if($FirstName=="") {$messages[] = $error1; } if($LastName=="") {$messages[] = $error2; } if($PhoneNumber=="") {$messages[] = $error3; } if($State=="") {$messages[] = $error4; } if($EmailAddress=="") {$messages[] = $error5; } // Don't do this part unless we have no errors if (empty($messages)) { //Display correct contact date. if($State == "NY") { $messages[] = "Hello $FirstName $LastName! Thank you for contacting me. I will get back to you within 2 days, before " .date("d M Y", $day2); } if($State == "NJ") { $messages[] = "$Hello FirstName $LastName! Thank you for contacting me. I will get back to you within 3 days, before " .date("d M Y", $day3); } if($State == "Other") { $messages[] = "$Hello FirstName $LastName! Thank you for contacting me. I will get back to you within 1 week, before " .date("d M Y", $day7); } } // END if empty($messages echo implode('<BR>', $messages); ?> <p>--<a href="Contact_Form.html" class="style2"><span class="style1">Go Back</span></a>--</p> </body> </html> So, im trying to make my job a little easier. lol... I am constantly sending emails to the managers for escalations on calls... So I wrote this so far... (forgive my poor php skills, this is the first thing ive ever made. lol.) It does work so far, but, a friend wants to use it too, and Ive adapted it so he can enter his email address in, but, how can I make it so that it will validate only to send from @specificdomain.com ? Ive tried a few things, and just butchered it. lol.... Thanks for any help or tips. Code: [Select] <?php //$name = $_POST["email"]; $name = $_POST["name"]; $policynumber = $_POST["policynumber"]; $phonenumber = $_POST["phonenumber"]; $issue = $_POST["issue"]; $purchased = $_POST ["purchased"]; $infocheck = $_POST ["infocheck"]; $additionalinfo = stripslashes($_POST["additionalinfo"]); //checkbox value readout $mailcc = $_POST['sendmetoo']; $email_to = "SalesLevel2@specificurl.com"; // Who the email is to $email_from = $_POST['emailfrom']; // Who the email is from $email_subject = $policynumber.' - '.$issue; // The Subject of the email //here you can define whatever you want to... $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/plain; charset=UTF-8\r\n"; $headers .= "To: <".$email_to.">\r\n"; $headers .= "From: ".$email_from."\r\n"; //we control if sendmetoo is checked... if($mailcc == 'sendtome'){ $headers .= "Cc: ".$email_from."\r\n"; } //$headers .= "Bcc: noone@nowhere.com\r\n"; $email_message = "Sales Level 2,"; $email_message .= "\n\nPolicy Number: " .$policynumber; $email_message .= "\nClients Name: " .$name; $email_message .= "\nPhone Number: " .$phonenumber; $email_message .= "\nReason(s): " .$issue; $email_message .= "\nPurchased Already: " .$purchased; $email_message .= "\nAll info correct?: " .$infocheck; $email_message .= "\n\nAdditional Information: " .$additionalinfo; "\n\n\n\n". // Message that the email has in it //$headers = "From: ".$email_from; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "<font face=verdana size=2><center>Your message has been sent<br> to Sales Level 2<br> Click <a href=\"#\" onclick=\"history.back();\">here</a> to go back</center>"; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> Hi, I need simple function to validate email address format. I have found follwoing function form google. function isemail($email){ return (bool)ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email); } It's working fine with php < 5.2. But when I'm using with PHP 5.3 is says Quote Deprecated: Function ereg() is deprecated in C:\wamp\www\*******\includes\functions.php on line 28 Is any solution to this without error disable? Thanks Hello i have a syntax issue in the code below, can anyone shed some light? Code: [Select] <?php if(isset($_POST['submit'])) { $drop = mysql_real_escape_string($_POST['drop_1']); $tier_two = mysql_real_escape_string($_POST['Subtype']); echo "You selected "; echo $drop." & ".$tier_two; $Name = mysql_real_escape_string($_POST["Name"]); $Phone = mysql_real_escape_string($_POST["Phone"]); $Email = mysql_real_escape_string($_POST["Email"]); $Postcode = mysql_real_escape_string($_POST["Postcode"]); $Website = mysql_real_escape_string($_POST["Website"]); if($Name == '' || $Phone == '' || $Email == '' else if (!preg_match('/^[A-Za-z0-9\-.]+$/', $domain)|| $Postcode == '' || $Website == '') { die('<br> but you did not complete all of the required fields correctly, please try again'); } } the code works fine without the " else if (!preg_match('/^[A-Za-z0-9\-.]+$/', $domain) " . As well as checking for blank fields i'd like to check for the correct email format. Many thanks. Hi I have created several php scripts which adds a user to the database and allows them to login aswell. I want an email confirmation link in which the user has to click in order for them to get added to the database. Below is my code any help in what php I put in and where would be most helpful, thanks in advance. Chris *********************************************************************** mainregister.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Web Server</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="checkregister.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Register"></td> </tr> </table> </td> </form> </tr> </table> </body> </html> ****************************************************************************** checkregister.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="webserver"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="INSERT INTO $tbl_name (username,password) VALUES('$myusername','$mypassword')"; $result=mysql_query($sql); echo "Registered to database"; ?> </body> </html> hi all, im working on a email send to de user who register on the website! now i get the email but its not email/html view and it gets in to the unwanted folder, also as i siad trust this emailadress! what do i wrong in the code?? the whole php file see //#### XXX ### where i need help! Code: [Select] <?php Session_start(); if(file_exists("support/functions_alg.php")) // user,pass and database file { include("support/functions_alg.php"); // database functions file } if($_REQUEST) { $email=$_REQUEST['email']; $pass=md5( $_REQUEST['pass'] ); $secc=md5( $_REQUEST['sec_code'] ); function check_code($secc) { if($secc == $_REQUEST['mdcode']) { return true; } else { return false; } } function check_email_address($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it into sections to make life easier $email_array = explode("@", $email); $local_array = explode(".", $email_array[0]); for ($i = 0; $i < sizeof($local_array); $i++) { if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) { return false; } } if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) { // Check if domain is IP. If not, it should be valid domain name $domain_array = explode(".", $email_array[1]); if (sizeof($domain_array) < 2) { return false; // Not enough parts to domain } for ($i = 0; $i < sizeof($domain_array); $i++) { if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) { return false; } } } return true; } if(check_email_address($email)) { if(check_code($secc)) { //$res=register($email,$pass,$name,$address,$huisnr,$zipcode,$plaats,$dob_year,$dob_month,$dob_date,$tel); $res=true; if($res==true) { // ##### XXX ##### //mail function /* subject */ $subject = "Activeer uw Profiel"; /* To send HTML mail, you can set the Content-type header. */ $headers = "MIME-Version: 1.0 \r\n"; $headers .= "Content-type: text/html; charset=utf-8 \r\n"; /* additional headers */ $headers .= "From: " . $mailme . " \r\n"; /* and now mail it */ $text = ' <html> <head> <title>Nieuw profiel</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Activeer uw profiel op:<br><br> <a href="http://'.$_SERVER['SERVER_NAME'].'/?reg_result&activatie=true">Activeer</a>br><br> Veel plezier op onze website! </body> </html>'; $res = mail($email,$subject,$text,$headers); echo("<script>document.location.href='index.php?topic=reg_result&".$res."'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'?topic=reg_result&true"'); //###### XXXX ####### } else { echo "<table border=1 class=outer_tbl align=center width=50% style='border-collapse:collapse;'>"; echo "<tr><td align=center>"; echo "Fout tijdens registratie<br><a href='javascript:history.back();'>Klik hier</a> om opnieuw te proberen"; echo "</tr></td></table>"; } } else { echo("<script>document.location.href='".$_SERVER['HTTP_REFERER']."&error=code'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'&error=code"'); } } else { echo("<script>document.location.href='".$_SERVER['HTTP_REFERER']."&error=email'</script>"); //header('location: "'.$_SERVER['HTTP_REFERER'].'&error=email"'); } } ?> the recived email looks like : Content-type: text/html; charset=utf-8 From: info@pc-hulp-online.nl Return-Path: anonymous@server70.hosting2go.nl X-OriginalArrivalTime: 30 Apr 2012 10:47:41.0985 (UTC) FILETIME=[AB19D110:01CD26BE] <html> <head> <title>Nieuw profiel</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> Activeer uw profiel op:<br><br> <a href="http://nieuw.pc-hulp-online.nl/?reg_result&activatie=true">Activeer</a>br><br> Veel plezier op onze website! </body> </html> please help me!! thnx, Hi, ive been looking all over for a script to send an email once users on my site register their details, is this possible? all i want is it to send their username and password. Also the same sort of thing is needed for the "lost password" button? Any help suggested would be great, many thanks. Web Form/Registration: Code: [Select] <form action="sendAd.php" method="post"> <h4 class="style7">Type of company (Removal, Transport, Storage, Insurance, Local Area or Other):<br /> <input type="text" name="type"/> <br />Company name:<br /> <input type="text" name="company_name"/> <br /> Location:<br /> <input type="text" name="location"/> <br /> Six bullet point description of your company:<br /> <textarea rows="6" cols="21" name="description" ></textarea> </h4> <h4 class="style7"> <br /> <input name="submit" type="submit" id="submit" value="List your ad" /> </h4> <p> </p> </form> SendAd.php: Code: [Select] <?PHP $user_name = ""; $password = ""; $database = "removal2"; $server = "server"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "INSERT INTO ads (type, company_name, location, description) VALUES ('" .$type. "', '" .$company_name. "', '" .$location. "', '" .$description. "')"; $result = mysql_query($SQL); mysql_close($db_handle); header( 'Location: http://www.removalspace.com/advert-confirm.php' ); exit(); } else { print "Database NOT Found "; mysql_close($db_handle); } ?> MOD EDIT: code tags added. i use a user management system which can be download this from http://rapidshare.com/files/39584153...LL-DGT.zip.rar i also have a script which emails a link to the entered email address.... i want it to check if the entered email matches with the logged in users email on the database..... this email script can be downloaded from http://rapidbay.net/download/1364276...kurl-v1-7.html as im totally new to php i wud appriciate if u cud explain a lil bit.. pls help.... Dear all, Please help me. I have two sites and both run on separate DB, both have separate signup and login process, Now i want if any user login from any site can access both sites. There are separate session for both sites now i want to use any of the session for user authentication. Please give suggestions. Thanks, Hi guys, Trying to ge this to work: function checkEmail($useremail) { if (!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $useremail)) { return false; $error = '<div id="blackText"><p>Sorry! Please check your email address and try again!<p><p><a href="forumsSignUp.php">Back</a></p></div>'; } return true; //PASSWORD AND OTHER VALIDATION STUFF, blah blah blah } But its just not. Everything works fine if I remove this though. Can anyone suggest an alternative to email address validation? Thanks! Hey all, trying to figure out a logic flaw in this validation script. Basically if I use !preg_match or the preg_match examples (noted below), I do not get the correct results.
My interpretation of preg_match and my current understanding of the logic is noted below (please correct me if I'm wrong).
1. If I use alternate attempt !preg_match, the regex would be compared against the "string" in the $email variable. If the regex expression matches, error will be thrown and script would stop.
2. If I use alternate attempt !preg_match, the condition would be not true and move to else where the string contained within $email variable would be run through the vld function.
3. If I maintain the current script using preg_match, if the string matches the match, the condition would be true and therefore string of $email variable runs through VLD function else cleanup and throw error...
Are my statements above correct in this context? I think I'm pretty close to cracking it but seem to be missing something simple.
The current script is referenced below, forgive me if I've lost the plot. Long hours attempting to understand this language, from what I've seen so far its great.
Thanks in advance,
A
//Alternate attempt
if (!preg_match("/^[^@]+@[^@.]+\.[^@]*\w\w/", $email)) { $error = "Please enter a valid email address"; } else { $email = vld($_POST['email']); } Current code that doens't work: if (empty($_POST['email'])) { $error = "Email is required"; } else { if (strlen($_POST['email']) < 5) { $error = "Email is too short!"; } else { if (strlen($_POST['email']) > 30) { $error = "Email is too long!"; } else { if (preg_match("/[\(\)\<\>\,\;\:\\\"\[\]]/", $email)) { $error = "The email address contains illegal characters"; } else { if (preg_match("/^[^@]+@[^@.]+\.[^@]*\w\w/", $email)) { $email = vld($_POST['email']); } else { $error = "Please enter a valid email address"; } } } } } } Hey everyone. I hope you can help me getting through this problem, because I have no idea of what else to try. I'm a web designer and sometimes modify Javascript, but my main focus is HTML and CSS, meaning I have no idea how to code in Javascript, but most importantly, how to write something from scratch in PHP. So I designed a form that works pretty well, and integrated a PHP and Javascript script to make it work. This is the form: Code: [Select] <form name="form" id="form" method="post" action="contact.php"> <p>Hello,</p> <p>My name is <input type="text" name="name">, from <input type="text" name="location">, and I'd like to get in touch with you for the following purpose:</p> <p><textarea name="message" rows="10" ></textarea></p> <p>By the way, my email address is <input type="text" name="email" id="email" placeholder="john@doe.com">, and I can prove I'm not a robot because I know the sky is <input type="text" name="code" placeholder="Red, green or blue?">.</p> <p title="Send this message."><input type="submit" id="submit" value="Take care."></p> </form> And this is the script, in an external file called contact.php: Code: [Select] <?php $name = check_input($_REQUEST['name'], "Please enter your name.") ; $location = check_input($_REQUEST['location']) ; $message = check_input($_REQUEST['message'], "Please write a message.") ; $email = check_input($_REQUEST['email'], "Please enter a valid email address.") ; if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) {die("E-mail address not valid");} if (strtolower($_POST['code']) != 'blue') {die('You are definitely a robot.');} $mail_status = mail( "my@email.com", "Hey!", "Hello,\n\n$message\n\nRegards,\n\n$name\n$location", "From: $email $name" ); function check_input($data, $problem='') { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); if ($problem && strlen($data) == 0) { show_error($problem); } return $data; } function show_error($myError) { ?> <html> <body> <b>Please correct the following error:</b><br /> <?php echo $myError; ?> </body> </html> <?php exit(); } if ($mail_status) { ?> <script language="javascript" type="text/javascript"> alert('Thank you for the message. I will try to respond as soon as I can.'); window.location = '/about'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('There was an error. Please try again in a few minutes, or send the message directly to aalejandro@bitsland.com.'); window.location = '/about'; </script> <?php } ?> So what it does is this: if everything's OK, it sends an email with "Hey!" as the subject, "[name]" as the sender, "Hello, [message]. Regards, [name], [location]" as the body, and a popup saying the message was delivered appears. If something fails, it outputs the error in a new address, so the user will have to go back to the form and correct the error. What I actually want to happen is this: if everything's OK, a <p> which was hidden beneath the form appears saying the message was delivered, or, alternatively, make the submit button gray out and confirm the message was delivered. I found a script to make this happen, but with "Please wait...", so the user can't resubmit the form. If there's an error, I'd like another <p> which was hidden to appear with the specific error, so there'd be many <p>'s hidden with different IDs. If possible, I'd also like to change the CSS style of the input field, specifically changing the border color to red, so it'd be a change in class for the particular field. -- So in essence, I want the errors and the success messages to output in the same page as the form (without refresh), and a change of class in the input fields that have an error. Thanks in advance, and please let me know if it'll be possible. Hello guys, I just want to ask if someone can share me codes in php where i can validate the connection of the mail server. I am going to trap this error: Quote Warning: mail() [function.mail]: Failed to connect to mailserver.... Instead of this message showing, I want it to be formal. It will be like this: Quote You cannot connect to you're mail server. Please contact the administrator. And lastly I want to have a validation if an email is existing or not. I want a script which checks first the email if it is existing before sending the message. I hope someone will post their idea here. Thanks in Advance. --CHILL This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=359169.0 I am using this a modal window(jBox) - with a web Form in it, that requires the Form (just Name & Email) to be completed and Submitted in order to close the modal window - allowing access to the main page. The Form uses this corresponding ../submit.php which this: if (empty($_POST['name'])|| empty($_POST['email'])){ $response['success'] = false; } else { $response['success'] = true; } echo json_encode($response); where, upon Form > submit, successfully shows 'error' if the Form fields are not populated, and 'success' when the Form fields are populated/submitted.
I'd like the Form to require a proper/valid email address and avoid spam and header injection Any assistance/guidance is appreciated
|