Re: Beginner question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well, as I said: Beginner ...

I am actually trying to implement some html code that I found on the web, which uses php (see: http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm). They use the method I tried to call a function php and then display a "photo album". Well, that doesn't work. I am just getting a blank page when I follow their instructions. So I thought I try to follow the trail and see where it ends. But how do I do that? I was attempting to do so with the script that I posted, but apparently that doesn't work. So, how do I find out why my installation does not process the html code that I have posted a link to above? How would I implement that on my web site?

Thanks.

"Ashley Sheridan" <ash@xxxxxxxxxxxxxxxxxxxx> wrote in message news:1251211648.2799.46.camel@xxxxxxxxxxxx
On Mon, 2009-08-24 at 23:16 -0600, mike bode wrote:
I am trying to use PHP on my web site I am developing now. I have installed Apache 2.2 and PHP 5.2. My problem is that I can execute PHP code embedded
in my HTML code, but I can't execute the same cose when I put it into a
separate .php file that i then call from within the html code. for example:

I have a html file with

<body>
<?php
echo "Printing with php";
?>
<?body>

and it works fine.

When I take out the php code and put it inot a file pp.php, and I call that
file with my browser ("localhost/pp.php"), it works, too.

But when I change the html code to:

<body>
<script type="text/javascript" src="pp.php"></script>
</body>

I get a blank page. this is probably something really stupid, but I have
been wrecking my head for days now, and I can't figure it out. anybody has
an idea?


Yes, this is not how you use PHP! PHP isn't embedded in HTML, it's
actually the other way round.

You should make the main page a .php page and from there you can include
the necessary HTML parts like so:

<?php
include "includes/header.html";

// body code here

include "includes/footer.html";
?>

Thanks,
Ash
http://www.ashleysheridan.co.uk





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux