Jump to content
xisto Community
Sign in to follow this  
Arne-Christian

Form Dosn't Submit In Opera Works in IE and FireFox

Recommended Posts

My form dosn't submit, it works in IE and FF, its validated HTML 4.01 and all,Code:

<? /**********************************//**   Post Topic :: EvilBoard	**//**********************************//* Session Start */session_start();/* Start Submit Script */if (  isset($_POST['Submit'])) {	header("Refresh: 0; redirect.php?posttopic");	define("RELOADED","YES");}/* End Submit Script *//* Include File::Header.php */include("include/header.php");echo "<br>";/* If Script can't find SESSION user_name */if ( !$_SESSION['user_name'] ) {/* Echo :: Forbiden */echo '<table width="100%" border="0" cellspacing="0" class="eb_forbit">	  <tr> 	   <td><table width="100%" border="0" cellspacing="0"> 		 <tr>			<td width="3%"><img src="Themes/Default/Images/forbid.gif" width="20"></td> 		   <td width="97%" class="eb_txt"> You must login to access this page. </td> 		 </tr> 	   </table></td>	  </tr>	</table>';## Include Login Script 	include "login.php";	exit();}/* End !SESSION:user_name *//* Start ELSEIF::SESSION:user_name */elseif ( $_SESSION['user_name'] ) {/* Include WYSIWYG JavaScript [openWYSIWYG] & Default CSS File */	echo '<script language="JavaScript" type="text/javascript" src="wysiwyg.js"></script>';/* Start FORM::Submit */	if (  isset($_POST['gladz']) && !empty( $_POST['gladz'] ) ) {/* Connect to DB */		dbconnect();/* Get UserID */		$username = $_SESSION['user_name'];		$queryX = "SELECT * FROM `eb_members` WHERE `Username` = '$username'";		$getuserid = mysql_query( $queryX );		while( $getinfo21 = mysql_fetch_object( $getuserid ) ) {			global $userid;			$userid = $getinfo21 -> userid;		}/* FORM::GET */		$title = $_POST['title'];		$desc = $_POST['desc'];		$forumid = $_GET['forumid'];		$message = $_POST['gladz'];/* SQL::QUERY::eb_topic */		$query = "INSERT INTO `eb_topic` ( `UserID` , `title` , `TopicID` , `replays` , `desc` , `Username` , `ForumID` )VALUES ('$userid', '$title', NULL , '0', '$desc', '$username', '$forumid');";		mysql_query($query);		$topicquery = "SELECT * FROM `eb_topic` ORDER BY `TopicID` DESC LIMIT 0,1";		$topic = mysql_query( $topicquery );		while ( $topicid = mysql_fetch_object ( $topic ) ) {			$topicid25 = $topicid -> TopicID;					/* SQL::QUERY::eb_post */		$sqlXY = "INSERT INTO `eb_post` ( `message` , `postdate` , `UserID` , `Username` , `PostID` , `TopicID` , `ForumID` , `title` )		VALUES (		'$message', NOW( ) , '$userid', '$username', '' , '$topicid25', '$forumid', '$title');";		mysql_query($sqlXY);		}	#}}include("functions/smiley.class.php");$smiley = new smiley;			?><script language="javascript" type="text/javascript">function insertHTML(html, n) {  var browserName = navigator.appName;	 	 	if (browserName == "Microsoft Internet Explorer") {	  	  document.getElementById('wysiwyg' + n).contentWindow.document.selection.createRange().pasteHTML(html);   	} 	 	else {	  var div = document.getElementById('wysiwyg' + n).contentWindow.document.createElement("div");		 		div.innerHTML = html;		var node = insertNodeAtSelection(div, n);			}	}function emoticon(img) {	insertHTML(img, 'gladz');}</script><form name="sub" method="post" action="index.php?act=posttopic&forumid=<? $forumid = $_GET['forumid']; echo "{$forumid}"; ?>">  <table width="100%" border="0" align="center" cellspacing="0">	<tr>	  <td width="100%" class="eb_forum">		<div align="center"><strong>Post Topic</strong></div></td>	</tr>	<tr>	  <td class="eb_footer_orgin">		<table width="100%"  border="0" cellspacing="0" class="eb_txt">		  <tr>			<td width="19%" rowspan="2" valign="top"><? $smiley->click_smileys(); ?></td>			<td>Title:<br>		<input name="title" type="text" class="eb_header" style="width: 100%;">		Topic Description:<br>		<input name="desc" type="text" class="eb_header" id="desc"  style="width: 100%;">		<br>		Message:<br></td>		  </tr>		  <tr>			<td width="81%"><textarea  id="gladz" rows="10" cols="200" name="gladz"  class="eb_header" style="hieght: 170px; width: 500px; color: #FFFFFF;"></textarea></td>		  </tr>		  <tr>			<td colspan="2"><div align="center">			  <input name="Submit" type="submit" class="eb_header" value="Submit">			</div></td>		  </tr>		</table>	  </td>	</tr>  </table></form><script language="javascript1.2" type="text/javascript">  generate_wysiwyg('gladz');</script><?php showfooter(); ?>

Share this post


Link to post
Share on other sites

Well it is submitting the POST VARS but you are redirecting it to another page so the POT Values dont get redirected.Hence it is not working.Instead of redirecting include the processing file in the same page if the $_POST['Submit'] is set or show the form.I doubt that this is even working in Internet Explorer or FireFox as this is not a brower issue but a PHP issue.Hope this works out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.