I have an html table and submit button that sends the tabledata with a GET to another file. My co-worker has created an OO php class that connects to the DB and has several functions that already writes or reads from the MS SQL DB.
I'm a little confused about the best way to go from my php file with the GET to the OO php class so I can use his functionality with the DB write. Should I stick the GET data (in visEupload.php) in an array and send it as a parameter to the StoreViseData function from there? What's the best way to intercept the GET data in visEupload.php without handling the pieces before I send them as a parameter to StoreViseData()? The GET data will be over 50 data pieces long eventually.
Most of our php in production is not OO.
I have been referring to this link:
http://tangledindesign.com/how-to-create-a-contact-form-using-html5-css3-and-php/#comment-1428428110[
^]
This is an excerpt from the BigTable.php (which is just html right now):
<body>
<h1> Visual Evaluation Entry Table </h1>
<form method="get" action="visEupload.php">
<table id="bigTable" border="1">
<thead>
<tr>
<th id="bandY" class="col3">Bands @263mm Y</th><th id="bandM" class="col3">Bands @263mm M</th><th id="bandC" class="col3">Bands @263mm C</th><th id="bandK" class="col3">Bands @263mm K</th><th id="Comments" class="col3">Comments</th>
</tr>
</thead>
<tbody>
<tr >
<td><input name="bandY" ></td>
<td><input name="bandM" ></td>
<td><input name="bandC" ></td>
<td><input name="bandK" ></td>
<td><input name="comment" ></td>
</tr>
</tbody>
</table>
<input id="submit" type="submit" class="list" name="submit" value="Submit To Database" >
</form>
</body>
This is an excerpt from the visEupload.php where I have the GET, and intend to access the OLAP Database class. I'm not sure the best way to send the data to the $OLAPdb class/function:
<body>
<?php
require_once( "../classes/class.OLAPdatabase.php");
require_once( "../common/Session.php");
$OLAPdb = new OLAPdatabase;
if (isset($_GET['submit'])){
$bandY= $_GET['bandY'];
$bandM= $_GET['bandM'];
$bandC= $_GET['bandC'];
$bandK= $_GET['bandK'];
$comment=$_GET['comment'];
$OLAPdb->StoreViseData();
}
?>
</body>