The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Its in the URL but not printed to screen

Hi
I have altered a few things in my script that sends info to another page. Basically, I can see the info I have sent in the URL of the target page, it looks like this:

/~p0c79/teacher.php?UserName=David+Graham&logondetails=1+password

And now all the page is asked to do is print the UserName like this:

print("Greetings " . $UserName . "<br>\n");

However, all I get is 'Greetings' , nothing else. Is it because I have also passed other info called logondetails?

I have enclosed the scripts, here is the form script:

<HTML>
<HEAD>
<TITLE> Sample Page </TITLE>
</HEAD>
<BODY>

PHP Code:

<?php
if ($Message == "Invalid") {
print ("<B><CENTER><FONT COLOR=RED>The id and password you entered do not match what is on file. Please try again!</FONT></CENTER></B>\n");
}

if (isset($firstname) AND isset($surname) AND isset($password) AND isset($userid))
{
$name=$firstname . " " . $surname;
$logondetails=$userid . " " . $password;
// Now we will welcome the user to our site.
print("<P><b><center>Wellcome: $name </center></b><br> This is the feedback part of the \'Humans As Organisms\' module.<P>\n");

$name=urlencode($name);
$logondetails=urlencode($logondetails);

print("<P>Click here <A HREF= \"bestpassword5.php?name=$name&logondetails=$logondetails\">link</A>\n");
print(" to be taken to a page that will display your test results.</P>\n");
}

else
{
print(" <!-- No name has been provided, so we
prompt the user for one. -->");

solved

I was exploding $name when I should have been exploding $UserName - also I started to get problems with headers already sent - this was because I forgot nothing, even the title, must go to the browser before the header. Oh well, alright now.

Thanks

Thanks
While, your online, can I get one more question in. I wish to sum the contents in the score column of my table. The php manual would seem to suggest there is no sum() function - I'm never too sure how much sql you can use when your basic language is php? There is an array_sum(array)in php or can I just use sum(). Also the coumn cotains test marks for several different types of test eg Chemistry and Physics. Do I add up scores for different tests by putting a group by testname (thats the column name that has the name of the test)in the query.