Flying Mullet
01-08-2005, 02:34 AM
Okay, so I'm playing around with some php and after the user inputs some data into a form I'd like to submit it to a php file to do the database work and then jave some javascript auto-submit an auto-populated form to take the user onto a results page.
So here's what my source code looks like:
<i>
<html>
<?php
// database work
?>
<form name="createcharacterform" action="TorrentMain.php" METHOD="post">
<input type="hidden" NAME="playername" maxlength="20" value="<?php print $playername; ?>"/>
</form>
<script language="JavaScript">
<!-- hide this stuff from other browsers
createcharacterform.submit();
</script>
</html>
</i>
Now, this works in IE, but being the responsible web developer that I am, I'm trying to also get it to work in Firefox at the moment. I've tried different variations of referencing the form including "document" an "window.document".
Also, is there any way to have php automatically submit that form for me?
And lastly, I would like to create individual php files to do my work rather than one master php file that submits to itself to help make the source code for managable if I can.
So here's what my source code looks like:
<i>
<html>
<?php
// database work
?>
<form name="createcharacterform" action="TorrentMain.php" METHOD="post">
<input type="hidden" NAME="playername" maxlength="20" value="<?php print $playername; ?>"/>
</form>
<script language="JavaScript">
<!-- hide this stuff from other browsers
createcharacterform.submit();
</script>
</html>
</i>
Now, this works in IE, but being the responsible web developer that I am, I'm trying to also get it to work in Firefox at the moment. I've tried different variations of referencing the form including "document" an "window.document".
Also, is there any way to have php automatically submit that form for me?
And lastly, I would like to create individual php files to do my work rather than one master php file that submits to itself to help make the source code for managable if I can.