Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PHP in html

 
Goto page 1, 2
   Database Forums (Home) -> PHP RSS
Next:  creatin a trigger  
Author Message
John

External


Since: Nov 07, 2006
Posts: 3



(Msg. 1) Posted: Thu Jul 26, 2007 10:10 pm
Post subject: PHP in html
Archived from groups: comp>lang>php (more info?)

Hello,


I have a php include command in my website and the script shows up.


However, I need for the script to show up on the right side of page
(there is enough room there)... but for some reason it shows up at the
bottom. I placed the include command in the correct part of my html
file. Is there any way to give some sort of command on where you want
it to show up on the webpage?

 >> Stay informed about: PHP in html 
Back to top
Login to vote
vilain1

External


Since: Dec 17, 2004
Posts: 27



(Msg. 2) Posted: Thu Jul 26, 2007 11:32 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived

 >> Stay informed about: PHP in html 
Back to top
Login to vote
Captain Paralytic

External


Since: Jun 18, 2007
Posts: 57



(Msg. 3) Posted: Fri Jul 27, 2007 2:02 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 27 Jul, 06:10, John wrote:
> Hello,
>
> I have a php include command in my website and the script shows up.
>
> However, I need for the script to show up on the right side of page
> (there is enough room there)... but for some reason it shows up at the
> bottom. I placed the include command in the correct part of my html
> file. Is there any way to give some sort of command on where you want
> it to show up on the webpage?

A php include has to go in a php file.

HTML includes are normally done using SSI.

If you are using HTL includes then you are asking in totally the wrong
place.
 >> Stay informed about: PHP in html 
Back to top
Login to vote
FFMG

External


Since: Jul 27, 2007
Posts: 1



(Msg. 4) Posted: Fri Jul 27, 2007 2:33 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John;83532 Wrote:
> Hello,
>
>
> I have a php include command in my website and the script shows up.
>
>
> However, I need for the script to show up on the right side of page
> (there is enough room there)... but for some reason it shows up at the
> bottom. I placed the include command in the correct part of my html
> file. Is there any way to give some sort of command on where you want
> it to show up on the webpage?

I don't think it has anything to do with PHP really.
It probably has more to do with the HTML/CSS code.

But without seeing any code it is impossible to even guess what the
problem could be.

You will need to post the code, (HTML not the PHP), so we can tell as
to why the display is the way it is.

FFMG


--

'webmaster forum' (http://www.httppoint.com) | 'webmaster Directory'
(http://www.webhostshunter.com/) | 'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php)
'Free URL redirection service' (http://urlkick.com/)
------------------------------------------------------------------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=18816

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Michael Fesser

External


Since: Mar 01, 2006
Posts: 315



(Msg. 5) Posted: Fri Jul 27, 2007 3:56 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

..oO(John)

>I have a php include command in my website and the script shows up.
>
>However, I need for the script to show up on the right side of page
>(there is enough room there)... but for some reason it shows up at the
>bottom. I placed the include command in the correct part of my html
>file. Is there any way to give some sort of command on where you want
>it to show up on the webpage?

Sure, but that's a HTML/CSS issue and has nothing to do with PHP itself.

Micha
 >> Stay informed about: PHP in html 
Back to top
Login to vote
John

External


Since: Nov 07, 2006
Posts: 3



(Msg. 6) Posted: Fri Jul 27, 2007 7:58 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 27 Jul 2007 02:02:52 -0700, Captain Paralytic
wrote:

>
>A php include has to go in a php file.
>
>HTML includes are normally done using SSI.
>
>If you are using HTL includes then you are asking in totally the wrong
>place.



That is incorrect.


You can have php includes in a html file.
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Captain Paralytic

External


Since: Jun 18, 2007
Posts: 57



(Msg. 7) Posted: Fri Jul 27, 2007 8:15 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 27 Jul, 15:58, John wrote:
> On Fri, 27 Jul 2007 02:02:52 -0700, Captain Paralytic
>
> wrote:
>
> >A php include has to go in a php file.
>
> >HTML includes are normally done using SSI.
>
> >If you are using HTL includes then you are asking in totally the wrong
> >place.
>
> That is incorrect.
>
> You can have php includes in a html file.

How does that work?

a php include must be in a file that will be interpreted by the php
interpreter. The file extension may be .HTML, but the file will be a
php file by virtue of having the include() within php tags and the web
server will have been told that this type of file is a php file.

A php include() within a file that contains pure html and no php tags
will AFAIAA not do anything.
 >> Stay informed about: PHP in html 
Back to top
Login to vote
belial

External


Since: Dec 17, 2004
Posts: 3



(Msg. 8) Posted: Fri Jul 27, 2007 12:58 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Anonymous479

External


Since: Oct 06, 2004
Posts: 11



(Msg. 9) Posted: Fri Jul 27, 2007 12:58 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

John wrote:
> >A php include has to go in a php file.
> >
> >HTML includes are normally done using SSI.
> >
> >If you are using HTL includes then you are asking in totally the wrong
> >place.
>
> That is incorrect.
>
> You can have php includes in a html file.

In theory, yes. In practice, no. Because most webservers are not
configured to parse a .html file through PHP.

If the filename does not end in .php (.php5 or other widely accepted
extension which denotes a PHP file) it won't be parsed and the PHP
include won't get executed.

Sure, if you have total control of the webserver you can tell it to
parse every file through PHP but this is considered bad practice as it
will slow down the server.

Bye!
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Matt S

External


Since: Jul 27, 2007
Posts: 1



(Msg. 10) Posted: Fri Jul 27, 2007 7:58 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Captain Paralytic wrote:

> On 27 Jul, 15:58, John wrote:
>> On Fri, 27 Jul 2007 02:02:52 -0700, Captain Paralytic
>>
>> wrote:
>>
>> >A php include has to go in a php file.
>>
>> >HTML includes are normally done using SSI.
>>
>> >If you are using HTL includes then you are asking in totally the wrong
>> >place.
>>
>> That is incorrect.
>>
>> You can have php includes in a html file.
>
> How does that work?
AddType application/x-httpd-php .html
For Apache of course. You just force the MIME type of .html files to be PHP
files. If you're using an executable directory so to say (+ExecCGI), you
could just put #!/usr/bin/env php at the top and it would be treated as a
PHP file regardless of file extension.
--
'Yes, firefox is indeed greater than women. Can women block pops up for you?
No. Can Firefox show you naked women? Yes.'
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Michael Fesser

External


Since: Mar 01, 2006
Posts: 315



(Msg. 11) Posted: Mon Jul 30, 2007 11:58 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

..oO(Jerry Stuckle)

>Michael Fesser wrote:
>>
>> * using .htaccess you can enable that on a per-directory basis
>
>So? It's still a waste of resources.

Like storing images in a database for example. Who's wasting resources
then?

>> * if you're using PHP for more than just a form on a single page, then
>> it doesn't matter, because all pages have to be parsed anyway
>
>Only if they contain php code.

As said, "if you're using PHP for more than just a form on a single
page", then it's very likely that all pages contain PHP code, even if
it's just an include of a menu bar script.

>> * the file extension .html (or no extension at all) is preferred for
>> stable URIs
>
>That's your opinion, anyway.

Not only mine. It's also the W3C's opinion.

Micha
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Jerry Stuckle

External


Since: Aug 11, 2004
Posts: 1367



(Msg. 12) Posted: Mon Jul 30, 2007 1:25 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Michael Fesser wrote:
> .oO(Jerry Stuckle)
>
>> Michael Fesser wrote:
>>> * using .htaccess you can enable that on a per-directory basis
>> So? It's still a waste of resources.
>
> Like storing images in a database for example. Who's wasting resources
> then?
>

Not at all. Databases are quite efficient at retrieving data -
including images.

>>> * if you're using PHP for more than just a form on a single page, then
>>> it doesn't matter, because all pages have to be parsed anyway
>> Only if they contain php code.
>
> As said, "if you're using PHP for more than just a form on a single
> page", then it's very likely that all pages contain PHP code, even if
> it's just an include of a menu bar script.
>

Nope. Not at all. I have several sites with some pages which have no
PHP in them at all. And if they have a menu bar script, they're
included with SSI.

>>> * the file extension .html (or no extension at all) is preferred for
>>> stable URIs
>> That's your opinion, anyway.
>
> Not only mine. It's also the W3C's opinion.
>
> Micha

Exactly where do they say that? And where do they say they've taken
over programming and support for Apache, IIS, and other web servers?


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex.RemoveThis@attglobal.net
==================
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Michael Fesser

External


Since: Mar 01, 2006
Posts: 315



(Msg. 13) Posted: Mon Jul 30, 2007 8:44 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

..oO(Jerry Stuckle)

>Michael Fesser wrote:
>> .oO(Jerry Stuckle)
>>
>>> Michael Fesser wrote:
>>>> * using .htaccess you can enable that on a per-directory basis
>>> So? It's still a waste of resources.
>>
>> Like storing images in a database for example. Who's wasting resources
>> then?
>
>Not at all. Databases are quite efficient at retrieving data -
>including images.

You missed my point here. Consider a script-generated page with 20
statically linked images and a static HTML page with 20 images retrieved
from a database. To be viewed in a browser the first page requires just
a single script call, while the second requires 20(!) script calls in
order to fetch all images from the DB.

>> As said, "if you're using PHP for more than just a form on a single
>> page", then it's very likely that all pages contain PHP code, even if
>> it's just an include of a menu bar script.
>
>Nope. Not at all. I have several sites with some pages which have no
>PHP in them at all. And if they have a menu bar script, they're
>included with SSI.

But using SSI on all pages also wastes resources compared to plain
static files ...

>>>> * the file extension .html (or no extension at all) is preferred for
>>>> stable URIs
>>> That's your opinion, anyway.
>>
>> Not only mine. It's also the W3C's opinion.
>
>Exactly where do they say that?

Cool URIs don't change
http://www.w3.org/Provider/Style/URI

| What to leave out
| [...]
| * File name extension.
| * Software mechanisms.

Micha
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Jerry Stuckle

External


Since: Aug 11, 2004
Posts: 1367



(Msg. 14) Posted: Mon Jul 30, 2007 8:44 pm
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Michael Fesser wrote:
> .oO(Jerry Stuckle)
>
>> Michael Fesser wrote:
>>> .oO(Jerry Stuckle)
>>>
>>>> Michael Fesser wrote:
>>>>> * using .htaccess you can enable that on a per-directory basis
>>>> So? It's still a waste of resources.
>>> Like storing images in a database for example. Who's wasting resources
>>> then?
>> Not at all. Databases are quite efficient at retrieving data -
>> including images.
>
> You missed my point here. Consider a script-generated page with 20
> statically linked images and a static HTML page with 20 images retrieved
> from a database. To be viewed in a browser the first page requires just
> a single script call, while the second requires 20(!) script calls in
> order to fetch all images from the DB.
>

First of all, if it's script-generated, it's not static, is it?

Of course, you conveniently ignore the fact those 20 images require 20
additional calls to the server, anyway. The script will already be in
memory (if nothing else, the OS cache will have it), and the overhead of
interpreting it isn't very bad at all. And it beats trying to keep
track of thousands (or tens of thousands) of files on the disk.

>>> As said, "if you're using PHP for more than just a form on a single
>>> page", then it's very likely that all pages contain PHP code, even if
>>> it's just an include of a menu bar script.
>> Nope. Not at all. I have several sites with some pages which have no
>> PHP in them at all. And if they have a menu bar script, they're
>> included with SSI.
>
> But using SSI on all pages also wastes resources compared to plain
> static files ...
>

Not nearly as much as PHP. But I didn't say I used SSI on all pages,
either, did I?

>>>>> * the file extension .html (or no extension at all) is preferred for
>>>>> stable URIs
>>>> That's your opinion, anyway.
>>> Not only mine. It's also the W3C's opinion.
>> Exactly where do they say that?
>
> Cool URIs don't change
> http://www.w3.org/Provider/Style/URI
>
> | What to leave out
> | [...]
> | * File name extension.
> | * Software mechanisms.
>
> Micha

They say URI's don't change. They don't say to interpret every page as PHP.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex RemoveThis @attglobal.net
==================
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Michael Fesser

External


Since: Mar 01, 2006
Posts: 315



(Msg. 15) Posted: Tue Jul 31, 2007 5:56 am
Post subject: Re: PHP in html [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

..oO(Jerry Stuckle)

>Of course, you conveniently ignore the fact those 20 images require 20
>additional calls to the server, anyway.

Doesn't matter here. 20 requests are 20 requests, but it makes a big
difference if the server can deliver them statically as-is or if it has
to invoke a script handler for every single image.

>The script will already be in
>memory (if nothing else, the OS cache will have it),

Page-generating scripts can be cached as well, dependent on the
configuration of the webserver and the PHP interpreter.

>and the overhead of
>interpreting it isn't very bad at all.

So you want to tell me that a simple page-generating script wastes more
resources then a script that has to

* open a connection to a database
* query the DB (requires to analyze and optimize the query)
* transfer binary data from the DB into the script
* close the connection
* transfer the data to the webserver

?

> And it beats trying to keep
>track of thousands (or tens of thousands) of files on the disk.

Doesn't matter here. We were talking about performance and "wasting a
hell of a lot" resources. If you think interpreting all pages as PHP
wastes that many resources, but fetching images from the DB does not,
then there must be something really wrong ...

>Not nearly as much as PHP.

Depends on the server configuration I would say. SSI requires a parser/
interpreter as well. And PHP running as a server module is quite fast.
The work that has to be done by the parsers is quite the same - they
just look for special directives in the HTML code.

>But I didn't say I used SSI on all pages,
>either, did I?

Well, using SSI for a menu indicates that.

>They say URI's don't change. They don't say to interpret every page as PHP.

Again: This wasn't the point here. We were talking about leaving out
file extensions from a URL.

Micha
 >> Stay informed about: PHP in html 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
<<<HTML - Let us say I have lots of html-code I want to print.... surrounded by php code. I learned once that I could do like this: <?php $name = empty($_POST['name'] ? "" : $_POST['name']; print <<<HTML <form method="post" act...

PHP/HTML - Hope there is someone out there how can help me. I got a small problem, as you will properly see i'm a newbi. I'm running php 5.1.2 and apacheserver 2.0.55 on a winxp installation. The following code is not displaying anything in the browser: <?php...

HTML email using PHP - Hello How do i send a HTML email using PHP. I have tried loads of examples and they are not working. last example was <?php $to = blabla@bla.net; $subject = 'Wakeup bob!'; $message = '<b>yo</b>, whassup?'; $headers = "From:..

HTML Mail - How may I setup a proper HTML mail message with embedded href links using PHP, that follows all the MIME rules? Any examples or links would be appreciated. Thanks!

php & html editor - Hi there, I'm starting to learn php and need a php editor for windows. Can you recommend what you think the best editor available in the market? I've tried some free html editors and was not satisfied with them. I need one that is simple and neat...
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can 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



[ Contact us | Terms of Service/Privacy Policy ]