Jump to content


Simple PHP Include


4 replies to this topic

#1 Chrypetex

    Young Padawan

  • Members
  • Pip
  • 121 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Photos

Posted 05 November 2006 - 11:54 AM

Hello fellows!
I wonder if someone here knows how to make a really simple PHP Include code?
I've been searching, but i can't understand them :/

#2 WoWscape

    Young Padawan

  • Members
  • Pip
  • 77 posts

Posted 05 November 2006 - 12:39 PM

Ok, say if you wanted to include a configuration file into your index.php or whatever, you would have to find the file path. This is if it's in the same directory.

<?php include("config.php"); ?>

Sincerely,
Saad

#3 Chrypetex

    Young Padawan

  • Members
  • Pip
  • 121 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Photos

Posted 05 November 2006 - 01:06 PM

Still don't understand :S

#4 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 05 November 2006 - 05:13 PM

<?php -> tells PHP to start reading the code
include -> tells PHP to include the file
("config.php"); -> the file to be included
?> -> tells PHP to stop reading the code

i don't think we can explain more simple than this, so try to understand lol

#5 Chrypetex

    Young Padawan

  • Members
  • Pip
  • 121 posts
  • Gender:Male
  • Location:Sweden
  • Interests:Photos

Posted 06 November 2006 - 08:30 AM

I'll try then ^^
Thanks!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users