mhlampert
01-09-2008, 05:45 AM
Hello,
I am very new to coding; however, I have successfully taught myself some PHP to use with MYSQL and I already knew html and css. I do not know very much javascript. I run a website that contains a member's only section in which members may post to a thread. I have compiled this post.php page to insert the content of the post into the database and then forward on some information in a form, while autoloading the user.php page. Basically, it has a hidden form containing the username and password of the user which then will get automatically resubmitted. It works perfectly in both IE and Safari; however, it does not work in Firefox. Rather, it inserts the content into my database; however, it does not execute the javascript to POST the form. Here is my script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>post</title>
<?
include 'connect.php';
?>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$user=$_POST['user'];
$password = $_POST['password'];
$Message=$_POST['Message'];
$forum=$_POST['forum'];
mysql_query("INSERT INTO forum (ip, date, user, comment, forum) VALUES ('$ip', NOW(),'$user','$Message','$forum')");
$action = "Post to $forum";
mysql_query("INSERT INTO log (ip, date, user, password, action) VALUES ('$ip', NOW(), '$user', '$password', '$action')");
?>
<form action="user.php" id="posting" method="post">
<input name="user" type="hidden" value="<? echo $_POST['user'];?>" />
<input name="password" type="hidden" value="<? echo $_POST['password'];?>" />
</form>
<script language="JavaScript" type="text/javascript">
<!--
document.getElementById('posting').submit();
//-->
</script>
</head>
<body onLoad="document.form.submit()">
</body>
</html>
Any help is greatly appreciated,
Thanks!
I am very new to coding; however, I have successfully taught myself some PHP to use with MYSQL and I already knew html and css. I do not know very much javascript. I run a website that contains a member's only section in which members may post to a thread. I have compiled this post.php page to insert the content of the post into the database and then forward on some information in a form, while autoloading the user.php page. Basically, it has a hidden form containing the username and password of the user which then will get automatically resubmitted. It works perfectly in both IE and Safari; however, it does not work in Firefox. Rather, it inserts the content into my database; however, it does not execute the javascript to POST the form. Here is my script:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>post</title>
<?
include 'connect.php';
?>
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$user=$_POST['user'];
$password = $_POST['password'];
$Message=$_POST['Message'];
$forum=$_POST['forum'];
mysql_query("INSERT INTO forum (ip, date, user, comment, forum) VALUES ('$ip', NOW(),'$user','$Message','$forum')");
$action = "Post to $forum";
mysql_query("INSERT INTO log (ip, date, user, password, action) VALUES ('$ip', NOW(), '$user', '$password', '$action')");
?>
<form action="user.php" id="posting" method="post">
<input name="user" type="hidden" value="<? echo $_POST['user'];?>" />
<input name="password" type="hidden" value="<? echo $_POST['password'];?>" />
</form>
<script language="JavaScript" type="text/javascript">
<!--
document.getElementById('posting').submit();
//-->
</script>
</head>
<body onLoad="document.form.submit()">
</body>
</html>
Any help is greatly appreciated,
Thanks!