Submitting form to mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mike2098
    New Member
    • Dec 2006
    • 5

    Submitting form to mysql

    Hi I have a form with drop down boxes, tinymce and an ajax file up-loader I want to be able to submit the form and store all the data on a mysql db the trouble I have is I do not know how to reference the tinymce (they have a lack of decent documentation) or I am trying to over complicate things

    The idea is a new job will be created and stored in a database for retrieval at a later date I want to be able to show the form contents and links to the files that were submitted

    this is my form code

    Code:
          <div align="center" class="column1a">
        
                  	<form method="post" action="<?=$_SERVER['REQUEST_URI']?>"> 
                    
    	<div>
    				<div>
    <?     
         echo "<form name=jobinfo>\n";
         echo "Type : : <font id=type><select>\n";
         echo "<option value='0'>== Type ==</option> \n" ;
         echo "</select></font>\n";
         
         echo "Dept : <font id=dept><select>\n";
         echo "<option value='0'>== Dept ==</option> \n" ;
         echo "</select></font>\n";
         
         echo "Priority : <font id=priority><select>\n";
         echo "<option value='0'>==== Priority ====</option> \n" ;
         echo "</select></font>\n";
    ?>
    
    <script language=Javascript>
    function Inint_AJAX() {
       try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
       try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
       try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
       alert("XMLHttpRequest not supported");
       return null;
    };
    
    function dochange(src, val) {
         var req = Inint_AJAX();
         req.onreadystatechange = function () { 
              if (req.readyState==4) {
                   if (req.status==200) {
                        document.getElementById(src).innerHTML=req.responseText; //ÃѺ¤èÒ¡ÅѺÁÒ
                   } 
              }
         };
         req.open("GET", "include/ajaxlist.php?data="+src+"&val="+val); //ÊÃéÒ§ connection
         req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
         req.send(null); //Ê觤èÒ
    }
    
    window.onLoad=dochange('type', -1);     
    </script>
    <br />
    <br />
    
    <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 60%" class="tinymce"><?php echo $sContent;?></textarea>	
    			</textarea>
    		</div>
    
    		<!-- Some integration calls -->
    	<!--	<a href="javascript:;" onmousedown="$('#elm1').tinymce().show();">[Show]</a>
    		<a href="javascript:;" onmousedown="$('#elm1').tinymce().hide();">[Hide]</a>-->
        <div align="left" id="swfupload-control">
    	<p>	Upload upto 5 files(jpg, png, gif, doc, docx, pdf,), each having maximum size of 5MB</p>
    	<input type="button" id="button" />
    	<p id="files" ></p>
    	<ol id="log"></ol>
    </div>
    
    
    		<br />
    		<input type="submit" name="save" value="Submit" />
    		<input type="reset" name="reset" value="Reset" />
    	</div>
    </form></pre></code>

    I don't need to edit text from the tinymce I thought it made a nice text box I could just use a bog standard txtBox, and with regards to the ajax file upload I cannot figure out how to store the file locations

    thanks

    Mike
  • carmarri
    New Member
    • Dec 2009
    • 5

    #2
    I never used it, but, can't you just capture the data from the textarea?


    -------------------------------------
    xatcom.net, diseño web

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      Most WYSIWYG editors simply hide your textarea and allow input into an area with HTML parsing. However, they keep the textarea updated. Like ~carmarri said, you only have to access the actual textarea.

      If you do not know what part of the $_POST array it is in, print_r() the array.

      Comment

      Working...