SysInfo: Apache/1.3.24 (Win32) PHP/4.1.3-dev

I have a question that could be Apache, could be php, but I'm so new to this I have to 
ask: what is wrong with my code for the form action?  Apache does not recognize the <? 
as the beginning of php code and gives an error "filename is not valid" whenever this 
form is submitted [note: phpinfo() and several other php files work with no problem]?

   SSN:         <INPUT TYPE=INT NAME="ssn"><BR>
   First Name:  <INPUT TYPE=TEXT NAME="firstname"><BR>
   Last Name:   <INPUT TYPE=TEXT NAME="lastname"><BR>
   Employer:    <INPUT TYPE=TEXT NAME="employer"><BR>
   Comments:    <INPUT TYPE=TEXT NAME="comments"><BR>


   //  Connect to the db server
   $dbconn = @mysql_connect("localhost", "root", "password");
   if (!$dbconn) {
      echo( "<P>Unable to connect to the database server at this time.</P>" );

   //  Select the Alumni db
   if(! @mysql_select_db("Alumni") ) {
      echo( "<P>Unable to locate the Alumni db at this time.</P>" );

   // If an alumni information record has been submitted

    if ("SUBMIT" == $submitalumni) {
      $sql = "INSERT INTO Alumni SET " . 
              "SSN='$ssn', " .
              "FIRST_NAME='$firstname', " .
              "LAST_NAME='$lastname', " .
              "EMPLOYER='$employer', " .
              "COMMENTS='$comments' ";
      if (mysql_query($sql)) {
        echo( "<p>Your alumni information has been added.</p>");
      } else {
        echo( "<P>Error adding submitted alumni information: " .
             mysql_error() . "</P>");
    echo("<P> Here are all the Alumni in our database: </P>");

    // Request all alumni entries
    "SELECT * from alumni");
    if (!$result) {
       echo( "<P>Error performing query: " . mysql_error() . "</P>");
    // display alumni info in paragraph form
    while ( $row = mysql_fetch_array($result) ) {
        echo( "<P>" . $row["SSN"] . "</P>");

THANKS for your help!  - Kirk

Reply via email to