0

Win7; 64bit; Apache/2.2.25 (Win32); PHP/5.3.28; mysql-workbench; PHPmyadmin; Drupal; Not using drupal in this case. Only HTML and PHP. Going from HTDOCS in Apache. Index.html in the HTDOCS directory does show the "IT WORKS" test. Can also do the PHPinfo.php from HTDOCs Directory. The app I am trying to run is in the HTDOCs directory. I am new to all this

PROBLEM: 1st case (Directory A - with only PHP and HTML web pages) PHP works in HTML when I start the app and click on an option and click on the Submit button which is strictly HTML then passes thru a complete PHP program which in turn call a HTML-PHP webpage. If I don't do this PHP does not work and I only get the section of the code on the screen in between the HTML. If I tried to start PHP by itself I only get to see the code.

2nd case (Directory B - same app but different Directory with drupal stuff) is that I do not get anything but a blank page. I start the app with the HTML web page and do click over an option and click the submit button but only get a blank page like when I have errors in PHP. I believe there are no errors b/c it exactly the same code.

I been researching this for a couple of days and found and tried the following but it did not help or maybe I used them incorrectly.
A: directory my lastest attempt was to remove all and just run HTML and PHP web pages.

B: put an empty .htaccess file in Directory B and tried the following lines. By what I understand if the .htaccess is in the same folder than it takes priority over the original .htaccess which I do not know where it resides.

THIS THE ORIGINAL LINE #AddType application/x-httpd-php .php .html

I tried them as other persons said to do it and then I tried them all at the same time.

#RemoveHandler .html .htm
#AddType application/x-httpd-php .php .php4 .php3 .phtml .html .htm .shtml 
#AddHandler application/x-httpd-php5 .html .htm .shtml 
#AddType application/x-httpd-php-source .phps
#AddType text/html .shtml
#AddHandler server-parsed .html
#AddHandler server-parsed .shtml
#AddHandler php-cgi .html .htm .php
#Options Indexes FollowSymLinks Includes

Edited by Dani: Formatting fixed

2
Contributors
3
Replies
33
Views
3 Years
Discussion Span
Last Post by albucurus
0

Hi,
I can help you with first case but I need some code from you.
Definitely have some errors in code.

0

Thanks.
this the code that if i run by itself, it only shows the actual php code. The HTML section does work fine.

If i run with the inital html pgrm and the php prgm and if i click to select option and click on submit button it does work.
If I do not click on the option to browse and submit button I only get a blank screen (do this with rerouting).

Notice that in this program I initialized the id to 1 for it to run by itself which is what I need to do.

Again, thank you for your help.

********************** B_STD01.php *************
<html>
<div id="main_body"> <p style="text-align: center;" /p>

    <!-- <img name="hdr" src="GldL.png" width="700" height="100" border="0" alt="testing"> -->



<head> 
<title>WO Query</title>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -->
</head>

<body style="background-color:#ccccaa;">
  <script>
    document.body.style.backgroundColor="#f3f3f3";
   <!--  document.body.style.backgroundImage="url('B_Std01.jpg')"; --
  </script>


  <!-- // Setting display of data and option to select or enter key of record to be updated -->
    <!-- <td>FName:</td><td><input type="varchar" name="fn"  maxlength="20" size="10"/></td>
    <td>LName:</td><td><input type="varchar" name="ln"  maxlength="20" size="10"/></td> -->
  <form mame="Form1" action="B_STD02.php" method="POST"> 
    <p style="text-align: center;" /p>
    <td>ID:</td><td><input type="int" name="id"  maxlength="7" size="5"/></td>
    <td>WO:</td><td><input type="varchar" name="no"  maxlength="7" size="5"/></td>
    <td>Date:</td><td><input type="int" name="dt"  maxlength="6" size="6"/></td
    <td>Title:</td><td><input type="int" name="ti"  maxlength="15" size="15"/></td
    <td><input type="submit" value="QUERY"/></td>
    <td><input type="reset"  value="RESET"/></td>
  </form> 

  <form name="Form2" action="H_STD01.html"> 
    <p style="text-align: center;" /p>
    <td><input type="submit" value="HOME"/></td> 
  </form> 

  <table border="5" border=1  align="center">
    <tr><td align="center"> WS DATABASE</td> </tr> <td>
    <table border="1"    border=1  align="center">

    <tr> <th> </th><th>Record</th><th></th><th>Date</th><th>First</th><th>Last</th><th colspan='4'></th> </tr>
    <tr> <th> </th><th>Id</th><th>No</th><th>(yyyymd)</th><th>Name</th><th>Name</th><th>Title</th><th colspan='2'>Synopsis</th>  </tr>

    <?PHP
      // session_start(); 
      //$id = $_SESSION['id'];
      $id = "1"
      //
      //database connection
      $Connect = mysqli_connect("localhost","root","test", "test") or die ('Error Connecting to DB: '. mysqli_error());
      //
      // database selection for a requested id
      $SelectData = "SELECT * FROM studies WHERE std_id=$id";
      $result = mysqli_query($Connect,$SelectData) or die (mysqli_error($connect));
      //
      // Testing for any errors
      if ( $result === false ){ {echo "Please notify IT Staff about the following ERROR: " . mysqli_error();}; }
      //
      // this where records are display         
      while ($row=mysqli_fetch_array($result)){
        echo ("<tr><td></td>");
        echo ("<td>$row[0]</td>");
        echo ("<td><a href=\"$row[1].mp3\">$row[1]</a></td>");
        echo ("<td>$row[2]</td>");
        echo ("<td>$row[3]</td>");
        echo ("<td>$row[4]</td>");
        echo ("<td><a href=\"$row[1].pdf\">$row[5]</a></td>");
        echo ("<td>$row[6]</td></tr>");}
      ?>

     <?PHP
      //
      // Resetting to re-use 
      mysqli_data_seek($result, 0); 
      //
      // doing a complete and straight browse of database starting from number 2 since 1 is shown in previous query
      $SelectData = "SELECT * FROM studies LIMIT $id,18446744073709551615";
      $result2 = mysqli_query($Connect,$SelectData);
      //
      //Testing for any errors   
      if ( $result2 === false ){ {echo "Please notify IT Staff about the following ERROR: "  . $Connect->error, E_USER_ERROR;}; }
      //
      // Space between Searches
      echo ("<tr><td></td>");
      echo ("<tr><td></td>");
      echo ("<tr><td></td>");
      echo ("<tr><td></td>");
      // this where records are display   
      while ($row=mysqli_fetch_array($result2)){
        echo ("<tr><td></td>");
        echo ("<td>$row[0]</td>");
        echo ("<td><a href=\"$row[1].mp3\">$row[1]</a></td>");
        echo ("<td>$row[2]</td>");
        echo ("<td>$row[3]</td>");
        echo ("<td>$row[4]</td>");
        echo ("<td><a href=\"$row[1].pdf\">$row[5]</a></td>");          
        echo ("<td>$row[6]</td></tr>");}
      //
      // CLOSE CONNECTION
      mysqli_close($mysqli);
      ?>

    </table>
    </td> </tr>
  </table>
</body>
</html>
0

Not very clear to me, who is B_STD01.php and who is B_STD02.php used like action of the form.

Now what missing:
To get the values from the form you must use $_POST in your php program, like this:

$id = $_POST["id"];

where the "id" is input with name = "id".
Try this change first.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.