FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » why php echo does not show up in HTML?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: why php echo does not show up in HTML? [message #181631 is a reply to message #181613] Fri, 24 May 2013 13:35 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 5/24/2013 4:08 AM, steve nospam wrote:
> newbie.
>
> could someone explain why this does not work?
>
> <!DOCTYPE html>
> <html>
> <body>
> <p>before
>
> <?php echo "do you see this?"; ?>
>
> <p>after
> </body>
> </html>
>
> I spend 2 hrs and tried everything and read many things, but message
> in echo does not show on the browser. I upload this to the web server.
> I also have local web server running. Both support php. I see no error
> in the access log file and no error in the php error log file. So the
> page is bring loaded OK by the web server. But I do not see the echo.
> What Ami doing wrong?
>
> cheers,
> steve
>

Look at the source in your browser. You will see the message, including
the <?php echo...

The web server will not (by default) pass pages to the PHP interpreter
unless they have a .php extension. You can include PHP code in html
code, but need to parse them as PHP.

If you're using Apache, you could change the Apache configuration to
pass all pages to the PHP interpreter, but this can cause extra load on
the server due to unnecessarily parsing non-PHP pages as PHP code. It
is also not portable and will not run on hosts where this type of
configuration is not allowed.

Your best bet is to simply change the files you need to include PHP code
in to a .php extension and fix the links on your site. For external
links, configure your web server to do a permanent redirect from the old
page to the new (see your web server configuration for more information
on how to do this).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PHP Contact Form, mt-rand(), problem Validating 1 input
Next Topic: Parsing mbox files with Windows Php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 01:43:02 GMT 2024

Total time taken to generate the page: 0.04471 seconds