This is an old revision of the document!
Add Item to Green Box
<php> include(“/var/www/html/greenbox/sqlconnect.php”); include(“/var/www/html/greenbox/sqlconnect2.php”);
$query = “INSERT INTO Items (Year,Type,Freq,Class,Description,Comments,SAN,Contributor,Email,MoreInfoURL,Cell)
VALUES
('$_POST[Year]','$Type','$Freq','$Class','$Description','$Comments','$SAN','$Contributor','$Email','$MoreInfoURL','$Cell')";
$result = mysql_query($query)
or die ("Couldn't execute query.");
$ItemID = mysql_insert_id(); // 46
echo $result;
echo "The following item has been added to the database:<br>
<ul>
<li>Type: $Type
<li>Frequency: $Freq
<li>Class: $Class
<li><b>$Description </b>- $Comments
<li>SAN penalty: $SAN
<li>Contributed by: $Contributor $Email
<li>More info from: $MoreInfoURL
<li>Cell $Cell available from $_POST[Year]
\n”;
echo "</ul>"; echo "Add Another Item\n";
</php> <html> <b>Add as much detail as you can in the form below, fields which cannot be blank are indicated with an Asterisk <font color=red>*</font></b> <form action=“/doku.php/dg/greenbox/add” method=“post”> <table>
<tr> <td><b>Type<font color=red>*</font> <td><b>Frequency<font color=red>*</font> <td><b>Available since <td><b>Cell
</tr>
<tr>
<td><select name="Type">
<option value="Mythos" >Mythos
<option Selected value="Mundane" >Mundane
<option value="Occult" >Occult
<option value="Other" >Other
</select>
<td><select name="Freq">
<option Selected value="0" >Very Common
<option value="1" >Common
<option value="2" >Uncommon
<option value="3" >Rare
<option value="4" >Very Rare
<option value="5" >Unique
</select>
<td><input type="text" name="Year" size="4" maxlength="4">
<td><input type="text" name="Cell" size="1" maxlength="1">
</td></tr>
<tr> <td><b>Item class<font color=red>*</font> <td><b>Short Description<font color=red>*</font> <td><b>SAN effects </tr>
<tr>
<td><select name="Class">
<option Selected value="Artefact" >Artefact
<option value="Weapon" >Weapon
<option value="Info" >Info
<option value="ID" >ID
<option value="Contact" >Contact
<option value="Other" >Other
</select>
<td><input type="text" name="Description" value="short description"
size="75" maxlength="255">
<td><input type="text" name="SAN" value="0/0"
size="12" maxlength="12">
</tr> </table> <b>Full description of item:</b><br>
<textarea name="Comments" rows="5" cols="75" maxlength="5000"></textarea>
<table> <tr>
<tr>
<td><b>Contributed by
<td><b>E-mail
<td><b>More Info URL
</tr>
<tr>
<td><input type="text" name="Contributor" value="Agent X"
size="25" maxlength="255">
<td><input type="text" name="Email" value="web form"
size="25" maxlength="255">
<td><input type="text" name="MoreInfoURL" size="25" maxlength="255">
</table>
<p><input type=“submit” name=“newbutton” value=“Commit Item to Green Box”> <input type=“submit” name=“newbutton” value=“Cancel”> </form> </html>