I am currently busy creating a very small, insanely basic document management system, that we plan to use to manage our Documentation for software/hardware troubleshooting in the company.
I know or have read about that what I want to accomplish here can be done with AJAX/jquery and possibly other stuff as well... but I am trying to keep it as simple as possible. And on that subject I also read that this or something similar that I tried cannot be done using php alone.
My other option is to create 3 seperate pages, 1 for each selection, and then on last page you can add/upload a word document to the database with all the required fields.
Trying to keep it on one page if possible... Any suggestions on how to accomplish this without using fancy AJAX or JQUERY codes?
Here is the code i have so far... I have not added the actual form tags yet... as I first want to see what suggestions you guys come up with :)
<h2 class="gap-1">Select Software</h2>
<p>
<select name="software">
<option selected>Select Software/Application</option>
<?php
$host = "****";
$db_user = "****";
$db_pass = "****";
$db = "****";
$link=mysql_connect($host, $db_user, $db_pass) or die ("Error connecting to mysql server: ".mysql_error());
mysql_select_db($db, $link) or die ("Error selecting specified database on mysql server: ".mysql_error());
$query1="SELECT * FROM software";
$result1=mysql_query($query1) or die ("Query to get data from software Table failed: ".mysql_error());
while ($row=mysql_fetch_array($result1)) {
$software_id=$row["software_id"];
$software_name=$row["software_name"];
echo "<option value=\"$software_id\">$software_name</option>";
}
?>
</select>
</p>
<br />
<h2 class="gap-1">Link to Error/Problem</h2>
<p>
<select name="software">
<option selected>Select Error/Problem</option>
<?php
$host = "****";
$db_user = "****";
$db_pass = "****";
$db = "****";
$link=mysql_connect($host, $db_user, $db_pass) or die ("Error connecting to mysql server: ".mysql_error());
mysql_select_db($db, $link) or die ("Error selecting specified database on mysql server: ".mysql_error());
$query1="SELECT * FROM errors WHERE software_id = 3";
$result1=mysql_query($query1) or die ("Query to get data from software Table failed: ".mysql_error());
while ($row=mysql_fetch_array($result1)) {
$error_id=$row["error_id"];
$error_discription=$row["error_discription"];
echo "<option value=\"$error_id\">$error_discription</option>";
}
?>
</select>
</p>
<br />
<h2 class="gap-1">Add Document</h2>
<p>
<input type="file">
</p>
If I do the seperate page thing, I'll have one page to select the Software, and another to select the error, and then on the last page upload doc to database and add the software and error id where necessary.