View Single Post
  #19 (permalink)  
Old 12-07-2005, 08:54 AM
edhan's Avatar
edhan edhan is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Singapore
Posts: 547
edhan RepRank 1
Default Re: Ok

Hi

By putting the echo for Username in 3 different places and if the code is executed properly then you will see 3 times the username. If not then investigate why it does not show the 3 echoes.

Quote:
Originally Posted by jazzmatazz2005
Here's a peice of my code where should i put a echo so i can debug?

Code:
<?
 if (isset($_POST['Add']))
  {
   require_once("conn.php");

   $cUsername = $_POST['username'];
   $cPassword = $_POST['password'];
   $cFullname = $_POST['fullname'];
   $cEmail = $_POST['email'];
echo "$cUsername 
";
   //Check for existing user
   $sq = "SELECT * FROM users WHERE username = '$cUsername'";
   $sr = mysql_query($sq) or die(mysql_error());
   if (mysql_fetch_array($sr)) die("Sorry. That user name already exists. Use your browsers back button and select a different username.");

   //Add if not exist
   $aq = "INSERT INTO users (username, password, fullname, email)
          VALUES ('$cUsername', '$cPassword', '$cFullname', '$cEmail')";
   $ar = mysql_query($aq);
echo "$cUsername 
";
   //Preare personal message record for this user
   $suq = "SELECT * FROM users WHERE username = '$cUsername'";
   $sur = mysql_query($suq) or die(mysql_error());
   $sua = mysql_fetch_array($sur);
echo "$cUsername 
";
   header("location:welcome.php");
  }

  require_once("templates/toptempl.php");
  require_once("templates/registertempl.php");
  require_once("templates/bottomtempl.php");
?>
Reply With Quote