This is the code for the above issue: The values passed are unimportant
as they are for test purposes only. Everything seems to work OK except
that the frame info shows an apparent spurious connection using the
apache2 process userid.

this is the calling page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.4  (Linux)">
        <META NAME="AUTHOR" CONTENT="Paul Will">
        <META NAME="CREATED" CONTENT="20080906;16484300">
        <META NAME="CHANGED" CONTENT="20080906;16593200">
        <LINK REL="stylesheet" TYPE="text/css" HREF="mystyle.css">
        <script name="JavaScript" type="text/javascript">
        function message_of_the_day() {
        // END -->
<BODY LANG="en-GB" DIR="LTR" BACKGROUND="images/LMbgimage.jpg">
<FORM method="POST" action="LMmenu.php5" target="menu"
<table CELLPADDING="3" CELLSPACING="0" RULES="rows" width="240">
   <tr STYLE="background:silver; font-weight: bold">
      <td colspan="5" align="center" valign="middle"><h3><u>Please enter
your userid and password</u></h3></td>
      <td align="right">Userid:</td>
      <td><INPUT type="text" name="sqluser" size="12"></td>
      <td align="right">Password:</td>
         <INPUT type="password" name="sqlpass" size="12">
      <td align="center">
         <INPUT type="submit" name="submit" value="Login">
<input type="hidden" name="sqldb"   value="lmts">
<input type="hidden" name="sqlhost" value="localhost"> 

The values passed are as follows:
sqluser = shelley
sqlpass = abc123
sqldb   = lmts
sqlhost = localhost

This is the page called

#phpinfo(); # phpinfo displays the correct info.

$sqldb    = $_POST["sqldb"];
$sqluser  = $_POST["sqluser"];
$sqlpass  = $_POST["sqlpass"];
$sqlhost  = $_POST["sqlhost"];

$link = mysql_connect($sqlhost, $sqluser, $sqlpass);

print "DEBUG: $sqlhost, $sqluser, $sqlpass, $sqldb"; 
#This prints the correct info

if(! $link)
   die("Unable to connect to MySQL server,  check userid and password
are correct.\n");

mysql_select_db($sqldb, $link)
   or die("Unable to logon to database, database may be offline. $sqldb:

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to