
October 24th, 2003, 06:05 AM
|
|
|
|
Join Date: Apr 2007
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PHP/JavaScript WYSIWYG/MySQL Problem....
Okay, I have a problem. I am using a JavaScript based WYSIWYG Editor for a CMS. The Javascript is dynamically creating the HTML which is then being passed to a PHP sql_query and into the DB.
Unfortunately, the quotes generated in the HTML (ie: <a href= "test.html ">TEST</a>) are ending the SQL query so I only get the following code in the table:
<a href=
Here is the code I'm using currently, with the "addslashes" function which isn't working:
php Code:
Original
- php Code |
|
|
|
<?php if (isset($_POST['submit'])) { } include ('includes/admin_header.htm'); ?> <table width="500"> <tr> <td height="100"> </tr> <tr> <td> <form action="<?php $_SERVER['PHP_SELF'] ?>" method="POST" name="RichTexteditor" id="RichTexteditor" onSubmit="submitForm(); return true;"> <iframe id="testFrame" style="position: absolute; visibility: hidden; width: 0px; height: 0px;"></iframe> <script language="JavaScript" type="text/javascript" src="browserdetect.js"></script> <script language="JavaScript" type="text/javascript" src="richtext.js"></script> <script language="JavaScript" type="text/javascript"> <!-- function submitForm() { try { text1.innerHTML = '<input type="hidden" name="text1" value="' + document.getElementById('edit').contentWindow.docu ment.body.innerHTML + '">'; } catch (e) { text1.innerHTML = '<input type="hidden" name="text1" value="' + document.getElementById('edit').value + '">'; } return true; } Start(); //--> </script> <noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript> <p>Click submit to show the value of the text box.</p> <p><input type="submit" name="submit" value="Submit"></p> <span id="text1"> </span> </form> </td> </tr> </table> <?php include("includes/admin_footer.htm"); ?>
Any help would be GREATLY appreciated!
--Adam
|