Jump to content


Photo

Help With include


  • Please log in to reply
3 replies to this topic

#1 bob2006

bob2006
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationFlorida

Posted 02 September 2006 - 07:27 PM

hello i need help with the include in my php script
<?php


 
SESSION_START();
header("Cache-control:private");
INCLUDE '/webmaster/functions.php';
if($_GET['act'] == "") {
if($_SESSION['username'] && $_SESSION['password']) {






i need the include to go to a differnt dic then i have the page
the page is in one and the fuctions is in a different one who do i do this
--Sam Mesic--

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 07:32 PM

If its in a different directory then the scrpt being servered. Use this:
INCLUDE '../webmaster/functions.php';
The .. tells to PHP to go one higher up the directory tree.

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 02 September 2006 - 07:35 PM

Store the file to be included in a dir specified in the include_path in your ini file. Then all you need is

include 'functions.php';
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#4 bob2006

bob2006
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationFlorida

Posted 02 September 2006 - 08:16 PM

tahnk you

--Sam Mesic--




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users