web page is blank

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sennat
Forum Newbie
Posts: 4
Joined: Wed Jul 19, 2006 11:52 pm

web page is blank

Post by sennat »

Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I have developed a simple registration page 
http://www.clevelandprayerfestival.com/ ... ation.html
when the user enters the details and clicks on the Submit button...it should goto http://www.clevelandprayerfestival.com/add_entry.php 

but the page is blank...my add_entry.php coding is as follows...

Code: Select all

<?
//Database information required to connect to database
$servername='localhost';
// username and password to log onto db server
$dbusername='******';
$dbpassword='******';
// name of database
$dbname='guest_registration';

// Connect to Database and select the database to use 
$dbi = mysql_connect("$servername","$dbusername","$dbpassword") or
die("I cannot connect to the database. Error :" . mysql_error()); 
mysql_select_db($dbname,$dbi); 

// Get the values posted from the Form in comments.php 
$guest_title = $_POST["guest_title"]; 
$guest_firstname = $_POST["guest_firstname"]; 
$guest_lastname = $_POST["guest_lastname"]; 
$guest_address = $_POST["guest_address"]; 
$guest_city = $_POST["guest_city"]; 
$guest_state = $_POST["guest_state"]; 
$guest_zip = $_POST["guest_zip"]; 
$guest_country = $_POST["guest_country"]; 
$guest_phoneno = $_POST["guest_phoneno"]; 
$guest_email = $_POST["guest_email"]; 
$guest_peoplecount = $_POST["guest_peoplecount"]; 
$guest_request = $_POST["guest_request"]; 

// Now let us check if first name is entered or not
if($guest_firstname==""){  
die " You haven't Entered Your FirstName. Go back and Enter your FirstName"; 
}
// Now let us check if lastname is entered or not
if($guest_lastname==""{
die " You haven't Entered Your LastName. Go back and Enter your LastName"; 
}
// Now let us check if city is entered or not
if($guest_city==""){
die " You haven't Entered the City. Go back and Enter the City"; 
}
// Now let us check if state is entered or not
if($guest_state==""){
die " You haven't Entered the State. Go back and Enter the State"; 
}
// now let us check email address
if ($guest_email=="") {
die " You haven't Entered Your Email Address. Go back and Enter your Email Address"; 
}
// Now let us check if no. of people attending name is entered or not
if($guest_peoplecount==""){
die " You haven't Entered the no. of people attending. Go back and Enter the no. of people attending"; 
}

$tm=time(); // reading the time of entry

// adding data to mysql database
$sql = "insert into guest_registration(guest_title,guest_firstname,guest_lastname,guest_address,guest_city,guest_state,guest_zip,guest_country,guest_phoneno,guest_email,guest_peoplecount,tm,guest_request) values('$guest_title','$guest_firstname','$guest_lastname','$guest_address','$guest_city','$guest_state','$guest_zip','$guest_country','$guest_phoneno','$guest_email','$guest_peoplecount','$tm','$guest_request')";
$result = mysql_query($sql,$dbi); 
If ($result) 
{ 
echo "<center> Your Details have been added to the database<br>"; 
echo " <a href="view_entry.php">Click here to go back to the 
guestbook</a></center>" ; 
} else 
echo " Your details were not added due to some database problem"; 

?>
can anyone plz help me...


Pimptastic | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Replace your last if statement with this.

Code: Select all

if ($result)
{
echo "<center> Your Details have been added to the database<br>";
echo " <a href=\"view_entry.php\">Click here to go back to the guestbook</a></center>" ;
} else {
echo " Your details were not added due to some database problem";
}
sennat
Forum Newbie
Posts: 4
Joined: Wed Jul 19, 2006 11:52 pm

still the page is blank

Post by sennat »

still the page is blank
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Ok. there is an error someplace else in the script then. You will need to turn error reporting and display errors on in order to view the error.
sennat
Forum Newbie
Posts: 4
Joined: Wed Jul 19, 2006 11:52 pm

how to do it

Post by sennat »

in my root folder i have bad_request.html, forbidden.html, internal_Server_error.html, not_found.html

when i remove add_entry.php...i get internal_server_error.html but how should i enable error reporting...can u be more specific...this is the first time i am doing php...
Post Reply