Jump to content
MakeWebGames

Need to get my verify.php working


Linton

Recommended Posts

<?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,

   Way of The Mafia Staff



   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>Way of The Mafia</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>



Link to comment
Share on other sites

and the error given by php is?

no email code is been sent to the inboxes off my players :S

 

Parse error: syntax error, unexpected ';' in /hosted/subs/com.net.sc/m/a/mafiaforever/public_html/verify.php on line 96

 

and that when i tried fixing it but managed to put it back to how it was

Link to comment
Share on other sites

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