I'm running Mandrake 10
PHP 4x
Apache 2x
The code below resides in /home/doug/public_html
Apache is configured to allow user home drives and I can successfully
load html.
If I'm running Konqueror and launch the code below, the 'submit' button
launches the php file and returns the expected data.
If I'm running any other browser (Firefox, Mozilla, IE), pressing the
'submit'button returns the html form.
I know this may not be a php problem specifically, but the members of
this forum have a wide base of understanding and I'm hoping someone can
at least point me in the right direction.
TIA
Doug
beginning of frmSiteLoginForm.html
<html>
<body>
Enter the name of a website below.<br>
Do not include the .com bit, just the main website name<br>
This will be modified to give you a drop down list you can select from
as soon as I figure that out<br>
<br>
<form)
<form action="queryfromform.php" method = "POST">
<input type="TEXT" name="site" value="enter site name here">
<br><br>
<input type="submit" value = "Run Query">
</form>
</body>
</html>
end of frmSiteLoginForm.html
///////////////////////////////////////////////////////
beginning of queryfromform.php
<?php
//queryfromform.php
import_request_variables("P","mypost_");
// site name from form
$site = $mypost_site;
echo "The requested site is '$site' and the password is: ";
// Define variables
$server = 'localhost';
$username = 'web';
$password = 'user';
$database = 'HomeData';
//$query = "Select site, username, password from sitelogins where site =
'$site'";
$query = "Select * from sitelogins where site = '$site'";
//echo $query;
// connect to mysql
$db = mysql_connect($server, $username, $password);
//$db = mysql_connect("localhost", "web", "user");
// connect to db
mysql_select_db($database, $db);
// run query and print results
$result = mysql_query($query, $db);
if(!$result) die ("query failed");
while($row = mysql_fetch_row($result)) {
echo $row[2];
}
// close connnection
mysql_close($db);
?>
end of queryfromform.php