| | |
Black Response
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2005
Posts: 30
Reputation:
Solved Threads: 0
Hello All,
I am a PHP newbie and have all my resources set up( by that I mean PHP,Apache server etc all working fine)
I have an html file and a PHP script to handle the inputs from the html form. However when I hit submit to send the data to the PHP script I get a blank page.
Below are my files.
[code = php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>HTML Form</title>
</head>
<body>
<!--Script 2.1 -from.html -->
<form action = "handle_form.php " method="post">
<fieldset><legend> Enter you information in the form below :</legend>
<p><b>Name :</b> <input type = "text" name = "name" size ="20" maxlength = "40"/></p>
<p><b>Email :</b> <input type = "text" name ="email" size="40" maxlength ="40"/></p>
<p><b>Gender :</b> <input type = "radio" name ="gender" value ="M" />Male
<input type = "radio" name ="gender" value ="F" />Female
</p>
<p><b>Age :</b>
<select name = "age" >
<option value ="0-30">Under 30</option>
<option value ="30-60">Between 30 and 60</option>
<option value ="60+">Over 60 </option>
</select></p>
<p><b>Comments :</b><textarea name = "comments" rows ="3" cols="50"></textarea></p>
</fieldset>
<div align = "center"><input type = "submit" name ="submit" value ="Submit Information"/><div>
</form>
[/code]
****...and here is the PHP script handling the form above*************
[code = php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>Form Feedback</title>
</head>
<body>
<? php # Script 2.2 -handle_form.php
echo "<p> Thank you ,<b>$name</b> for the following comments :<br/><tt>$comments</tt><p>We will reply to you at <i>$email</i>.</p>";
?>
</body>
</html>[/code]
I'd be grateful if some can explain why the handle_form.php shows up BLANK when I clik submit from the form.html.
Thank You.
I am a PHP newbie and have all my resources set up( by that I mean PHP,Apache server etc all working fine)
I have an html file and a PHP script to handle the inputs from the html form. However when I hit submit to send the data to the PHP script I get a blank page.
Below are my files.
[code = php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>HTML Form</title>
</head>
<body>
<!--Script 2.1 -from.html -->
<form action = "handle_form.php " method="post">
<fieldset><legend> Enter you information in the form below :</legend>
<p><b>Name :</b> <input type = "text" name = "name" size ="20" maxlength = "40"/></p>
<p><b>Email :</b> <input type = "text" name ="email" size="40" maxlength ="40"/></p>
<p><b>Gender :</b> <input type = "radio" name ="gender" value ="M" />Male
<input type = "radio" name ="gender" value ="F" />Female
</p>
<p><b>Age :</b>
<select name = "age" >
<option value ="0-30">Under 30</option>
<option value ="30-60">Between 30 and 60</option>
<option value ="60+">Over 60 </option>
</select></p>
<p><b>Comments :</b><textarea name = "comments" rows ="3" cols="50"></textarea></p>
</fieldset>
<div align = "center"><input type = "submit" name ="submit" value ="Submit Information"/><div>
</form>
[/code]
****...and here is the PHP script handling the form above*************
[code = php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>Form Feedback</title>
</head>
<body>
<? php # Script 2.2 -handle_form.php
echo "<p> Thank you ,<b>$name</b> for the following comments :<br/><tt>$comments</tt><p>We will reply to you at <i>$email</i>.</p>";
?>
</body>
</html>[/code]
I'd be grateful if some can explain why the handle_form.php shows up BLANK when I clik submit from the form.html.
Thank You.
•
•
Join Date: Dec 2006
Posts: 10
Reputation:
Solved Threads: 0
•
•
•
•
Hello All,
I am a PHP newbie and have all my resources set up( by that I mean PHP,Apache server etc all working fine)
I have an html file and a PHP script to handle the inputs from the html form. However when I hit submit to send the data to the PHP script I get a blank page.
Below are my files.
[code = php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>HTML Form</title>
</head>
<body>
<!--Script 2.1 -from.html -->
<form action = "handle_form.php " method="post">
<fieldset><legend> Enter you information in the form below :</legend>
<p><b>Name :</b> <input type = "text" name = "name" size ="20" maxlength = "40"/></p>
<p><b>Email :</b> <input type = "text" name ="email" size="40" maxlength ="40"/></p>
<p><b>Gender :</b> <input type = "radio" name ="gender" value ="M" />Male
<input type = "radio" name ="gender" value ="F" />Female
</p>
<p><b>Age :</b>
<select name = "age" >
<option value ="0-30">Under 30</option>
<option value ="30-60">Between 30 and 60</option>
<option value ="60+">Over 60 </option>
</select></p>
<p><b>Comments :</b><textarea name = "comments" rows ="3" cols="50"></textarea></p>
</fieldset>
<div align = "center"><input type = "submit" name ="submit" value ="Submit Information"/><div>
</form>
[/code]
****...and here is the PHP script handling the form above*************
[code = php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN " "http://www.w3.org/TR/2000/REC -xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>Form Feedback</title>
</head>
<body>
<? php # Script 2.2 -handle_form.php
echo "<p> Thank you ,<b>$name</b> for the following comments :<br/><tt>$comments</tt><p>We will reply to you at <i>$email</i>.</p>";
?>
</body>
</html>[/code]
I'd be grateful if some can explain why the handle_form.php shows up BLANK when I clik submit from the form.html.
Thank You.
you can do that functions in a single page itself
without doing two seprate pages.I have altered your code and i have given that below .you check that and if any doubt means ask upto my knowledge if know i will explain
the code
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>HTML Form</title>
</head>
<?php
$name=$_REQUEST['name'];
$comments=$_REQUEST['comments'];
$submit=$_REQUEST['submit'];
if($submit)
{
$ee="Thank you $name for the following comments
commentsWe will reply to you at $email";}
?>
<body>
<!--Script 2.1 -from.html -->
<form action="" method="post">
<fieldset><legend> Enter you information in the form below :</legend>
<p><? echo $ee;?> </p>
<p><b>Name :</b> <input type = "text" name = "name" size ="20" maxlength = "40" value="<?=$name?>"/></p>
<p><b>Email :</b> <input type = "text" name ="email" size="40" maxlength ="40"/></p>
<p><b>Gender :</b> <input type = "radio" name ="gender" value ="M" />Male
<input type = "radio" name ="gender" value ="F" />Female
</p>
<p><b>Age :</b>
<select name = "age" >
<option value ="0-30">Under 30</option>
<option value ="30-60">Between 30 and 60</option>
<option value ="60+">Over 60 </option>
</select></p>
<p><b>Comments :</b><textarea name="comments" rows ="3" cols="50"><?=$comments?></textarea></p>
</fieldset>
<div align = "center"><input type ="submit" name="submit" value="submit"/><div>
</form>
•
•
Join Date: Mar 2005
Posts: 30
Reputation:
Solved Threads: 0
•
•
•
•
Hi,
you can do that functions in a single page itself
without doing two seprate pages.I have altered your code and i have given that below .you check that and if any doubt means ask upto my knowledge if know i will explain
the code
<html xmlns ="http://www.w3.org/1999/xhtml" xml :lang="en" lang ="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<title>HTML Form</title>
</head>
<?php
$name=$_REQUEST['name'];
$comments=$_REQUEST['comments'];
$submit=$_REQUEST['submit'];
if($submit)
{
$ee="Thank you $name for the following commentscommentsWe will reply to you at $email";
}
?>
<body>
<!--Script 2.1 -from.html -->
<form action="" method="post">
<fieldset><legend> Enter you information in the form below :</legend>
<p><? echo $ee;?> </p>
<p><b>Name :</b> <input type = "text" name = "name" size ="20" maxlength = "40" value="<?=$name?>"/></p>
<p><b>Email :</b> <input type = "text" name ="email" size="40" maxlength ="40"/></p>
<p><b>Gender :</b> <input type = "radio" name ="gender" value ="M" />Male
<input type = "radio" name ="gender" value ="F" />Female
</p>
<p><b>Age :</b>
<select name = "age" >
<option value ="0-30">Under 30</option>
<option value ="30-60">Between 30 and 60</option>
<option value ="60+">Over 60 </option>
</select></p>
<p><b>Comments :</b><textarea name="comments" rows ="3" cols="50"><?=$comments?></textarea></p>
</fieldset>
<div align = "center"><input type ="submit" name="submit" value="submit"/><div>
</form>
•
•
Join Date: Sep 2006
Posts: 91
Reputation:
Solved Threads: 0
Your code probably has an error in it but you can't see it because error reporting is probably turned off. Put this at the top of your page:
error_reporting(E_ALL);
so see the errors.
error_reporting(E_ALL);
so see the errors.
The Blog Experiment Forum - Join the Conversation!
brainyminds | ilovecode
Ultimate Merchant Account Resource
brainyminds | ilovecode
Ultimate Merchant Account Resource
![]() |
Similar Threads
- Help with dates please (ASP)
- CRT screen completely black, HP P1110 chasis (Monitors, Displays and Video Cards)
- Machine gun noise on cold boot, locking mouse, icones turning black ... (Troubleshooting Dead Machines)
- XP complete crash (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: simple url variable
- Next Thread: Help with comments box and uploading and resizing images for users
| Thread Tools | Search this Thread |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube





