RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

operations

Join Date: Mar 2007
Posts: 17
Reputation: justinm is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
justinm justinm is offline Offline
Newbie Poster

Re: operations

  #3  
Mar 28th, 2007
Originally Posted by VanPetrol View Post
Pseudo code (as far I know) is basically like this:
 
If the user did not enter his name
  Warn user by message box
  Focus on name textbox
  exit the method
If the user did not enter a password
  Warn user by message box
  Focus on password textbox
  exit the method
 
Try to connect to database
If connection to database fails
  Show error in messabox
  exit the method
I used to write things like this...paste it into my code editor, once I'm happy, and then use it at comments with the actuall valid code following each line.


in code...

if(empty($_POST['username'])){
echo "Sorry, you need to enter a username."; //do focus here exit();
if(empty($_POST['password'])){
echo "You need to enter a password."; // do focus here exit();
if(mysql_connect('shizz','nizz','wizz')){
"Success!";
}else{
die("sorry, no connection!");
}

something like that really...
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:27 am.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC