Need a new web host or having a problem with a script? Tips and advice on the best way to design, build and maintain your most valuable asset - your website!

A question for you website whizzes

PremiumMember
sean06
Posts: 1004
Joined: 16 Jun 06
Trust:

A question for you website whizzes

hey guys got a question for you.

I'm sick of creating a menu (for example), creating another 20 pages with that menu, then realising I forgot something. Meaning I need to go edit those 20 pages.

I'm sure it's possible to have the menu or whatever as a separate file, then just insert that file into the right place, but I have absolutely no idea how to do it. Does anyone know how to do this?

This will make my life a lot easier :)

Cheers,
Sean
  • 0
www.SixDayWeekend.com
Free Training Videos reveal how I make 6 figures while travelling the world
 
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
Put this where you want your menu to appear.

<?php include("filenamegoeshere.inc"); ?>


Now take whatever code makes up your menu and put it on a blank page and save it is filenamegoeshere.inc


Adrian,
  • 0
PremiumMember
sean06
Posts: 1004
Joined: 16 Jun 06
Trust:
Cheers Adrian, I"ll give that a shot and let you know how I go.
  • 0
www.SixDayWeekend.com
Free Training Videos reveal how I make 6 figures while travelling the world
 
PremiumMember
eddie53
Posts: 37
Joined: 24 Aug 06
Trust:
Yes that works, make sure your site is in php.
  • 0
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
Eddie53 wrote:Yes that works, make sure your site is in php.


No your site does not have to be in php.. You simply need to add one line of code to your .htaccess file and it works in .html

Adrian,
  • 0
laterales
Posts: 40
Joined: 17 Nov 06
Trust:
I have wondered that exact same thing. Now I have added a comment box and php doesn't scare me to death I will have to try that too, let us know how you get on.
  • 0
PremiumMember
sean06
Posts: 1004
Joined: 16 Jun 06
Trust:
I might try doing my next site in php, just for something different, if I'm using dreamweaver, there should be no big difference right?
  • 0
www.SixDayWeekend.com
Free Training Videos reveal how I make 6 figures while travelling the world
 
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
sean06 wrote:I might try doing my next site in php, just for something different, if I'm using dreamweaver, there should be no big difference right?


There is no difference.... all you do is save the pages in .php instead of .html

Adrian,
  • 0
PremiumMember
eddie53
Posts: 37
Joined: 24 Aug 06
Trust:
Adrian,

I read somewhere that html is preferable as the pages are deemed to be not as dynamic as php.
Is there any truth in this?
  • 0
Site Admin
markling
Posts: 2071
Joined: 13 Jun 06
Trust:
Search engines don't make any distinction between PHP or HTML. They don't see the PHP in the source code, just like if you view the source of a page with PHP *you* don't see the PHP either. It all just turns into HTML when you view the source.

So... the short answer... whether you use HTML or PHP makes no difference.

Regards,
Mark
  • 0
Limited time special - Pathway to Passive for $37: https://www.affilorama.com/pathwaytopassive
 
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
Eddie53 wrote:Adrian,

I read somewhere that html is preferable as the pages are deemed to be not as dynamic as php.
Is there any truth in this?


There is no preference....although you may be thinking of some search engines that don't index PHP pages? I heard that before but it is so minuscule it makes no difference.

Adrian,
  • 0
PremiumMember
sean06
Posts: 1004
Joined: 16 Jun 06
Trust:
Thanks Mark, nice to know theres no difference in the eyes of the SEs.
  • 0
www.SixDayWeekend.com
Free Training Videos reveal how I make 6 figures while travelling the world
 
fkish
Posts: 2
Joined: 24 Jan 07
Trust:
Both PHP & HTML have different purposes:

HTML, is more for laying out and formatting text. PHP on the other hand is a full-blown scripting/programming language and can also be used outside of the server environment too. Eg, I havent used batch files on my machines since I'd learnt PHP.

Not only is PHP more powerful than a batch file but is also cross-platform! So I can write stuff on my windose box and use them on my linux box too, great for automating website updates!

The beauty of PHP is that most servers have it installed as standard and all you need to do is rename any/all your .htm(l) files to .php; small step but great benefits.

Not only could you generate your troublesome menus dynamically but small things like updating copyright dates etc becomes a doddle...

I dont write html files any more...just use php to create my content from simple template files.

So, if you want to be more productive without having to wait for dreamweaver to startup, get yourself a good, simple text editor and learn php, you wont regret it...

bye for now,
ference
  • 0
PremiumMember
chatyak86
Posts: 1085
Joined: 17 Jun 06
Trust:
fkish wrote:Both PHP & HTML have different purposes:

HTML, is more for laying out and formatting text. PHP on the other hand is a full-blown scripting/programming language and can also be used outside of the server environment too. Eg, I havent used batch files on my machines since I'd learnt PHP.

Not only is PHP more powerful than a batch file but is also cross-platform! So I can write stuff on my windose box and use them on my linux box too, great for automating website updates!

The beauty of PHP is that most servers have it installed as standard and all you need to do is rename any/all your .htm(l) files to .php; small step but great benefits.

Not only could you generate your troublesome menus dynamically but small things like updating copyright dates etc becomes a doddle...

I dont write html files any more...just use php to create my content from simple template files.

So, if you want to be more productive without having to wait for dreamweaver to startup, get yourself a good, simple text editor and learn php, you wont regret it...

bye for now,
ference


Good stuff Ference,

Seems like you have a grasp of the coding language....

Adrian,

PS: How long do you wait for dreamweaver to startup?? :lol:
  • 0
fkish
Posts: 2
Joined: 24 Jan 07
Trust:
PS: How long do you wait for dreamweaver to startup??


much longer than I'd like to :-)

certainly much longer than firing up TextPad (fast/cheap) or PsPad (good/free)...

f.
  • 0
cron