Use Include to add code in a file to a web page

Save copying and pasting code into web page

Page 1 of 1

3 Replies - 742 Views - Last Post: 08 May 2009 - 07:40 AM Rate Topic: -----

#1 ggeoff  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-May 09

Use Include to add code in a file to a web page

Posted 08 May 2009 - 05:02 AM

Hi

I would like to add blocks of code to my web pages. Possibly mixed php and HTML can I do this by adding the code to a php file and then just add an Include in the web page where I want that code to go? I am thinking of saving cutting and pasting and making my web pages simpler to manage and less prone to errors.

Geoff
Is This A Good Question/Topic? 0
  • +

Replies To: Use Include to add code in a file to a web page

#2 Astano  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 27
  • Joined: 09-July 07

Re: Use Include to add code in a file to a web page

Posted 08 May 2009 - 05:08 AM

Yes, that is the basic principle of it.

Read here for more info:

http://www.w3schools...hp_includes.asp
Was This Post Helpful? 0
  • +
  • -

#3 Wimpy  Icon User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: Use Include to add code in a file to a web page

Posted 08 May 2009 - 05:13 AM

As Astano says but you should also read about the require_once and include_once functions that are not mentioned in the W3Schools tutorial! :)

View Postggeoff, on 8 May, 2009 - 04:02 AM, said:

Hi

I would like to add blocks of code to my web pages. Possibly mixed php and HTML can I do this by adding the code to a php file and then just add an Include in the web page where I want that code to go? I am thinking of saving cutting and pasting and making my web pages simpler to manage and less prone to errors.

Geoff

Was This Post Helpful? 0
  • +
  • -

#4 ggeoff  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 08-May 09

Re: Use Include to add code in a file to a web page

Posted 08 May 2009 - 07:40 AM

View PostAstano, on 8 May, 2009 - 04:08 AM, said:

Yes, that is the basic principle of it.

Read here for more info:

http://www.w3schools...hp_includes.asp


Thanks Astano :)

View PostWimpy, on 8 May, 2009 - 04:13 AM, said:

As Astano says but you should also read about the require_once and include_once functions that are not mentioned in the W3Schools tutorial! :)

View Postggeoff, on 8 May, 2009 - 04:02 AM, said:

Hi

I would like to add blocks of code to my web pages. Possibly mixed php and HTML can I do this by adding the code to a php file and then just add an Include in the web page where I want that code to go? I am thinking of saving cutting and pasting and making my web pages simpler to manage and less prone to errors.

Geoff


Thanks Wimpy! :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1