Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1615 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Page titles when using php

Thread title: Page titles when using php
Closed Thread  
Page 2 of 2 < 1 2
    Thread tools Search this thread Display Modes  
05-21-2006, 11:05 PM
#11
Michael Boutros is offline Michael Boutros
Status: I'm new around here
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 7
iTrader: 0 / 0%
 

Michael Boutros is on a distinguished road

  Old

If you really wanted then you could do this:

<?php
$file = file_get_contents("includes/filename.html");

echo $file;
?>

PS: Glad to see I'm not the only one who uses (" and ") :P

05-21-2006, 11:08 PM
#12
jjmac is offline jjmac
jjmac's Avatar
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 197
iTrader: 0 / 0%
 

jjmac is on a distinguished road

  Old

Originally Posted by Michael Boutros
PS: Glad to see I'm not the only one who uses (" and ") :P
Quick side note... " and " uses more overhead because it processes variables inside the double quotes while single quotes does not. I only use double quotes when necessary or for convenience when overhead does not matter (yeah right, overhead always matters!). That's the main difference

05-22-2006, 01:24 AM
#13
Julian is offline Julian
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
 
Posts: 5,572
iTrader: 0 / 0%
 

Julian is on a distinguished road

  Old

What do you mean by overhead?

05-22-2006, 01:44 AM
#14
Michael Boutros is offline Michael Boutros
Status: I'm new around here
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 7
iTrader: 0 / 0%
 

Michael Boutros is on a distinguished road

  Old

Originally Posted by Julian
What do you mean by overhead?
Ditto.

05-22-2006, 01:44 AM
#15
jjmac is offline jjmac
jjmac's Avatar
Status: Member
Join date: May 2006
Location:
Expertise:
Software:
 
Posts: 197
iTrader: 0 / 0%
 

jjmac is on a distinguished road

  Old

Overhead refers to the amount of instructions it takes to process a certain block of php code.

In other words, it takes a server longer to process this:

echo "hello";

than it does this:

echo 'hello';

Granted on something that small it makes no difference. However if you were to use double quotes exclusively instead of single quotes on something like forum software, it all ads up and could make several seconds difference in loading time. Multiply that by thousands of users at a time and you've got a problem that could have easily been avoided by using propper PHP.

05-22-2006, 03:34 AM
#16
Shawon is offline Shawon
Shawon's Avatar
Status: Request a custom title
Join date: Nov 2004
Location: New York City
Expertise:
Software:
 
Posts: 1,164
iTrader: 0 / 0%
 

Shawon is on a distinguished road

Send a message via AIM to Shawon Send a message via MSN to Shawon

  Old

wow never knew about html includes, thanks alot, now i wont have to use .php all the time

05-22-2006, 05:10 AM
#17
Julian is offline Julian
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
 
Posts: 5,572
iTrader: 0 / 0%
 

Julian is on a distinguished road

  Old

Thanks a bunch Josh

05-22-2006, 04:46 PM
#18
DJAC is offline DJAC
DJAC's Avatar
Status: Member
Join date: Mar 2006
Location: Canada
Expertise:
Software:
 
Posts: 286
iTrader: 0 / 0%
 

DJAC is on a distinguished road

Send a message via MSN to DJAC

  Old

Just to add one more comment about Server Side Includes.

If you tried the code I posted earlier and it did not include your .html file as expected, it is probably due to your server's configuration.
Code:
<!--#include file="includes/filename.html" -->
So if the above code doesn't include your .html files properly, then you'll have to rename your .html files to .shtml.

You would then use the following:
Code:
<!--#include file="includes/filename.shtml" -->
The reason why the .shtml extension is often required is so that the server doesn't waste time and resources searching through every .html file for an include statement. By giving a .shtml extension, the server will only expect an include to possibly occur in that filetype.

Note: You can use either .shtml or .shtm.

05-23-2006, 06:02 AM
#19
Julian is offline Julian
Status: Simply to simplify
Join date: Apr 2005
Location: Foxton, Manawatu, New Zealand
Expertise:
Software:
 
Posts: 5,572
iTrader: 0 / 0%
 

Julian is on a distinguished road

  Old

The .html files are working fine, thanks for the heads-up!

05-23-2006, 06:14 AM
#20
jono1 is offline jono1
jono1's Avatar
Status: Non-conformist
Join date: Jul 2005
Location: Canberra, Australia.
Expertise:
Software:
 
Posts: 1,172
iTrader: 0 / 0%
 

jono1 is on a distinguished road

  Old

Originally Posted by jjmac
Quick side note... " and " uses more overhead because it processes variables inside the double quotes while single quotes does not. I only use double quotes when necessary or for convenience when overhead does not matter (yeah right, overhead always matters!). That's the main difference
Wow...I never knew that. I would always go
PHP Code:
echo "The time is " $time_var " and the date is " $date_var "."
or whatever. Thanks for the tip

Closed Thread  
Page 2 of 2 < 1 2


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed