Quickie: See the line "echo 'poo..... below? It's not echowing the $row['username'] and I'm not sure why.

$selection= addslashes(htmlentities($_POST['username']));
	$sql = " SELECT * FROM webfriends WHERE username = '". mysql_real_escape_string($selection) ."' ";
	if ($result = @mysql_query($sql)) {
					//echo md5($_POST['password']);
					 //setcookie ("wfcookie", "you are logged in", time()+3600);
					 session_start();
					 $_SESSION['$selection'];
					 echo 'poo' . $row['username'];
					 echo $selection;
					 }

This bit, the 'poo' echoes (thats just there for testing reasons) but the $row['username'] doesn't. This is part of a larger script, if you feel the problems lays there, tell me and I'll post the lot.

echo 'poo' . $row['username'];

Thanks

    Nowhere in any of your code do you define where $row is comming from.

      Heh, as usuall I foobar it. I piece together old code and change it to new code... give me a min.

      Could I change $row to $sql ?

      EDIT: No hehe delves in further

        No, you need something along the lines of...

        if ($result = @mysql_query($sql)) { 
          //echo md5($_POST['password']); 
          //setcookie ("wfcookie", "you are logged in", time()+3600); 
          session_start(); 
          $_SESSION['$selection'];
          while ($row = mysql_fetch_array($result)) {
            echo 'poo' . $row['username']; 
            echo $selection; 
          }
        }
          Write a Reply...