Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Php/mysql register form with paypal

$
0
0

I have simple mysql/php register script. 

Now i need when register click submit then save all data database and then resdict to paypal pay now page. 

And when payment success then save database "Payment success" and then resdict to another page.

If "Payment canceled" then show messages "You cancelled payment" And resdict to page where is some text information.

Can someone help me little bit about that? :)

<?php include "base.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">  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
<title></title>
<link rel="stylesheet" type="text/css" href="style1.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
<script type="text/javascript" src="placeholder.js"></script>
</head>  
<body>  

<?php
if(!empty($_POST['username']) && !empty($_POST['password']))
{
	$username = mysql_real_escape_string($_POST['username']);
    $password = md5(mysql_real_escape_string($_POST['password']));
    $email = mysql_real_escape_string($_POST['email']);
    
	 $checkusername = mysql_query("SELECT * FROM users WHERE Username = '".$username."'");
     
     if(mysql_num_rows($checkusername) == 1)
     {
     	echo "<h1>Error</h1>";
        echo "<p>Sorry, that username is taken. Please go back and try again.</p>";
     }
     else
     {
     	$registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."')");
        if($registerquery)
        {
        	echo "<h1>Success</h1>";
        	echo "<p>Your account was successfully created. Please <a href=\"index.php\">click here to login</a>.</p>";
        }
        else
        {
     		echo "<h1>Error</h1>";
        	echo "<p>Sorry, your registration failed. Please go back and try again.</p>";    
        }    	
     }
}
else
{
	?>
<form method="post" action="register.php" name="registerform" id="registerform">
		<label for="username">Username:</label><input type="text" name="username" id="username" class="placeholder" placeholder="Username"/><br />
		<label for="password">Password:</label><input type="password" name="password" id="password" class="placeholder" placeholder="Password"/><br />
        <label for="email">Email Address:</label><input type="email" name="email" id="email" class="placeholder" placeholder="Email"/><br />
		<input type="submit" name="register" id="register" value="Register" />
	</form>
    
	
	
	
   <?php
}
?>

</body>
</html>

 

 


Viewing all articles
Browse latest Browse all 13200

Latest Images

Trending Articles



Latest Images