paddymull Posted March 29, 2008 Share Posted March 29, 2008 hi all i need help big time lol Ive been trying to fix this for days but am well stuck :-\ what it is i have created a simple php form that sends the information submitted in the form to another php page. i have added a WYSIWYG html editor to the textarea form so i can send html to the next page. it all works fine what ever i create in the WYSIWYG form gets sent to the next page. The problem is if i add any links or images to the WYSIWYG form when there sent to the other side they get messed up and the links are wrong and the images don't show up. this is what it does to a link . the link should be http://www.ebay.com/ but it turns it to http://pmb-web-designs.co.uk/%22http://www.ebay.com/%22 and the image html should be <IMG class=screenshot height=240 alt="Earth Hour website" src="http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg" width=300> but it turns it to <IMG class=screenshot height=240 alt=\"Earth Hour website\" src=\"http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg\" width=300> why is that ?? and how do i fix it ??? a live demo can be seen here http://pmb-web-designs.co.uk/test/test.html please please please some one help thanks from Patrick Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/ Share on other sites More sharing options...
MadTechie Posted March 29, 2008 Share Posted March 29, 2008 test didn't show a WYSIWYG but i pasted in <IMG class=screenshot height=240 alt="Earth Hour website" src="http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg" width=300> and the quotes were escaped but other than that it should of worked, no prefix of the domain name without seeing any code i would guess your using addslashes(); or have magic quotes on Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503729 Share on other sites More sharing options...
paddymull Posted March 29, 2008 Author Share Posted March 29, 2008 test didn't show a WYSIWYG but i pasted in <IMG class=screenshot height=240 alt="Earth Hour website" src="http://www.google.co.uk/intl/en_uk/earthhour/screenshot.jpg" width=300> and the quotes were escaped but other than that it should of worked, no prefix of the domain name without seeing any code i would guess your using addslashes(); or have magic quotes on It should have shown WYSIWYG it does when i click on it, sorry dont understand your reply? am trying to send what every i put in the textarea form to show up on the next page. but it changes the html of links and images. how do i stop this??? the code i have used is below test.html <html> <head> <script language="JavaScript" type="text/javascript" src="wysiwyg.js"></script> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> </head> <body background=""> <center> <table height="100%" cellSpacing="0" cellPadding="0" width="980" border="0" id="table1"> <tr> <td width="965" background="" bgColor="#ffffff"> <div align="center"> <table height="145" cellSpacing="0" cellPadding="0" width="980" border="0" id="table2"> <tr> <td width="978" height="27"> <p align="left"></td> </tr> </table> </div> </td> </tr> <tr> <td width="978" bgColor="#ffffff"> <div align="center"> <table height="325" cellSpacing="0" cellPadding="0" width="100%" border="0" id="table3"> <tr> <td width="88%" background="" height="209"> <div align="center"> <table height="1" cellSpacing="0" cellPadding="0" width="980" border="0" id="table4"> <tr> <td vAlign="top" width="974" height="1" background=""> <div align="center"> <table cellSpacing="0" cellPadding="0" width="969" border="0" id="table5" height="421"> <tr> <td width="205" valign="top"> <div align="center"> <table border="0" width="169" cellspacing="0" cellpadding="0" id="table6"> <tr> <td> <font face="Verdana" size="2" color="#333333"> <p align="left"> </td> </tr> </table> </div> <p> <html> <body bgcolor="#FFFFFF" leftMargin=10 topMargin=10 marginheight="10" marginwidth="10" > </body> </html></td> <td width="571" valign="top"> <font face="Verdana" color="#333333" size="2"> <form action="listing2.php" method="POST" target="_blank"> </div><b>Item Title</b><br> <input type="text" name="itemtitle" size=40> <p><b>Item Description</b><br> <textarea cols=68 rows=15 name="message"></textarea><script language="JavaScript"> generate_wysiwyg('message'); </script> <p><input type="submit" value=" Create"></td> <td width="193" valign="top"> <div align="center"> <table border="0" width="169" cellspacing="0" cellpadding="0" id="table7"> <tr> <td> </td> </tr> </table> </div> <p> </td> </tr> </table> </div> </td> </tr> </table> </div> </td> </tr> <tr> <td width="88%" height="19"> </td> </tr> </table> </div> </td> </tr> <tr> <td width="978"> </td> </tr> </table> </center> </body> </html> listing2.php <?php /* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */ $itemtitle = $HTTP_POST_VARS['itemtitle']; $a = $HTTP_POST_VARS['a']; $message = $HTTP_POST_VARS['message']; ?> <?php echo $itemtitle ?><p> <?php echo $message ?> please help Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503738 Share on other sites More sharing options...
MadTechie Posted March 29, 2008 Share Posted March 29, 2008 try this <?php /* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */ $itemtitle = $HTTP_POST_VARS['itemtitle']; $a = $HTTP_POST_VARS['a']; $message = $HTTP_POST_VARS['message']; //magic quotes fix $message= (get_magic_quotes_gpc())?stripslashes($message):$message; } ?> <?php echo $itemtitle ?><p> <?php echo $message ?> Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503745 Share on other sites More sharing options...
paddymull Posted March 29, 2008 Author Share Posted March 29, 2008 You are a star mate ;D ;D ;D ;D that worked i had to delet the } part on line 10 but when i did it works thanks again mate you have well helped me out Thanks thanks thanks Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503749 Share on other sites More sharing options...
MadTechie Posted March 29, 2008 Share Posted March 29, 2008 the magic quotes fix should work anytime you have that problem, if magic quotes are off the code will still work, but read this for more info Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503750 Share on other sites More sharing options...
paddymull Posted March 29, 2008 Author Share Posted March 29, 2008 thanks mate still having problems with that image upload tho i would have for it would have been easy to solve but there must be other parts in the code that needs changing but thanks for fixing this one for me mate Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503755 Share on other sites More sharing options...
MadTechie Posted March 29, 2008 Share Posted March 29, 2008 as for the prefixing of the domain name, i think the WYSIWYG you have maybe messing it up, i am using Firefox and didn't even see the WYSIWYG ! Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503757 Share on other sites More sharing options...
paddymull Posted March 29, 2008 Author Share Posted March 29, 2008 your right mate just checked it my self in firefox and it doesn't show up i will try using another WYSIWYG thanks Quote Link to comment https://forums.phpfreaks.com/topic/98432-help-with-wysiwyg-html-editer-php-form/#findComment-503760 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.