Why I Just Get A Blank White Page?
Posted by: nizam (203.82.79.---)
Date: June 03, 2009 06:21PM

Hi all, i'm nizam from Malaysia. Sorry if my question is to common in here. Okey, here's my problem: I already install WAMP in my laptop. After that, I tested it by typing localhost in my browser, everything looks like working fine. Then, i tried to create a Hello World file, save it as test.php and save into the www folder (same folder as index.php). When i try to open it using my browser, i just get a blank white page (localhost/test.php). I'm suppose to get a 'Hello World' text. I tried to create another PHP files and the results is still the same. So, what is the mistake that i have done? I used notepad to type that simple php code. I'm a newbie and just starting to learn a simple PHP program. Thanks in advance.

Options: ReplyQuote
Re: Why I Just Get A Blank White Page?
Posted by: yfastud (Moderator)
Date: June 03, 2009 06:25PM

make sure no hidden extension .txt in when saved it

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Why I Just Get A Blank White Page?
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: June 03, 2009 08:08PM

When saving your file in Notepad make sure you set the Filename as "filename.php" and make sure the File Type menu is set to All Files and not Text Document.

You should also make sure you use full PHP tags <?php ?> and not <? ?> (this includes <?= ?> too). Short hand syntax is disabled by default. To enable this left click WAMP tray icon and choose PHP > PHP Settings > short open tag

Options: ReplyQuote
Re: Why I Just Get A Blank White Page?
Posted by: nizam (203.82.91.---)
Date: June 04, 2009 01:27AM

Thanks guys, now there are something on my screen, but it is with error. Below are my sample code, pls comment what is wrong with my code. I already unable the PHP Setting to short open tag.
<html>
<body>
<? php echo "Hello World"; ?>
</body>
</html>

I also tried to changed it to:
<html>
<body>
<? php?> echo "Hello World"; <? php?>
</body>
</html>
but still got error
My second question is, how to change my editor setting? Because, everytime now, when i change my txt file to php file, it will automatically have to be open with dreamweaver when i want to edit my php file later on. How can I change this setting? Again, thank you.

Options: ReplyQuote
Re: Why I Just Get A Blank White Page?
Posted by: yfastud (Moderator)
Date: June 04, 2009 01:51AM

Quote

<? php echo "Hello World"; ?>
take out the space b/w <? and php so it should be
Quote

<?php echo "Hello World"; ?>
then try again winking smiley
to change default text editor, right click on file you want to open and select "Open with" then browse to your desire text editor and remember to check box "Always use selected program..."

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides



Edited 1 time(s). Last edit at 06/04/2009 01:54AM by yfastud.

Options: ReplyQuote
Re: Why I Just Get A Blank White Page?
Posted by: nizam (203.82.91.---)
Date: June 04, 2009 05:41AM

Thanks guys, i managed to settled it.

Options: ReplyQuote


Sorry, only registered users may post in this forum.