So, do i make a change here?
you didnt tell me that... lol
so if i change your script to look like so:
[PHP]<?php
session_start() ;
?>
<html>
<head><title>Mo toma Rocks My Homework</title></head>
<body>
<?php
if(!isset($_SES SION['userid']))
{
if(!isset($_POS T['username']) || !isset($_POST['password']))
{
echo '<form method="POST">< input type="text" name="username" /><input type="password" name="password" /><input type="submit" /></form>';
}
else if(authenticate ($_POST['username'], $_POST['password']))
{
$_SESSION['userid'] = $_POST['username'];
header('Locatio n: thispage.php');
}
}
else
{
if(!isset($_POS T['data1']) || !isset($_POST['data2'])) //fill with all question data objects
{
echo '<form method="POST">< select name="data1"><o ption value="q1a">Lor em</option><option value="q1b">Ips um</option>
</select><select name="data2"><o ption value="q1a">Lor em</option><option value="q1b">Ips um</option></select></form>';
}
else
{
AppendDataToFil e($_SESSION['userid'], $_POST['data1'], $_POST['data2']);
echo 'Thank you for your submission '.$_SESSION['userid'].'!';
}
}
function authenticate($u , $p)
{
if($u == 'admin' && $p == 'password') return true; //replace with the actual authentication.
return false;
}
?>
</body>
</html>[/PHP]
i just might get it working?
you didnt tell me that... lol
so if i change your script to look like so:
[PHP]<?php
session_start() ;
?>
<html>
<head><title>Mo toma Rocks My Homework</title></head>
<body>
<?php
if(!isset($_SES SION['userid']))
{
if(!isset($_POS T['username']) || !isset($_POST['password']))
{
echo '<form method="POST">< input type="text" name="username" /><input type="password" name="password" /><input type="submit" /></form>';
}
else if(authenticate ($_POST['username'], $_POST['password']))
{
$_SESSION['userid'] = $_POST['username'];
header('Locatio n: thispage.php');
}
}
else
{
if(!isset($_POS T['data1']) || !isset($_POST['data2'])) //fill with all question data objects
{
echo '<form method="POST">< select name="data1"><o ption value="q1a">Lor em</option><option value="q1b">Ips um</option>
</select><select name="data2"><o ption value="q1a">Lor em</option><option value="q1b">Ips um</option></select></form>';
}
else
{
AppendDataToFil e($_SESSION['userid'], $_POST['data1'], $_POST['data2']);
echo 'Thank you for your submission '.$_SESSION['userid'].'!';
}
}
function authenticate($u , $p)
{
if($u == 'admin' && $p == 'password') return true; //replace with the actual authentication.
return false;
}
?>
</body>
</html>[/PHP]
i just might get it working?
Comment