hi

ah have ah form that when data is inserted it would go to a welcome page which it does but I keep getting this error

( ! ) Notice: Undefined index: first in C:\wamp64\www\luana_itec244\php\welcome.php on line 25 Call Stack #TimeMemoryFunctionLocation 10.0007237872{main}( )...\welcome.php:0 ( ! ) Notice: Undefined index: last in C:\wamp64\www\luana_itec244\php\welcome.php on line 26 Call Stack #TimeMemoryFunctionLocation 10.0007237872{main}( )...\welcome.php:0

is there a way to fix this error. would like to move on. here is my codes that i have used.

<?php

    session_start();

    if(isset($_SESSION['user']))
    {
        header('Location:login.php');
    }

?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11.dtd">

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

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

            Welcome!!! <option value="Realname"><?php echo $_SESSION['first'] . ' ' 
                    . $_SESSION['last'] ?></option>
            <?php
                echo " you are now a member of the Caribbean Culinary Network (CCIN). 
                        Your monthly newsletter will be email to you."
            ?>

    </body>
</html>

I think you are missing ; at the end of your code line 26. Also the undifined index does state that the first is not defined which means at the time of you loading that pay, first wasn't assigned any thing or wasn't even declared as it takes it as something that doesn't exist. Please check your other file code that calls this file and check if this file is called after first was declared and initialiezed, or you can post that other file code here so we will have a look at it. The error says first and last wasn't declared so look into that.

Be a part of the DaniWeb community

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