View Single Post
Old 08-22-2008, 06:20 AM   #1 (permalink)
! Whitey !
 
Newb Techie

Join Date: Jan 2008

Posts: 21

! Whitey ! is on a distinguished road

Question PHP / MySQL (Die)

Hi,

Could anyone help?!

I have some code that checks to see if some fields are filled in and then if they are it adds them to a database, if not display a message and kill the command (die).

But it gets to die and it doesn't write the rest of the page.

This is some of the code:

PHP Code:
if(isset($_POST['join'])){
   
/* Make sure fields are entered */
   
if(!$_POST['firstname'] || !$_POST['surname']){
      die(
'You haven\'t filled in all the fields!');
   } 
But when the page is generated this is what happens:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration Page</title>
</head>

<body>

<h1>Register</h1>
You haven't filled in all the fields!
And it doesn't write the rest of the page.

I could make it write the rest of the page in the IF statement but I don't want to do that because the content could change and there is a lot to come after it.

Please suggest something!

Thanks

Dave
! Whitey ! is offline