PHP same page echoing (using die funct.)

asmedeus

New Member
\[code\] <?php //filename signup.php ob_start(); include('dat.php'); if (!empty($_POST)){ if ($pass!="d41d8cd98f00b204e9800998ecf8427e" OR $user!="") { // 1 $result=mysql_query($sql); if(mysql_error()) { die('Sorry, this username already exists'); // 2 } } else { echo "Please enter the Password"; } } ob_end_flush(); ?><html><body><form name="form1" method="post" action="signup.php"> <!--3-->Username<input name="myusername" type="text" id="myusername" />Password<input name="mypassword" type="text" id="mypassword" />e-mail<input name="email" type="text" id="email" /><input type="submit" name="Submit" value="http://stackoverflow.com/questions/3602654/Login" /></form></body></html>\[/code\]This is a sign up page (All the mysql details are missing here, they are included in dat.php) . If there is ny error , it is displayed in the same page.
problem 1 : [ //1 ] what is the operator for OR , in this case I have used the condition for if the pass or user is blank,but the OR is not working neither || , used in javascript.
problem 2 : [ //2 ] if die is used , then the statement is printed in the new window , but I want it to appear in the same window...I also used echo, it worked but I feel like i am missing the main function of 'die' by using 'echo'.
problem 3 : [ \[code\]<!--3-->\[/code\] ] how can I replace signup.php as action to something like SERVER_PAGE or whatever...
 
Back
Top