473,322 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

OK really stupid question now.

Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec
Aug 22 '08 #1
9 1589
Michael thanks for the reply...

So I should stick to standard php then... Thats suits me :-)

By the way, what advantage can be gained by using this other
method???

Cheers

Alec
Aug 22 '08 #2
On Fri, 22 Aug 2008 08:11:35 -0700, Alec wrote:
Michael thanks for the reply...

So I should stick to standard php then... Thats suits me :-)
Google "clean urls" if you want more control over what's in the address
bar.
By the way, what advantage can be gained by using this other method???
The only advantage is facilitating laziness. You can set up a webserver to
process any file extension through any server-side process but that means
all files are being run through the processor instead of just the files
that have scripting language in them. It's drastically increasing server
load unnecessarily.

--
I told you this was going to happen.

Aug 22 '08 #3
..oO(Michael Vilain)
>In article
<3c**********************************@k13g2000hse .googlegroups.com>,
Alec <aj****@aol.comwrote:
>Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec

It's a very painful modification and expensive (to performance) of their
web server to always process html files as dynamic pages.
That's a wrong assumption, since you don't know anything about their
server. If for example PHP is used on every page (which it usually is
on every bigger site), then there's nothing wrong with this approach.
Additionally you don't know how the server maps the URLs to the actual
files or scripts. The .html could be there just for cosmetic reasons,
while still allowing for /foo.html being served directly and /bar.html
processed by PHP. Quite easy to do on Apache servers.
>Instead of
interpeting the pages as plain old "ship it to the remote browser and
don't do anything else" HTML code they modified their web server to
always invoke the php or perl parser.
Could be, but you would have to ask them if that's indeed the case. You
can't tell that from just looking at the URLs.
>It can be done, but it's a Massively Bad Idea(tm) to bork on your web
server that way.
As said - it depends.
>If they have the processing capacity, great. But I'll
bet if they handle high-volume throughput, they'll soon discover that
stupid is a stupid does.
I doubt that.

Micha
Aug 22 '08 #4
..oO(Alec)
>Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??
A URL and a file on disk are two completely different things. In fact a
URL is just a string, things like 'directory' or 'file extension' don't
have any meaning there. The .html above is just a 5-char string without
any meaning.

It depends on the server how to map those URLs onto the files or scripts
on the disk. Usually this mapping is done directly from the URL to the
file system, but there are also various ways for URL rewriting. There
doesn't even have to be a file called "Alfa Romeo_news.html", it could
all be just a single script for example. From just looking at a URL you
can't tell anything about what's going on behind the scenes or how the
pages are created. It can even happen all at the same time, e.g.

http://example.com/foo.html -static page
http://example.com/bar.html -PHP script
http://example.com/abc.html -SSI page
http://example.com/xyz.html -a JPEG image

Micha
Aug 22 '08 #5
Alec wrote:
Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec
A simple remapping in .htaccess will do it. Or there could be an SSI
include in the .html file for the .php file. Or other ways.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 22 '08 #6
Jerry Stuckle wrote:
Alec wrote:
>Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec

A simple remapping in .htaccess will do it. Or there could be an SSI
include in the .html file for the .php file. Or other ways.
As Jerry said you can tell the server to process a page with the PHP
Engine using any extension you want.

for example in your .htaccess file: (apache)
AddType application/x-httpd-php .htm .html

will process .htm, html to the PHP engine.

AddType application/x-httpd-php .foo

will allow pages with .foo extensions the same.

One thought for this is to hide the php extension to throw off some
hackers, not sure how effective it is, but I suppose every little bit
helps, especially if they are scanning for php extension automatically.
Aug 22 '08 #7
FutureShock wrote:
Jerry Stuckle wrote:
>Alec wrote:
>>Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec

A simple remapping in .htaccess will do it. Or there could be an SSI
include in the .html file for the .php file. Or other ways.
As Jerry said you can tell the server to process a page with the PHP
Engine using any extension you want.

for example in your .htaccess file: (apache)
AddType application/x-httpd-php .htm .html

will process .htm, html to the PHP engine.

AddType application/x-httpd-php .foo

will allow pages with .foo extensions the same.

One thought for this is to hide the php extension to throw off some
hackers, not sure how effective it is, but I suppose every little bit
helps, especially if they are scanning for php extension automatically.
Even easier - just rewrite all applicable .html extensions to .php ones.
No need to parse .html files for php code that way.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 23 '08 #8
FutureShock wrote:
Jerry Stuckle wrote:
>Alec wrote:
>>Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec

A simple remapping in .htaccess will do it. Or there could be an SSI
include in the .html file for the .php file. Or other ways.
As Jerry said you can tell the server to process a page with the PHP
Engine using any extension you want.

for example in your .htaccess file: (apache)
AddType application/x-httpd-php .htm .html

will process .htm, html to the PHP engine.

AddType application/x-httpd-php .foo

will allow pages with .foo extensions the same.

One thought for this is to hide the php extension to throw off some
hackers, not sure how effective it is, but I suppose every little bit
helps, especially if they are scanning for php extension automatically.
It won't help. You also need to disable the advertising of php in the
php.ini file, for instance. But most servers have php installed anyway,
so hackers will check for it.

But if you follow good security practices in your code and server
configuration, it shouldn't be a problem.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Aug 23 '08 #9
Jerry Stuckle wrote:
FutureShock wrote:
>Jerry Stuckle wrote:
>>Alec wrote:
Sorry guys, stupid question....

Am no programming expert and have only just started using php for
creating dynamic news pages.

Then I see a dynamic website without the php extension.

http://www.newcarnet.com/Alfa%20Romeo_news.html?id=8380

It has the html extension that loads the required page dynamically.

I thought html pages could not be dynamic. How is this done??

Thanks

Alec
A simple remapping in .htaccess will do it. Or there could be an SSI
include in the .html file for the .php file. Or other ways.
As Jerry said you can tell the server to process a page with the PHP
Engine using any extension you want.

for example in your .htaccess file: (apache)
AddType application/x-httpd-php .htm .html

will process .htm, html to the PHP engine.

AddType application/x-httpd-php .foo

will allow pages with .foo extensions the same.

One thought for this is to hide the php extension to throw off some
hackers, not sure how effective it is, but I suppose every little bit
helps, especially if they are scanning for php extension automatically.

It won't help. You also need to disable the advertising of php in the
php.ini file, for instance. But most servers have php installed anyway,
so hackers will check for it.

But if you follow good security practices in your code and server
configuration, it shouldn't be a problem.
That is why stated as to how effective it was. I am not questioning the
validity of it, just how simple it would be if you so choose to alter
the extension. The statement about why it would be done, I had read off
a site. Probably a well know site.
http://www.php.net/manual/en/security.hiding.php
I personally use the php extension.

Scotty
Aug 23 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: C. Armour | last post by:
Help me, I'm suffering! Situation: I have a load() function which loads a bunch of TextFields with values. There are TextListeners registered for each of these TextFields. Thus, changing the...
15
by: Randall Smith | last post by:
I've been programming in Python for about 2 years. I think it offers the best combination of simplicity and power of any language I have explored. As I write more and larger and complex programs,...
2
by: Lampa Dario | last post by:
Hi, where is this stupid error in this program? When I execute it, i receive a segmentation fault error. #include <stdio.h> int main(int argc, char *argv, char *env) { int i=0; int l=0; int...
59
by: Alan Silver | last post by:
Hello, This is NOT a troll, it's a genuine question. Please read right through to see why. I have been using Vusual Basic and Classic ASP for some years, and have now started looking at...
5
by: Guoqi Zheng | last post by:
I think I have this kind of problem very often, now it is really making me crazy. VS.NET always want to change my html code. Ok, that is fine as long as Vs.Net can ask my confirmaton first. For...
15
by: sparks | last post by:
We get more and more data done in excel and then they want it imported into access. The data is just stupid....values of 1 to 5 we get a lot of 0's ok that alright but 1-jan ? we get colums...
10
by: Stan R. | last post by:
Hi. I'm an old programmer whose been finally reading up on xml the past week. The concepts of xml, dtd, and xsl seem pretty straight forward to me. I understand that xsl (as xslt for...
56
by: tasteless | last post by:
Hi guys, I need really hard questions (about 10) about PHP programming (some of elements OOP as well, but no MySQL questions - this is different part), this questions needs to be very hard, but...
0
by: raylopez99 | last post by:
I ran afoul of this Compiler error CS1612 recently, when trying to modify a Point, which I had made have a property. It's pointless to do this (initially it will compile, but you'll run into...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.