rblampain
asked on
PHP & HTTPD
Linux FC2
The second script following this one suddenly stopped working so I thought I should start fixing at number one.
This number one gives the following errors:
~/httpd/access_log
192.168.1.13 - - [22/Mar/2005:20:41:27 +0800] "GET /var/nobla/u1/h123.css HTTP/1.1" 404 299 "http://192.168.1.13/open_session.php" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922"
~/httpd/error_log
[Tue Mar 22 20:41:27 2005] [error] [client 192.168.1.13] File does not exist: /home/meeting/chair/var, referer: http://192.168.1.13/open_session.php
The first error seems to be a path problem to the file, it affects only presentation.
Can anyone point to me what I am doing wrong?
The second error has got me confused, I've got no idea since there is no file named "var" that is called in the script, only a directory (ref: error 1)
Can anyone explain, give me a solution?
Here is the number one script:
# open_session.php
<? session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Open Session</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel=stylesheet type="text/css" href="/var/nobla/u1/h123.c ss">
</head>
<body class="wp2cpng">
<table class="tabl01"><tr><td width="100%">
<form method="post">1) Click here
<input type="text" name="date"></form><br>
<?php
if (isset($_POST['date'])) {
$date = ($_POST['date']);
$filename1 = "agenda/session_agenda" . $date;
$_SESSION['filename1'] = $filename1; # save it
echo "Session date = Day: ";
?><b><font color="red"><?
echo substr($filename1,25,2);
?></b></font><?
echo " Month: ";
?><b><font color="red"><?
echo substr($filename1,23,2);
?></b></font><?
echo " Year: ";
?><b><font color="red"><?
echo "20",substr($filename1,21, 2);
?></b></font><?
echo "<br>";
if (file_exists($filename1)) {
echo "<form method='post' action='select_element.php '><select size='8' name='selected'>";
$agenda = file("$filename1");
$_SESSION['agenda'] = $agenda;
foreach($agenda as $lineNumber => $lineStr) {
echo "<option>$lineStr</option> ";
}
echo "</select><br><br>";
echo "<input type='submit' name='submit' value='Continue '></form>";
}
else {
echo "No file found for the date entered<br><br>";
}
}
?>
</td></tr></table></body>< /html>
Thank you for your help.
The second script following this one suddenly stopped working so I thought I should start fixing at number one.
This number one gives the following errors:
~/httpd/access_log
192.168.1.13 - - [22/Mar/2005:20:41:27 +0800] "GET /var/nobla/u1/h123.css HTTP/1.1" 404 299 "http://192.168.1.13/open_session.php" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922"
~/httpd/error_log
[Tue Mar 22 20:41:27 2005] [error] [client 192.168.1.13] File does not exist: /home/meeting/chair/var, referer: http://192.168.1.13/open_session.php
The first error seems to be a path problem to the file, it affects only presentation.
Can anyone point to me what I am doing wrong?
The second error has got me confused, I've got no idea since there is no file named "var" that is called in the script, only a directory (ref: error 1)
Can anyone explain, give me a solution?
Here is the number one script:
# open_session.php
<? session_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>Open Session</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel=stylesheet type="text/css" href="/var/nobla/u1/h123.c
</head>
<body class="wp2cpng">
<table class="tabl01"><tr><td width="100%">
<form method="post">1) Click here
<input type="text" name="date"></form><br>
<?php
if (isset($_POST['date'])) {
$date = ($_POST['date']);
$filename1 = "agenda/session_agenda" . $date;
$_SESSION['filename1'] = $filename1; # save it
echo "Session date = Day: ";
?><b><font color="red"><?
echo substr($filename1,25,2);
?></b></font><?
echo " Month: ";
?><b><font color="red"><?
echo substr($filename1,23,2);
?></b></font><?
echo " Year: ";
?><b><font color="red"><?
echo "20",substr($filename1,21,
?></b></font><?
echo "<br>";
if (file_exists($filename1)) {
echo "<form method='post' action='select_element.php
$agenda = file("$filename1");
$_SESSION['agenda'] = $agenda;
foreach($agenda as $lineNumber => $lineStr) {
echo "<option>$lineStr</option>
}
echo "</select><br><br>";
echo "<input type='submit' name='submit' value='Continue '></form>";
}
else {
echo "No file found for the date entered<br><br>";
}
}
?>
</td></tr></table></body><
Thank you for your help.
ASKER
Thanks to craigwardman
The file is not under the website root, it is under the disk root.
The "documentroot" in HTTPD is "/home/meeting/chair" and a script from this directory is trying to read the file "/var/nobla/u1/h123.css" ("/var/nobla" was created at installation time).
Apache is trying to read "/home/meeting/chair/var/n obla/u1/h1 23.css" how can I make it read "/var/nobla/u1/h123.css"?
The file is not under the website root, it is under the disk root.
The "documentroot" in HTTPD is "/home/meeting/chair" and a script from this directory is trying to read the file "/var/nobla/u1/h123.css" ("/var/nobla" was created at installation time).
Apache is trying to read "/home/meeting/chair/var/n
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
link rel=stylesheet type="text/css" href="/var/nobla/u1/h123.c
the /var folder is in your disk root, not website root, if you want it to start from website root, remove the preceding /
link rel=stylesheet type="text/css" href="var/nobla/u1/h123.cs
That may help with 404 error if the file is under the website directory :)