From: "Col Day" on
Hi all,

After my escapades with the real basics and realizing my laptop wasn't
logged on as Administrator, I now am trying to work out why this script
works sometimes but not others.

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<?php
echo "<p>This is a PHP line</p>";
phpinfo();
?>
</body>
</html>

If I save this as phptest.php and open IE pointing it to
localhost/phptest.php it works fine. Get both lines of text followed by the
pages of gumpf about php.

However if I paste this into a


From: "Col Day" on

""Col Day"" <colinday3(a)aol.com> wrote in message
news:23.81.45586.2820BAC4(a)pb1.pair.com...
> Hi all,
>
> After my escapades with the real basics and realizing my laptop wasn't
> logged on as Administrator, I now am trying to work out why this script
> works sometimes but not others.
>
> <html>
> <head>
> <title>PHP Test</title>
> </head>
> <body>
> <p>This is an HTML line
> <?php
> echo "<p>This is a PHP line</p>";
> phpinfo();
> ?>
> </body>
> </html>
>
> If I save this as phptest.php and open IE pointing it to
> localhost/phptest.php it works fine. Get both lines of text followed by
> the pages of gumpf about php.
>
> However if I paste this into a
>
>

That was weird!

I was saying, If I paste this into a webpage I only get the "HTML" line as
before.

Anyone have any ideas?

PHP is obviously working as is apache. Just don't understand why they don't
show up in web pages.

Cheers again all!

From: Shreyas Agasthya on
Col,

Can you let us know what exactly you see when you say
http://localhost:/phptest.php
?


Regards,
Shreyas

On Tue, Oct 5, 2010 at 4:20 PM, Col Day <colinday3(a)aol.com> wrote:

>
> ""Col Day"" <colinday3(a)aol.com> wrote in message
> news:23.81.45586.2820BAC4(a)pb1.pair.com...
>
> Hi all,
>>
>> After my escapades with the real basics and realizing my laptop wasn't
>> logged on as Administrator, I now am trying to work out why this script
>> works sometimes but not others.
>>
>> <html>
>> <head>
>> <title>PHP Test</title>
>> </head>
>> <body>
>> <p>This is an HTML line
>> <?php
>> echo "<p>This is a PHP line</p>";
>> phpinfo();
>> ?>
>> </body>
>> </html>
>>
>> If I save this as phptest.php and open IE pointing it to
>> localhost/phptest.php it works fine. Get both lines of text followed by the
>> pages of gumpf about php.
>>
>> However if I paste this into a
>>
>>
>>
> That was weird!
>
> I was saying, If I paste this into a webpage I only get the "HTML" line as
> before.
>
> Anyone have any ideas?
>
> PHP is obviously working as is apache. Just don't understand why they don't
> show up in web pages.
>
> Cheers again all!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Regards,
Shreyas Agasthya
From: "Col Day" on
Hi Shreyas,

Ok, as far as I can tell the script should show "This is an HTML line"
reflecting that I am seeing the HTML part of the script followed by "This is
a PHP line" to show that PHP is installed and working fine.

If I view the script directly in IE by going to http://localhost/phptest.php
I get the output:

This is an HTML line

This is a PHP line

followed by a large and detailed list of the PHP install which includes
things like compiler language etc.

If I paste the script into a web page then all that is displayed is

This is an HTML line.

Nothing else whatsoever.

I am fairly confused. I've tried a couple of different web page creators
(Webplus 10 and Web page maker) and get the same result.

Sorry if I sound extremely naive but it's bugging me now and I want to
understand.

Cheers

"Shreyas Agasthya" <shreyasbr(a)gmail.com> wrote in message
news:AANLkTi=4ke1sTf8TaN7+EcJO-UX5CJ=t9-0qcTCFkx0+(a)mail.gmail.com...
> Col,
>
> Can you let us know what exactly you see when you say
> http://localhost:/phptest.php
> ?
>
>
> Regards,
> Shreyas
>
> On Tue, Oct 5, 2010 at 4:20 PM, Col Day <colinday3(a)aol.com> wrote:
>
>>
>> ""Col Day"" <colinday3(a)aol.com> wrote in message
>> news:23.81.45586.2820BAC4(a)pb1.pair.com...
>>
>> Hi all,
>>>
>>> After my escapades with the real basics and realizing my laptop wasn't
>>> logged on as Administrator, I now am trying to work out why this script
>>> works sometimes but not others.
>>>
>>> <html>
>>> <head>
>>> <title>PHP Test</title>
>>> </head>
>>> <body>
>>> <p>This is an HTML line
>>> <?php
>>> echo "<p>This is a PHP line</p>";
>>> phpinfo();
>>> ?>
>>> </body>
>>> </html>
>>>
>>> If I save this as phptest.php and open IE pointing it to
>>> localhost/phptest.php it works fine. Get both lines of text followed by
>>> the
>>> pages of gumpf about php.
>>>
>>> However if I paste this into a
>>>
>>>
>>>
>> That was weird!
>>
>> I was saying, If I paste this into a webpage I only get the "HTML" line
>> as
>> before.
>>
>> Anyone have any ideas?
>>
>> PHP is obviously working as is apache. Just don't understand why they
>> don't
>> show up in web pages.
>>
>> Cheers again all!
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> Regards,
> Shreyas Agasthya
>

From: "Col Day" on
LOL!

This is WITH xammp!!



"Gary" <php-general(a)garydjones.name> wrote in message
news:i8f26m$j4r$2(a)dough.gmane.org...
> Col Day wrote:
>> ""Col Day"" <colinday3(a)aol.com> wrote in message
>> news:23.81.45586.2820BAC4(a)pb1.pair.com...
>>> <html>
>>> <head>
>>> <title>PHP Test</title>
>>> </head>
>>> <body>
>>> <p>This is an HTML line
> </p> <!-- close your tag, you evil man! :-) -->
>>> <?php
>>> echo "<p>This is a PHP line</p>";
>>> phpinfo();
>>> ?>
>>> </body>
>>> </html>
>
>> If I paste this into a webpage I only get the "HTML" line as before.
>
> What do you mean, "webpage"? foo.php, for example, or foo.html? If the
> latter then I am guessing your Apache will serve the page purely as
> html, and it will never be processed by php. If the former then check
> that Apache is configured to run php files through php before serving
> them (must admit, I'm not sure how to do that, it depends on your Apache
> and PHP). Or, really, just install xampp, it's by far the easiest way
> and will avoid all the problems associated with configuring two rather
> complex pieces of software.
>