New To PHP

This is a discussion on New To PHP within the PHP General forums, part of the PHP Programming Forums category; I am new to php and was trying to view the code below. I do see in my browser the ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-21-2007
Larry Chu
 
Posts: n/a
Default New To PHP

I am new to php and was trying to view the code below. I do see in my browser the question that is being asked, but for some reason the answer is not displayed. I am copying this from a book and am sure I have typed everything as it should be typed. Can you please tell mw what might be wrong?

Thank you.

<html>
<head><basefont face="Arial"></head>
<body>
<h2>Q: This Creature can change color to blend in with its surroundings.
What is its name?</h2>
<?php
// print output
echo '<h2><i>A: Chameleon</i></h2>';
?>
</body>
</html>



Reply With Quote
  #2 (permalink)  
Old 02-21-2007
Mike Shanley
 
Posts: n/a
Default Re: [PHP] New To PHP

Does your server support php? Also, some hosting services require that
any file with php in it must end with .php ... At least, those are my
two guesses...

Larry Chu wrote:
> <html>
> <head><basefont face="Arial"></head>
> <body>
> <h2>Q: This Creature can change color to blend in with its surroundings.
> What is its name?</h2>
> <?php
> // print output
> echo '<h2><i>A: Chameleon</i></h2>';
> ?>
> </body>
> </html>
>


--
Mike Shanley

~you are almost there~

"A new eye opens on March 5." -Omniversalism.com
Reply With Quote
  #3 (permalink)  
Old 02-21-2007
Haydar TUNA
 
Posts: n/a
Default Re: New To PHP

Hello,
if you test your machine support PHP, you can use the following
script. if this script properly execute, your machine can execute php
script. if not you must support PHP.:)

<?php
phpinfo();
?>


--
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

"Larry Chu" <larry.chu@sbcglobal.net>, haber iletisinde sunlari
yazdi:897661.32367.qm@web82905.mail.mud.yahoo.com. ..
>I am new to php and was trying to view the code below. I do see in my
>browser the question that is being asked, but for some reason the answer is
>not displayed. I am copying this from a book and am sure I have typed
>everything as it should be typed. Can you please tell mw what might be
>wrong?
>
> Thank you.
>
> <html>
> <head><basefont face="Arial"></head>
> <body>
> <h2>Q: This Creature can change color to blend in with its surroundings.
> What is its name?</h2>
> <?php
> // print output
> echo '<h2><i>A: Chameleon</i></h2>';
> ?>
> </body>
> </html>
>
>
>

Reply With Quote
  #4 (permalink)  
Old 02-21-2007
dhorton@iprimus.com.au
 
Posts: n/a
Default RE: [PHP] New To PHP

Are you opening the .php file directly with your browser or via a web server?
Does the web server have PHP support, and is it enabled?
(PHP is server side, not browser side).

Try creating the simple file on the webserver "phpinfo.php" containing just
-------------------------
<?php
phpinfo();
?>
-------------------------

This should look something like
http://66.225.219.162/~rvadmin/phpinfo.php
when opened via your web server.

David

>-- Original Message --
>Date: Tue, 20 Feb 2007 17:11:22 -0800 (PST)
>From: Larry Chu <larry.chu@sbcglobal.net>
>To: php-general@lists.php.net
>Subject: [php] New To PHP
>
>
>I am new to php and was trying to view the code below. I do see in my browser
>the question that is being asked, but for some reason the answer is not

displayed.
> I am copying this from a book and am sure I have typed everything as it
>should be typed. Can you please tell mw what might be wrong?
>
> Thank you.
>
> <html>
><head><basefont face="Arial"></head>
><body>
><h2>Q: This Creature can change color to blend in with its surroundings.
>What is its name?</h2>
> <?php
>// print output
>echo '<h2><i>A: Chameleon</i></h2>';
>?>
> </body>
></html>
>
>

Reply With Quote
  #5 (permalink)  
Old 02-23-2007
Richard Lynch
 
Posts: n/a
Default Re: [PHP] New To PHP

On Tue, February 20, 2007 7:11 pm, Larry Chu wrote:
> I am new to php and was trying to view the code below. I do see in my
> browser the question that is being asked, but for some reason the
> answer is not displayed. I am copying this from a book and am sure I
> have typed everything as it should be typed. Can you please tell mw
> what might be wrong?
>
> Thank you.
>
> <html>
> <head><basefont face="Arial"></head>
> <body>
> <h2>Q: This Creature can change color to blend in with its
> surroundings.
> What is its name?</h2>
> <?php
> // print output
> echo '<h2><i>A: Chameleon</i></h2>';
> ?>
> </body>
> </html>


If you do "View Source" in your browser, do you see the <?php bit?
If so, then you have not installed PHP correctly.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:59 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0