I want that when the user press "submit" he needs to pay by paypal ( use paypal IPN ) and if he payd the user will be inserted into the datbase, if he didnt pay nothing will happen.
Thanks for any help !
- Code: Select all
<html>
<head>
<title>New user registration</title>
</head>
<body>
<?php
include('db.php');
if(isset($_POST['submit']))
{
$username=$_POST['username'];
$password=$_POST['password'];
$err='';
if($_POST['username']=="")
{
$err.="Please type username";
}
if($_POST['password']=="")
{
$err.="Please type password";
}
if($_POST['password']!=$_POST['password1'])
{
$err.="Password mismatch";
}
if($err=="")
{
$query=mysql_query("insert into tab (id,username, password) values('','$username','$password')");
if($query)
{
echo "<script type='text/javascript'>alert('User registered successfully')</script>";
}
else
{
echo "<script type='text/javascript'>alert('there is a problem in user registration successfully')</script>";
}
}
else
{
echo $err;
}
}
else
{
?>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<h1>New user registration</h1><br><br>
Username: <input type="text" name="username"><br>
Password: <input type="password" name="password"><br>
Re-enter Password: <input type="password" name="password1"><br><br>
<input type="submit" name="submit">
</form>
<?php
}
?>
</body>
</html>

