cmazur Posted November 2, 2006 Share Posted November 2, 2006 First off, Today is the first day that I've ever touched PHP. Because of thisour professor gave us an easy assignment. Unfortunately, this easyassignment is drivin' me insane.I don't understand why this doesn't work!Why do I not get any output to the screen when I try to open this page?I have this document posted on a server. If I'm not mistaking, the PHPshould 'create' the HTML code and thus show the simple statement:"Welcome to my home page"Here is my code:[code]<?xml version = "1.0" encoding = "utf-8"?><!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1 //EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>Simple Welcome</title> </head> <body> <?php print "Welcome to my home page <br />"; ?> </body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/ Share on other sites More sharing options...
cmgmyr Posted November 2, 2006 Share Posted November 2, 2006 How about just this:[code]<!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1 //EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><head><title>Simple Welcome</title></head><body><?php print "Welcome to my home page <br />"; ?></body></html>[/code]-Chris Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118661 Share on other sites More sharing options...
realjumper Posted November 2, 2006 Share Posted November 2, 2006 Your code works fine on my server Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118662 Share on other sites More sharing options...
cmazur Posted November 2, 2006 Author Share Posted November 2, 2006 realjumper,I thought the code looked good. I Just didn't know if I was missing something with the syntax or not.This is weird that I am getting a blank screen on the server that the file is onon campus. Where as all of the professor's example files are working fine. Any other thoughts? I am still waiting to hear back from the professor about why this isn't workingon the class's server.Thanks for your help nevertheless. Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118670 Share on other sites More sharing options...
realjumper Posted November 2, 2006 Share Posted November 2, 2006 You are saving your file as a '.php' file aren't you? (my_file.php) Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118677 Share on other sites More sharing options...
cmazur Posted November 2, 2006 Author Share Posted November 2, 2006 Yes. My file is saved as a PHP file. Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118679 Share on other sites More sharing options...
realjumper Posted November 2, 2006 Share Posted November 2, 2006 Okay, then I would hazard a guess and say that it is a file permission issue....which will have to be resolved by your prof seeing as he (I guess) administers your server Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118682 Share on other sites More sharing options...
cmazur Posted November 2, 2006 Author Share Posted November 2, 2006 Yeah, That's what I'm thinking. Too bad I can't get ahold of the guy at all! Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118692 Share on other sites More sharing options...
realjumper Posted November 2, 2006 Share Posted November 2, 2006 Open a free account at Tripod or some other free php host...then you can prove your point to the prof!! Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118703 Share on other sites More sharing options...
cmazur Posted November 2, 2006 Author Share Posted November 2, 2006 I don't eve know of any free php host servers. tripod.com? Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118708 Share on other sites More sharing options...
realjumper Posted November 2, 2006 Share Posted November 2, 2006 Just google for 'free php hosting' Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118734 Share on other sites More sharing options...
Caesar Posted November 2, 2006 Share Posted November 2, 2006 Create a new PHP file and call it "info.php". Throw the following code in there and then call it form your browser:[code]<?php phpinfo();?>[/code]Then come back and let us know if all is well. Also...a blank page leads me to believe there is an error in your page. Check the info page and check the value for "display_errors". Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118738 Share on other sites More sharing options...
cmazur Posted November 2, 2006 Author Share Posted November 2, 2006 Still getting a blank page. I think it's the server I'm using. realjumper said he tried my code on his server and it worked. I'm confused. Gotta love the dependabillity of college professors.. haha Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118746 Share on other sites More sharing options...
Caesar Posted November 2, 2006 Share Posted November 2, 2006 Nothing is being output when you have a page only using the phpinfo() function? Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118765 Share on other sites More sharing options...
JustinK101 Posted November 2, 2006 Share Posted November 2, 2006 My guess the extensions (.php, .php3) are not registered with apache and therefore not invoking the php engine. Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118772 Share on other sites More sharing options...
cmazur Posted November 3, 2006 Author Share Posted November 3, 2006 Can somebody send me a simple PHP file as an attachment so I can try to run it on my course's server.This is the only way for me to find out if it is me, or the server that is having the problem.my email is pcredskin7@yahoo.comThanks guys... Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118811 Share on other sites More sharing options...
realjumper Posted November 3, 2006 Share Posted November 3, 2006 Save this as test.php[code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"><html> <head> <title></title> </head> <body> <?php echo "Yippee"; ?> </body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118868 Share on other sites More sharing options...
doni49 Posted November 3, 2006 Share Posted November 3, 2006 [quote author=JustinK101 link=topic=113652.msg462052#msg462052 date=1162508788]My guess the extensions (.php, .php3) are not registered with apache and therefore not invoking the php engine.[/quote]But if I'm not mistaken, if the php extension isn't registered with apache, then the code in the php file will be displayed to the browser instead of running the code and sending it's results to the browswer. Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118894 Share on other sites More sharing options...
cmazur Posted November 3, 2006 Author Share Posted November 3, 2006 realjumperthat worked.the only thing that i can think of is that it doesn't like the xhtml headings..[code]<?xml version = "1.0" encoding = "utf-8"?><!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1 //EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns = "http://www.w3.org/1999/xhtml">[/code]That's the only difference between our codes.Any ideas why the heading I was trying to use wasn't working? Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118908 Share on other sites More sharing options...
realjumper Posted November 3, 2006 Share Posted November 3, 2006 Using this....[code]<?xml version="1.0" encoding="ISO-8859-1"?>[/code]is the default for an xml document. I suspect the 2 question marks are causing the problem on your server.This is what I usually use for a php file....[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">[/code]Try removing your first line.....[code]<?xml version = "1.0" encoding = "utf-8"?>[/code]....and see what happens :) Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118913 Share on other sites More sharing options...
cmazur Posted November 3, 2006 Author Share Posted November 3, 2006 yup, thanks... that seems to work Quote Link to comment https://forums.phpfreaks.com/topic/25980-this-should-be-really-simple/#findComment-118994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.