|
Posted by Andy Jeffries on 04/24/06 22:56
On Mon, 24 Apr 2006 12:38:33 -0700, Massa Batheli wrote:
> phpinfo.php works just fine . php intro pages work just fine too When the
> code below is posted the page appears blank does some one have any ideas
> why a page will appear blank.Thanks so much for your time
Because your HTML is invalid?
It should have the structure:
<html>
<head>
<title>Something here</title>
</head>
<body>
.... your form stuff here ...
</body>
</html>
Cheers,
Andy
> <html>
> <FORM ACTION="someform.php" METHOD="GET"> Name: <INPUT TYPE="TEXT"
> NAME="Name" VALUE="Jim" /><BR /> Password: <INPUT TYPE="PASSWORD"
> NAME="Password" MAXLENGTH="10" /><BR />
> Age range: <SELECT NAME="Age">
> <OPTION VALUE="Under 16">Under 16</OPTION> <OPTION VALUE="16-30"
> SELECTED>16-30</OPTION> <OPTION VALUE="31-50">31-50</OPTION>
> <OPTION VALUE="51-80">51-80</OPTION>
> </SELECT><BR /><BR />
> Life story:<BR /> <TEXTAREA NAME="Story" ROWS="10" COLS="80">Enter your
> life story here</TEXTAREA><BR /><BR /> <INPUT TYPE="RADIO"
> NAME="FaveSport" VALUE="Tennis"> Tennis</INPUT> <INPUT TYPE="RADIO"
> NAME="FaveSport" VALUE="Cricket"> Cricket</INPUT> <INPUT TYPE="RADIO"
> NAME="FaveSport" VALUE="Baseball"> Baseball</INPUT> <INPUT TYPE="RADIO"
> NAME="FaveSport" VALUE="Polo"> Polo</INPUT> <BR />
> <INPUT TYPE="CHECKBOX" NAME="Languages[]" VALUE="PHP" CHECKED> PHP</INPUT>
> <INPUT TYPE="CHECKBOX" NAME="Languages[]" VALUE="CPP"> C++</INPUT> <INPUT
> TYPE="CHECKBOX" NAME="Languages[]" VALUE="Delphi"> Delphi</INPUT>
> <INPUT TYPE="CHECKBOX" NAME="Languages[]" VALUE="Java"> Java</INPUT> <BR
> /><INPUT TYPE="submit" />
> </FORM>
> </html>
>
> someform.php
>
> <?php
> $_POST['Languages'] = implode(', ', $_POST['Languages']); $_POST['Story']
> = str_replace("\n", "<BR />", $_POST['Story']);
>
> print "Your name: {$_POST['Name']}<BR />"; print "Your password:
> {$_POST['Password']}<BR />"; print "Your age: {$_POST['Age']}<BR /><BR
> />"; print "Your life story:<BR />{$_POST['Story']}<BR /><BR />"; print
> "Your favourite sport: {$_POST['FaveSport']}<BR />"; if
> (isset($_POST['Languages'])) {
> print "Languages you chose: {$_POST['Languages']}<BR />";
> } else {
> print "You did not select any languages!" ;
> }
> ?>
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|