You are here: Re: PHP page is blank for newbie « PHP Programming Language « IT news, forums, messages
Re: PHP page is blank for newbie

Posted by David Haynes on 04/25/06 01:05

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
>
>
>
>
>
> <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!" ;
> }
> ?>
>
Well the first thing that comes to mind is that your form method is
'GET' but you are accessing 'POST' variables.

So, you will implode null and str_replace on null.
I bet those functions aren't happy with that...

-david-

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация