Hi All.
I am trying to learn this concept, but my example is not working. I need HELP!!! =-)
I want to have a accept licence page that if the checkbox is checked and the submit button is pressed, it will direct you to a form to fill out. Other wise, it will simply display a message for you to accept the licence or get out.
(NOTE: all my code is on 1 php file)
I have a SWITCH statment that looks somthing like this.
switch ($action) {
case "register":
create_account();
break;
case "form1":
register_form();
break;
default:
show_agreement();
break;
}
so the first thing that the user should get directed to is the "show_agreement()" function. which looks like this and works.
function show_agreement(){
global $agreement;
global $PHP_SELF;
echo "You must agree to the Licence agreement";
?>
<form method="post" action="<?php register_form() ?>" >
<input type="hidden" name="action" value="form1">
<input type="checkbox" name="accept" value="1">
<input type="submit" value="sumbit">
<? echo $accept ?>
</form>
<?
}
So if the "Submit button" is pressed , it should redirect you to the "register" form...this is where it starts to fail. Below is the start of my register_from().
function register_form(){
global $userid, $username, $useremail, $userprofile;
global $PHP_SELF;
if($accept == 1){
?>
<center><h3>Create your account!!</h3></center>
<form method="post" action="<?php echo $PHP_SELF ?>">
<input type="hidden" name="action" value="register">
<div align="center"><center><table border="1" width="90%">
<tr>
<th width="30%" nowrap>Desired ID - username</th>
Instead of showing the register form for the user to fill it out, i get an "page can not be displayed". ANY IDEAS???? HELP 😕 😃