PDA

View Full Version : Need to get my verify.php HELPPP



Linton
05-18-2011, 05:45 PM
:@ any contrbution appresiated

Linton
05-18-2011, 05:45 PM
(verify.php working) soz missed a word out

rulerofzu
05-18-2011, 05:58 PM
Well let me look in my crystal ball (coded in php returns answers by json to a jquery ball).

Nope the crystal ball says how the heck can i know whats wrong with your verify.php unless you give more info.

Linton
05-18-2011, 06:01 PM
its not sending out the code verifacation to emails :s

Linton
05-18-2011, 06:03 PM
<?php

session_start();

include_once "includes/db_connect.php";

include_once "includes/functions.php";

include_once "includes/jail_check.php";

logincheck();

$username=$_SESSION['username'];



$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));

if ($fetch->verify=='1'){

die("You are verified!");

}



if (strip_tags($_POST['send']) && strip_tags($_POST['email'])){

$email=strip_tags($_POST['email']);



$sql_email_check = mysql_query("SELECT email FROM users WHERE email='$email' AND status='Alive' AND verify='1'");

$email_check = mysql_num_rows($sql_email_check);



if ($email_check > "0"){ echo "<center>This email is already in use!</center>"; }elseif ($email_check == "0"){



if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){

echo "<center>Invalid Email!</center>";



}else{





$code=round(rand(1000000000,9999999999));



mysql_query("UPDATE users SET email='$email' WHERE username='$username'");

mysql_query("UPDATE users SET verifycode='$code' WHERE username='$username'");









$subject = "Verification Code";

$message = "Dear $fetch->username,



Your verification code is: $code





Regards,

Mafiaforever Staff (Owner-Linton Andrews)

Want to buy into this project Message me for details


This is an automated response, please do not reply.";



mail($email, $subject, $message,

"From: Way of The Mafia<verification@wayofthemafia.com>");

echo "<center>An email has been sent with your verification code. Remember to check your spam/junk mail.</center>";



}}
}


if (strip_tags($_POST['submit']) && strip_tags($_POST['vcode'])){

$vcode=strip_tags($_POST['vcode']);



if ($fetch->verifycode != $vcode){ echo "<center>Incorrect verification code!</center>"; }elseif ($fetch->verifycode == $vcode){



mysql_query("UPDATE users SET verify='1' WHERE username='$username'");



echo"<center>You are now verified!</center>";

}}

?>



<html>

<head>

<link rel="shortcut icon" href="favicon.ico.png">

<link rel="stylesheet" href="includes/in.css" type="text/css">

<title>MafiaForever</title>

</head>



<body>

<form action="" method="post">

<table width="300" align="center" cellpadding="0" cellspacing="0" class="table">

<tr>

<td class="thinline">Email</td>

</tr>



<tr>

<td align="center">Enter the Email you want your verification code to be sent to.</tr>

<tr><td align="center"><input type="text" name="email" class="textbox1"></td></tr>

<tr><td align="center"><input type="submit" name="send" class="button" value="Send"></td>

</tr>

</table></form>



<form action="" method="post">

<table width="300" align="center" cellpadding="0" cellspacing="0" class="table">

<tr>

<td class="thinline">Verification Code</td>

</tr>



<tr>

<td align="center">Enter your verification code.</tr>

<tr><td align="center"><input type="text" name="vcode" class="textbox1"></td></tr>

<tr><td align="center"><input type="submit" name="submit" class="button" value="Submit"></td>

</tr>

</table></form>



</body>

</html>

rulerofzu
05-18-2011, 06:20 PM
I would try it like this so your sending headers so its not rejected.

$from="verification@wayofthemafia.com";
$headers="From: $from";
mail($email, $subject,$message,$headers);

Also you really need to look at the rest of the code its nasty :P

eregi is depreciated
strip_tags?

Would be better using isset to check if the form has been submitted or not.