A
Anonymous
Guest
HI All, Having some problems using php include. I have a page that has a case statement in it although the various case's are contained in a seperate txt file. I can't seem to include them in my page.
Code is like this.
switch($gallery){
file("details.txt");
and the txt file looks like this:
case "dad":
$_pwd="dad";
$gallery="../pics/dad/";
$gname="dad";
$user="viewer";
$email="dad@comports.net";
break;
case "admindad":
$_pwd="admindad";
$uname="dad";
$gname="dad";
$gallery="../pics/dad/";
$user="admin";
$email="dad@comports.net";
break;
case "jessica":
$_pwd="jessica";
$gallery="../pics/jessica/";
$gname="jessica";
$user="viewer";
$email="jessica@comports.net";
break;
case "adminjessica":
$_pwd="adminjessica";
$uname="jessica";
$gname="jessica";
$gallery="../pics/jessica/";
$user="admin";
$email="jessica@comports.net";
break;
I have done it like this as I can write to and update the text file automatically without having to re code the php page everytime I add a new gallery. Problem is the txt file is not rendered into my php and gives an error. Any clues..?
Thanks
Ash
Code is like this.
switch($gallery){
file("details.txt");
and the txt file looks like this:
case "dad":
$_pwd="dad";
$gallery="../pics/dad/";
$gname="dad";
$user="viewer";
$email="dad@comports.net";
break;
case "admindad":
$_pwd="admindad";
$uname="dad";
$gname="dad";
$gallery="../pics/dad/";
$user="admin";
$email="dad@comports.net";
break;
case "jessica":
$_pwd="jessica";
$gallery="../pics/jessica/";
$gname="jessica";
$user="viewer";
$email="jessica@comports.net";
break;
case "adminjessica":
$_pwd="adminjessica";
$uname="jessica";
$gname="jessica";
$gallery="../pics/jessica/";
$user="admin";
$email="jessica@comports.net";
break;
I have done it like this as I can write to and update the text file automatically without having to re code the php page everytime I add a new gallery. Problem is the txt file is not rendered into my php and gives an error. Any clues..?
Thanks
Ash