hi there

i have this registration page when a user login it should redirect you to a welcome page, I am having a similar problem at to one user who was experiencing the same problem.

at one time it was going to the welcome page, but there were errors in the firstname an lasname variable. how to echo it out. apparently i had code it wrong, so it was picking up the error, try fixing and I have no idea I did or didn't know now when i tried registering, it is blank

i have a login page also and that and all is not working. here is the 2 sets of codes. one is the register.php and the other is the welcome page codes.

this is what i have so far. i know that I have asked this question before abot the name.


            //capture the variable from the form and store in php variables


            //connecting to the server

            $con = mysqli_connect($db_host,$db_username,$db_password) or die (mysqli_connect_error());

            //select the database you want to query

            mysqli_select_db($con, 'food') or die (mysqli_error($con));
            $sql = "SELECT * FROM member WHERE userName = '$userName'";
            $result = mysqli_query($con, $sql) or die ("Error:".mysqli_error($con));

            if($rowcount >= 1)
                echo "<script type=\"text/javascript\";
                alert('username already exist');
                //insert data into table

                $sql = "INSERT INTO member VALUES('$title', '$firstname', '$lastname', 
                        '$address', '$txtemail', '$gender', '$userName', MD5('$pword'))";

                if(mysqli_query($con, $sql))
                        echo "Error inserting into database".mysqli_error($con);



the welcome page php codes. 



<?xml version="1.0" encoding="UTF-8"?>

<html xmlns="http:www.w3.org/1999/xhtml"xml:lang="en" lang="en">

        <title> Welcome - <?php echo "".$_SESSION['user']; ?></title>

            Welcome!!! <?php echo $_POST['firstname']; ?><!<br/><?php echo $_POST['lastname'];?>
                echo " you are now a member of the Caribbean Culinary Network (CCIN). 
                        Your monthly newsletter will be email to you."


1 contributor, 2 views 0 replies, sad smdh

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.