Browser asking for download and not executing.
Posted: Sat Jul 01, 2006 8:37 pm
Pimptastic | Please use
Thanks for anyhelp,
Robby
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Well,
All of my other php files work. Its on a server with php 4.4. Instead of executing the code, it asks for download!?!?!?
I dont understand it!Code: Select all
<?php
session_start();
$pass = $_SESSION['password'];
$user = $_SESSION['username'];
$user="***";
$password="***";
$database="bztrans_spreadsheet";
$passenc = md5(sha1($pass));
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT `password`, `username` FROM `users`";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
$dbpass = $row["password"];
}
mysql_close();
while (isset($user) && isset($pass)) {
if ($dbpass == $passenc) {
$_SESSION['auth']= "true";
}
else {
$_SESSION['auth'] = "false";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Insert Information</title>
</head>
<body>
<?php
if ($_SESSION['auth'] == "true") {
$date = date(njY);
echo "
<form action=\"inserted.php\" method=\"post\" name=\"infosert\">
<label>Date Shipped:<input name=\"shipdate\" value=".$date." type=\"text\" /></label><br />
<label>Model:<input name=\"model\" type=\"text\" /></label><br />
<label>Driver's Name:<input name=\"driver\" type=\"text\" /></label><br />
<label>Arrival date:<input name=\"arrdate\" type=\"text\" /></label><br />
<label>Arrived<input name=\"arr\" type=\"checkbox\" /></label><br />
<label>Customer's Name<input name=\"cust\" type=\"text\" /></label><br />
<label>Invoice Number<input name=\"invoice\" type=\"text\" /></label><br />
<input name=\"submit\" type=\"submit\" />
</form>";
}
elseif ($_SESSION['auth'] == "false") {
echo "Wrong user/pass match.";
}
?>
</body>
</html>Robby
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]