could really use your help with this, y'all:
I'm trying to use php to read a data file and output HTML.
here's the data file:
--
this is a test file
02aat.jpg
500
375
--
in order: page title, filename, height, width.
here's the code:
--
$file = fopen ("test.dat", "r");
$title = fgets ($file, 255);
echo "[script language='javascript']document.title='", $title,"' [/script]";
--
( [] = <> )
problems:
-the echo is supposed to use javascript to change the title of the page. doesn't work.
-when reading from the file, fopen reads in the carriage return. how do I avoid this?
-is there a more intelligent way to parse the data file- i.e., can i read from it with a spacer character that would allow me to put different data on the same line?
thank you!
I'm trying to use php to read a data file and output HTML.
here's the data file:
--
this is a test file
02aat.jpg
500
375
--
in order: page title, filename, height, width.
here's the code:
--
$file = fopen ("test.dat", "r");
$title = fgets ($file, 255);
echo "[script language='javascript']document.title='",
--
( [] = <> )
problems:
-the echo is supposed to use javascript to change the title of the page. doesn't work.
-when reading from the file, fopen reads in the carriage return. how do I avoid this?
-is there a more intelligent way to parse the data file- i.e., can i read from it with a spacer character that would allow me to put different data on the same line?
thank you!
