httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "NIPP, SCOTT V (SBCSI)" <sn4...@sbc.com>
Subject PHP 4.2.1 / Apache 1.3.24...
Date Fri, 17 May 2002 19:18:35 GMT
	I have a question about passing variables between web pages...  I am
running Apache 1.3.24 with PHP 4.2.1 and FrontPage 2002 Server Extensions.
My problem is that I have a web page that provides a list of systems
generated dynamically from a database.  The user selects a system, and then
is forwarded to another page that displays the results of the query based on
the name of the system that the user has selected.  The system list is
working fine, but when I "Submit" to display the results of the query, the
query results page is missing the result data.
	The troubleshooting that I have done led me to discover that the
variable that holds the selected system name is apparently not being passed
correctly.  I determined this because if I replace the variable name on the
results page with a valid system name, I get the expected output.  I am not
sure if this problem is with Apache, FrontPage, PHP, or some combination of
these three.  Any help is appreciated.  Thanks in advance.
	Below is the relevant section of both the query page, and the
results page:

	Query:
	
        <p align="left"><span lang="en-us">Please select system:&nbsp;
</span></p>
      
        <?php
        mysql_pconnect("localhost","auto");
        mysql_select_db("LD_Systems");
        $results = mysql_query("SELECT Name FROM systems");
        $dropdown = "<select size=\"1\" name=\"system\">\n";
          while($name = mysql_fetch_row($results)) {
            $dropdown .= "<option>$name[0]</option>\n";
          }
          $dropdown .= "</select>\n";
        ?>
      <form method="POST" action="db_query.htm">
        <?php echo "$dropdown"; ?>

	Results:

<h3 align="center">Results Of Your Query</h3>

<?php
  trim($system);
  $link = mysql_connect("localhost","auto");
  mysql_select_db("LD_Systems");
  $results = mysql_query("SELECT * FROM systems WHERE Name = '$system'");
  $data = mysql_fetch_assoc($results);
  printf ("Name:  %s <br>\n", $data["Name"]);
  echo ("<font color=\h3>"."System:  ".$data["Name"]."  IP Address:
".$data["IP"]."  Primary SA:  ".$data["SA"]."<br>"."");
?> </font></body></html>

	Thanks again.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  sn4265@sbc.com
Web:  http:\\ldsa.sbcld.sbc.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message