I have a website that requires a user agreement before completing registration. Currently the register.php does not have it. The user wants to trigger the agreement (terms.php) to come up when the user clicks on the register button. They would need to agree to the terms to continue processing the paypal payment or it should show some error page that says you must register to continue.
I already have the registration page built with the connections to paypal. I need to insert this feature. I have been working with several programmers on this project and the person that designed this page is no longer available. Can someone tell me how I would insert this feature based on the code below?
Or is it a separate function all together?
function registerUser()
{
$first =$_POST['first'];
$last =$_POST['last'];
$company =$_POST['company'];
$addr1 =$_POST['addr1'];
$addr2 =$_POST['addr2'];
$city =$_POST['city'];
$state =$_POST['state'];
$zip =$_POST['zip'];
$phone =$_POST['phone'];
$email =$_POST['email'];
$type =$_POST['type'];
$uname =$_POST['uname'];
$pass1 =$_POST['pass1'];
$payment =$_POST['payment'];
$now=date('YmdHis');
$sqlstr="INSERT INTO users (name_first,name_last,company_name,address,address2,city,state,zip,phone_number,email_address,user_name,password,reg_type,reg_date) VALUES ('"
.$first ."','"
.$last ."','"
.$company ."','"
.$addr1 ."','"
.$addr2 ."','"
.$city ."','"
.$state ."','"
.$zip ."','"
.$phone ."','"
.$email ."','"
.$uname ."','"
.$pass1 ."','"
.$type ."','"
.$now ."')";
// echo "<br>SQL:$sqlstr<br>";
$result=mysql_query($sqlstr);
if (mysql_errno()!=0)
{ echo "<br>DB error on registration:".mysql_error(); exit(); }
echo "<br>You have successfully registered.";
}
function completeRegistration()
{
$id=$_GET['cm'];
$sqlstr="SELECT name_first,name_last FROM users WHERE id=$id";
$result=mysql_query($sqlstr);
if (mysql_errno()!=0)
{ echo "<br>DB error completing registration:".mysql_error(); exit(); }
$row=mysql_fetch_assoc($result);
echo "<br>Thank you, ".$row['name_first']." ".$row['name_last'].", you may<br>now log in using your user name and password.";
}
I already have the registration page built with the connections to paypal. I need to insert this feature. I have been working with several programmers on this project and the person that designed this page is no longer available. Can someone tell me how I would insert this feature based on the code below?
Or is it a separate function all together?
function registerUser()
{
$first =$_POST['first'];
$last =$_POST['last'];
$company =$_POST['company'];
$addr1 =$_POST['addr1'];
$addr2 =$_POST['addr2'];
$city =$_POST['city'];
$state =$_POST['state'];
$zip =$_POST['zip'];
$phone =$_POST['phone'];
$email =$_POST['email'];
$type =$_POST['type'];
$uname =$_POST['uname'];
$pass1 =$_POST['pass1'];
$payment =$_POST['payment'];
$now=date('YmdHis');
$sqlstr="INSERT INTO users (name_first,name_last,company_name,address,address2,city,state,zip,phone_number,email_address,user_name,password,reg_type,reg_date) VALUES ('"
.$first ."','"
.$last ."','"
.$company ."','"
.$addr1 ."','"
.$addr2 ."','"
.$city ."','"
.$state ."','"
.$zip ."','"
.$phone ."','"
.$email ."','"
.$uname ."','"
.$pass1 ."','"
.$type ."','"
.$now ."')";
// echo "<br>SQL:$sqlstr<br>";
$result=mysql_query($sqlstr);
if (mysql_errno()!=0)
{ echo "<br>DB error on registration:".mysql_error(); exit(); }
echo "<br>You have successfully registered.";
}
function completeRegistration()
{
$id=$_GET['cm'];
$sqlstr="SELECT name_first,name_last FROM users WHERE id=$id";
$result=mysql_query($sqlstr);
if (mysql_errno()!=0)
{ echo "<br>DB error completing registration:".mysql_error(); exit(); }
$row=mysql_fetch_assoc($result);
echo "<br>Thank you, ".$row['name_first']." ".$row['name_last'].", you may<br>now log in using your user name and password.";
}