[PHP]include_path?

Pagina: 1
Acties:

  • MRED
  • Registratie: Maart 2000
  • Laatst online: 22-12-2020

MRED

Carpe diem...

Topicstarter
Hoi,

Ik heb de volgende code staan in index.php bestand.

code:
1
2
3
4
5
6
<?php

include_path=.:/data/httpd/php;
include(".connect.code");

?>


Op de include_path regel krijg ik echter een Parse error., terwijl ik zeker weet dat het path klopt en het bestand .connect.code bevind zich in de map php. Verder klopt de syntax ook volgens php.net.

Wat doe ik fout?

Mijn weblog


  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

include_path="/data/httpd/php";

Doet iets met Cloud (MS/IBM)


Verwijderd

$include_path= "/data/httpd/php";
include($include_path."connect.code");

  • MRED
  • Registratie: Maart 2000
  • Laatst online: 22-12-2020

MRED

Carpe diem...

Topicstarter
Iedereen bedankt voor de snelle reacties. Ik heb het als volgt opgelost:

code:
1
2
3
4
5
6
<?php

$include_path="/data/httpd/php/";
include($include_path. ".connect.code");

?>


Waarbij ik op moet merken dat dit niet werkt zonder de laatste slash achter php

Mijn weblog


  • SWINX
  • Registratie: Juni 2001
  • Laatst online: 02-06 23:18
MRED schreef op 06 oktober 2002 @ 19:52:

Waarbij ik op moet merken dat dit niet werkt zonder de laatste slash achter php
logisch... anders staat er dus /data/httpd/php.connect.code en dat bestaat niet

Mannen komen van Mars Tweakers, vrouwen van Venus Bokt


  • Sybr_E-N
  • Registratie: December 2001
  • Laatst online: 13:51
idd. anders denkt ie dat het een file is.

  • ACM
  • Registratie: Januari 2000
  • Niet online

ACM

Software Architect

Werkt hier

php.ini's include_path is heeel wat anders dan zoiets binnen een php-script regelen.
Dus de syntax is _niet_ goed ;) Ook niet volgens php.net...

  • sjokki
  • Registratie: Juli 2002
  • Niet online
Zo is het wel goed:
PHP:
1
2
3
<?
ini_set('include_path', '.:/data/httpd/php');
?>

Je kan meer directory's opgeven, gescheiden door een dubbele punt .:dir1:dir2:dir3.
Pagina: 1