The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “1Win

html pages understand the php code ?

Do you what that servers to parse php code in html files ?

  • Yes

    Votes: 0 0.0%
  • No

    Votes: 0 0.0%

  • Total voters
    0
C

criserb1

Guest
It is useful for servers to parse php code in html files? In my opinion I think it is very useful, because sometime the php function are very ease to use either for a non experienced web designer/developer. In my web designer/developer work I found this problem very frequent.

I want to know your opinion about that and if you think that this isn’t useful please argument that.

Cristi
 
crowebird said:
If that would mean I can use php without my host needing to support it then yes becuase my host does not support php.

No, it only means that you can have the .thml files parsed as .php scripts. You still need support for regular .php scripts from your hosting provider.
 
criserb1 said:
It is useful for servers to parse php code in html files? In my opinion I think it is very useful, because sometime the php function are very ease to use either for a non experienced web designer/developer. In my web designer/developer work I found this problem very frequent.

I want to know your opinion about that and if you think that this isn’t useful please argument that.

Cristi

Very bad ideea from a performance point of view:

HTML NOT PARSED AS PHP
------------------------------------------------------------
command used: ab -n1000 http://velnet.wrk/agree.html
This is ApacheBench, Version 1.3d <$Revision: 1.70 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking velnet.wrk (be patient)


Server Software: Apache/1.3.29
Server Hostname: velnet.wrk
Server Port: 80

Document Path: /agree.html
Document Length: 21441 bytes

Concurrency Level: 1
Time taken for tests: 6.866 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 21726000 bytes
HTML transferred: 21441000 bytes
Requests per second: 145.65 [#/sec] (mean)
Time per request: 6.87 [ms] (mean)
Time per request: 6.87 [ms] (mean, across all concurrent requests)
Transfer rate: 3164.29 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 2.0 0 44
Processing: 4 5 4.2 5 50
Waiting: 0 0 1.2 0 36
Total: 4 6 4.6 5 50


HTML PARSED AS PHP
------------------------------------------------------------
command used: ab -n1000 http://velnet.wrk/agree.html
This is ApacheBench, Version 1.3d <$Revision: 1.70 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking velnet.wrk (be patient)


Server Software: Apache/1.3.29
Server Hostname: velnet.wrk
Server Port: 80

Document Path: /agree.html
Document Length: 21441 bytes

Concurrency Level: 1
Time taken for tests: 13.980 seconds
Complete requests: 1000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 21606000 bytes
HTML transferred: 21441000 bytes
Requests per second: 71.53 [#/sec] (mean)
Time per request: 13.98 [ms] (mean)
Time per request: 13.98 [ms] (mean, across all concurrent requests)
Transfer rate: 1545.49 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 2.0 0 49
Processing: 10 13 6.7 11 64
Waiting: 0 0 1.4 0 31
Total: 10 13 7.4 11 113


As you can see it took 6,9sec to parse 1000 times a certain file as .html as opposed to 14 secondes to parse *the same file* as PHP this time.
 
Yep, I see the differences... but many of php function are very good sometime, and I think there are not similarly functions in HTML.
 
criserb1 said:
Yep, I see the differences... but many of php function are very good sometime, and I think there are not similarly functions in HTML.

Then go for it, but you should consider using plain .php files, and not parsing all .html files as .php. With a little trickery, you can *make .php files look like .html*. It's much better than the other way around.
 
banners
Back