Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 Coding error or bad installation?
Google
Post new topic Reply to topic
Author Message
ksimmons
 
 


Joined: 08 Oct 2006
Posts: 4

PostPosted: Sun Oct 08, 2006 3:29 pm Reply with quoteBack to top

I'm new to PHP and did a default installation on Windows XP and everything seems to be running.

The book I'm using to learn PHP instructs the reader to use the following code as index.html

Code:

<HTML>
   <HEAD>
      <TITLE>PHP Testing</TITLE>
   </HEAD>
   <BODY>
      <?php
         echo “If this works, we <i>really</i> did it!”;
      ?>
   </BODY>
</HTML>


When I go to localhost in my web browser I get this:

Quote:
really did it!”; ?>


Is there an error in the book's text or is this an installation problem?

Thanks.
View user's profileSend private message
Vlad Alexa Mancini
lead developer
lead developer


Joined: 07 Jul 2003
Posts: 1539

PostPosted: Mon Oct 09, 2006 7:30 am Reply with quoteBack to top

.html files are not usually parsed with php , and apache2triad setup makes no exception.
View user's profileSend private message
ksimmons
 
 


Joined: 08 Oct 2006
Posts: 4

PostPosted: Tue Oct 10, 2006 12:47 am Reply with quoteBack to top

Vlad Alexa Mancini wrote:
.html files are not usually parsed with php , and apache2triad setup makes no exception.


Well, as I said, I was following directions in a book about PHP

Does your answer mean that the code is correct?
View user's profileSend private message
Joshua Meadows (DemoRic)
support
support


Joined: 29 Dec 2004
Posts: 783
Location: S.E. Kansas

PostPosted: Tue Oct 10, 2006 2:45 am Reply with quoteBack to top

Quote:
Does your answer mean that the code is correct?
Code:
<HTML>
   <HEAD>
      <TITLE>PHP Testing</TITLE>
   </HEAD>
   <BODY>
      <?php
         echo "If this works, we <i>really</i> did it!";
      ?>
   </BODY>
</HTML>


Save it with a .php extension and place it in your htdocs folder.
Then access it by
http://localhost/yourFilename.php
You should be pleased with the answer to your question.
View user's profileSend private messageYahoo MessengerICQ Number
ksimmons
 
 


Joined: 08 Oct 2006
Posts: 4

PostPosted: Tue Oct 10, 2006 10:32 am Reply with quoteBack to top

Quote:
Save it with a .php extension and place it in your htdocs folder.
Then access it by
http://localhost/yourFilename.php
You should be pleased with the answer to your question.


Now I get a blank page.
View user's profileSend private message
Joshua Meadows (DemoRic)
support
support


Joined: 29 Dec 2004
Posts: 783
Location: S.E. Kansas

PostPosted: Wed Oct 11, 2006 11:21 pm Reply with quoteBack to top

Code:
echo "If this works, we <i>really</i> did it!";

Your quotation marks aren't correct. Use that line instead.
Note: it's best to use notepad, or a similiar plain text editor for coding. I like EditPlus http://www.editplus.com/ but there are many out there.

To find out where your error may be see your error logs, or you can enable error reporting.

http://apache2triad.net/forums/viewtopic.php?t=4611&highlight=display+php+errors
touches on it.
View user's profileSend private messageYahoo MessengerICQ Number
ksimmons
 
 


Joined: 08 Oct 2006
Posts: 4

PostPosted: Thu Oct 12, 2006 12:37 am Reply with quoteBack to top

Quote:
To find out where your error may be see your error logs, or you can enable error reporting.


http://apache2triad.net/forums/viewtopic.php?t=4611&highlight=display+php+errors
touches on it.[/quote]

I get this error:

Quote:
PHP Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\apache2triad\htdocs\index.php on line 7


As you can see from my previous messages, I ended line seven with a semicolon
View user's profileSend private message
Vlad Alexa Mancini
lead developer
lead developer


Joined: 07 Jul 2003
Posts: 1539

PostPosted: Thu Oct 12, 2006 5:58 pm Reply with quoteBack to top

joshua allready told you about the quotation
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT