Hello,
I have a login system, with the session show I the name of the member in the browser, if they log in.
I have have written a script that: When you logged in and signup for a event that the name of the member insert into a database. So the member then no need to enter the name in a form, you see the name in the session variable.
But this doesn’t work.
I get the error: Notice: Undefined index: username in C:xampphtdocsvrplatformsignup_event.php on line 26
my question is: How get I the name of the $_session[‘username’] into the database?
thanks in advance.
my code is:
[code=php] if ($_SESSION[‘username’]) echo “<p>welcome, ” .$_SESSION [‘username’] .” <a href=’logout.php’ onclick=’return confirm(“You want to log out?”)’>uitloggen</a></p>”;
else
header(“Location: index.php”);
$name = $_POST[‘username’];//this is line 26
$event = $_POST[‘signupn’];
//sql voor invoegen
$sql = “INSERT INTO connecttablel (name, name_event) VALUES ($name, $event)”;