Jump to content
MakeWebGames

Recommended Posts

Posted

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.

Posted
<?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<[email protected]>"); 

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>
Posted

I would try it like this so your sending headers so its not rejected.

$from="[email protected]";

$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.

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.   Paste as plain text instead

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