Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,690 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,322 people online right now. Registration is fast and FREE... Join Now!




Php Blank page on Load ?

2 Pages V  1 2 >  
Reply to this topicStart new topic

Php Blank page on Load ?, When I try to load my page in any web browser it comes up blank !

x-lil-monroe-x
post 26 May, 2008 - 02:04 AM
Post #1


New D.I.C Head

*
Joined: 16 Mar, 2008
Posts: 10

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php
echo "Hello World";
?>

</body>
</html>



Ive just started in php, and the first prt did the echo command the problem is when I load the page [World icon --> Preview in IExplore/Firefox] is comes up a blank. Ive tried everything i can think of. If you could get back to me ASAP it'd be great. Tx
User is offlineProfile CardPM

Go to the top of the page

joeyadms
post 26 May, 2008 - 02:11 AM
Post #2


D.I.C Head

Group Icon
Joined: 4 May, 2008
Posts: 145



Thanked 6 times

Dream Kudos: 600

Expert In: PHP, Web Security

My Contributions


What does it look like when you view the source. What I am thinking is your http server is not setup to parse php. The AddTypes are not added.

If it is saved as .html, try changing extension to .php and see if it works, a lot of installers will register .php as a application, but not .html
User is offlineProfile CardPM

Go to the top of the page

x-lil-monroe-x
post 26 May, 2008 - 04:56 AM
Post #3


New D.I.C Head

*
Joined: 16 Mar, 2008
Posts: 10

Ok.
Ive tried that. The screen is blank when I view it as Html. When I renamed it and converted it into php.. the 'save file dialog' came up. Asking me to save my File !
User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 26 May, 2008 - 08:34 AM
Post #4


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 474



Thanked 21 times

Dream Kudos: 350
My Contributions


that means that PHP is not running on your computer...

as to how to get PHP on the comp, idk, as I use a web server directly...
User is offlineProfile CardPM

Go to the top of the page

2457
post 26 May, 2008 - 10:09 AM
Post #5


D.I.C Head

**
Joined: 9 Apr, 2008
Posts: 72

use WAMP.
It can setup apache, mysql, and php on Yours windows computer.
20 megabytes.
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 26 May, 2008 - 02:43 PM
Post #6


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 596



Thanked 22 times

Dream Kudos: 750
My Contributions


QUOTE(2457 @ 26 May, 2008 - 11:09 AM) *

use WAMP.
It can setup apache, mysql, and php on Yours windows computer.
20 megabytes.


Also, when using WAMP it does not setup short tags by default. if you want to use <? ?> instead of <?php ?> you'll need to turn short_open_tag = 'On' in your php.ini file. Otherwise you'll just run into the same problem you're having now.

User is offlineProfile CardPM

Go to the top of the page

x-lil-monroe-x
post 26 May, 2008 - 03:16 PM
Post #7


New D.I.C Head

*
Joined: 16 Mar, 2008
Posts: 10

I use <?php ?> anyway .. Thanks guys the wamp thing shud solve it i have installed PHP before but it didnt work properly, and i was using IIS for a server.. no MYSQL was installed.


--- Still No change =(|

This post has been edited by x-lil-monroe-x: 26 May, 2008 - 03:51 PM
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 26 May, 2008 - 03:30 PM
Post #8


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 596



Thanked 22 times

Dream Kudos: 750
My Contributions


QUOTE(x-lil-monroe-x @ 26 May, 2008 - 04:16 PM) *

I use <?php ?> anyway .. Thanks guys the wamp thing shud solve it i have installed PHP before but it didnt work properly, and i was using IIS for a server.. no MYSQL was installed.


No problems. Most people will use <?php ?>, but you may end up wanting to use <?= ?> to just echo out a variable. In that case you'll need short_open_tag = 'On'. You might want to turn it on just to alleviate future pains. Glad you're getting everything fixed.

User is offlineProfile CardPM

Go to the top of the page

JBrace1990
post 26 May, 2008 - 04:22 PM
Post #9


D.I.C Regular

Group Icon
Joined: 9 Mar, 2008
Posts: 474



Thanked 21 times

Dream Kudos: 350
My Contributions


i would suggest getting rid of all of the HTML and seeing if it works then.... the PHP statement is correct....
User is offlineProfile CardPM

Go to the top of the page

joeyadms
post 26 May, 2008 - 06:10 PM
Post #10


D.I.C Head

Group Icon
Joined: 4 May, 2008
Posts: 145



Thanked 6 times

Dream Kudos: 600

Expert In: PHP, Web Security

My Contributions


If it is asking you to download the php file, this means '.php' is not setup correctly in your configuration. If you use apache, add this to your httpd.conf
CODE

AddType application/x-httpd-php .php .html


If you are using IIS, then google a guide for installing php on iis, you have to set iis to use the php interpreter for php files.

Also, I find that the Zend Core install is very efficient for dev setups on local machines.

Also a little sample code that can distinguish between php issue vs server issue is the following

CODE

Hello <?php echo "World"; ?>


If only hello shows up, its a php issue, if hello world shows up, you have a successful php install.
User is offlineProfile CardPM

Go to the top of the page

x-lil-monroe-x
post 27 May, 2008 - 11:56 AM
Post #11


New D.I.C Head

*
Joined: 16 Mar, 2008
Posts: 10

Its still asking me to download it.. Both ways. So i cant check if youre theory is correct joeyadms
User is offlineProfile CardPM

Go to the top of the page

joeyadms
post 28 May, 2008 - 03:31 PM
Post #12


D.I.C Head

Group Icon
Joined: 4 May, 2008
Posts: 145



Thanked 6 times

Dream Kudos: 600

Expert In: PHP, Web Security

My Contributions


if it is asking you to download it, either way, it is because of your configuration.

You need to add the the AddType declaration, to have it parse php files, and not treat them as binary.
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:42AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month