I'm following a php log in and registration tutorial on youtube which has been very helpful until now.
Part 1 http://www.youtube.com/watch?v=axE55ZKMso4
part 2 http://www.youtube.com/watch?v=5A50qmC7wFo (Stuck HERE)
Ive established my form and created some error reports, but the problem comes in when I try to get a successful registration message to appear. The page does not seem to redirect to the specified page and anything under my error post section disappears after registration.
Every other aspect is working except the message, Ive followed him down to the letter, however I implemented my own design. Please help. PS. first time posting here.
Here is my code after all my error post statements.
<?php
if (isset($_GET['success']) && empty($_GET['success'])) {
echo '<font color="#FF0033">Registration Message here</font> ';
} else {
if (empty($_POST) === false && empty($errors) === true) {
$register_data = array(
'username' => $_POST['username'],
'password' => $_POST['password'],
'first_name' => $_POST['first_name'],
'last_name' => $_POST['last_name'],
'email' => $_POST['email']
);
register_user($register_data);
header('Location: register.php?success');
exit();
} else if (empty($errors) === false) {
echo output_errors($errors);
}
}
?>
Everything under this, including the form and other aspects of content exist on landing, but as soon as the registration button is activated, all content under here disappears.
I think there may be a problem with "header('Location: register.php?success');".
In addition, when I force ../rootfolder/register.php/success
through the local host I get an unstyled page? Like its lost all of the CSS and Javascript ?