NeoMoon
04-20-2008, 04:20 PM
NOTE: Wasn't sure if this was supposed to go in HTML or PHP.
Okay, I'm sure I did something wrong with this (The onClick part):
<html>
<head>
<title>Project Zaro - Object Creation</title>
<?php include("stylesheets.php"); ?>
</head>
<body>
<!-- START DIV DECLARING -->
<?php include("divs.php"); ?>
<!-- END DIV DECLARING -->
<div id="content-c">
<font color="CCCCCC">
<!-- Content -->
<center>
<form action="testFile.sql" method="get">
<p>Object Name: <input type="text" maxlength="100" name="name"></p>
<p>Entry ID: <input type="text" maxlength="6" name="entry"></p>
<p>Type: <select name="type">
<option value="regular">Regular</option>
<option value="chair">Chair</option>
</select></p>
<p>Display ID: <input type="text" maxlength="6" name="display"></p>
<p>Spell ID: <input type="text" maxlength="6" name="spell"></p>
<p>Sound ID: <input type="text" maxlength="6" name="sound"></p>
<p><input type="submit"
onClick="<?php
$myFile='testFile.sql';
$fh = fopen($myFile, 'w');
$name = $_GET['name'];
$entry = $_GET['entry'];
$type = $_GET['type'];
$display = $_GET['display'];
$spell = $_GET['spell'];
$sound = $_GET['sound'];
fwrite($fh, 'INSERT INTO gameobject_names (entry, Type, DisplayID, Name, spellfocus, sound1) VALUES (' . $entry . ', ' . $type . ', ' . display . ', \'' . name . '\', ' . spell . ', ' . sound . ');');
?>"
value="Make that Object!">
</center>
<!-- End Content -->
</font>
</div>
</body>
</html>
What it's supposed to do is write to testFile.sql and then prompt the user to download it.
But instead, this is what I get in the testFile.sql:
INSERT INTO gameobject_names (entry, Type, DisplayID, Name, spellfocus, sound1) VALUES (, , display, 'name', spell, sound);
All help appreciated! Thanks!
http://neo-moon.com/object.php
Okay, I'm sure I did something wrong with this (The onClick part):
<html>
<head>
<title>Project Zaro - Object Creation</title>
<?php include("stylesheets.php"); ?>
</head>
<body>
<!-- START DIV DECLARING -->
<?php include("divs.php"); ?>
<!-- END DIV DECLARING -->
<div id="content-c">
<font color="CCCCCC">
<!-- Content -->
<center>
<form action="testFile.sql" method="get">
<p>Object Name: <input type="text" maxlength="100" name="name"></p>
<p>Entry ID: <input type="text" maxlength="6" name="entry"></p>
<p>Type: <select name="type">
<option value="regular">Regular</option>
<option value="chair">Chair</option>
</select></p>
<p>Display ID: <input type="text" maxlength="6" name="display"></p>
<p>Spell ID: <input type="text" maxlength="6" name="spell"></p>
<p>Sound ID: <input type="text" maxlength="6" name="sound"></p>
<p><input type="submit"
onClick="<?php
$myFile='testFile.sql';
$fh = fopen($myFile, 'w');
$name = $_GET['name'];
$entry = $_GET['entry'];
$type = $_GET['type'];
$display = $_GET['display'];
$spell = $_GET['spell'];
$sound = $_GET['sound'];
fwrite($fh, 'INSERT INTO gameobject_names (entry, Type, DisplayID, Name, spellfocus, sound1) VALUES (' . $entry . ', ' . $type . ', ' . display . ', \'' . name . '\', ' . spell . ', ' . sound . ');');
?>"
value="Make that Object!">
</center>
<!-- End Content -->
</font>
</div>
</body>
</html>
What it's supposed to do is write to testFile.sql and then prompt the user to download it.
But instead, this is what I get in the testFile.sql:
INSERT INTO gameobject_names (entry, Type, DisplayID, Name, spellfocus, sound1) VALUES (, , display, 'name', spell, sound);
All help appreciated! Thanks!
http://neo-moon.com/object.php