paulman888888 Posted May 20, 2008 Share Posted May 20, 2008 I want to put this is my php code. <table width="100%" border="1" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="23%" rowspan="2"><table width="66%" border="1" bordercolor="#000000"><tr><td><center><img src="http://www.civage.com/team/images/paul.gif" alt="Demo" width="175" height="170" longdesc="demo" /> </center></td></tr><tr><td><center>In Game Screenshot</center></td></tr></table></td> <td width="68%" height="38"><strong>Area T9</strong></td> <td width="9%"><img src="../Images/flag/UK.png" alt="English" width="65" height="34" longdesc="English"></td></tr><tr><td colspan="2"><p>Size: 9.4mb<br /> Version: 1<br /> Type: Beta<br /> <a href="http://civage.com/downloads/index.php?act=view&id=7" target="_self" onMouseOver="MM_swapImage('Download','','../downloads/skins/old/images/download.gif',0)" onMouseOut="MM_swapImgRestore()"><img src="../downloads/skins/old/images/download.gif" alt="Download" name="Download" width="142" height="52" border="0"></a></p></td></tr> <tr> <td colspan="3"><center> Loads of mini games! </center> </td> </tr> </table> For my preloaded content but how do i get in the code? <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } // Send the preloaded content to the function. $content = freeRTE_Preload("THIS IS WHERE I WANT TO PUT THE FIRST CODE I GAVE YOU") ?> Thankyou for the help Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 um...like this? <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } ob_start(); ?> <table width="100%" border="1" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="23%" rowspan="2"><table width="66%" border="1" bordercolor="#000000"><tr><td><center><img src="http://www.civage.com/team/images/paul.gif" alt="Demo" width="175" height="170" longdesc="demo" /> </center></td></tr><tr><td><center>In Game Screenshot</center></td></tr></table></td> <td width="68%" height="38"><strong>Area T9</strong></td> <td width="9%"><img src="../Images/flag/UK.png" alt="English" width="65" height="34" longdesc="English"></td></tr><tr><td colspan="2"><p>Size: 9.4mb<br /> Version: 1<br /> Type: Beta<br /> <a href="http://civage.com/downloads/index.php?act=view&id=7" target="_self" onMouseOver="MM_swapImage('Download','','../downloads/skins/old/images/download.gif',0)" onMouseOut="MM_swapImgRestore()"><img src="../downloads/skins/old/images/download.gif" alt="Download" name="Download" width="142" height="52" border="0"></a></p></td></tr> <tr> <td colspan="3"><center> Loads of mini games! </center> </td> </tr> </table> <?php $contents = ob_get_clean(); $content = freeRTE_Preload($contents); ?> or...you can have the HTML in a seperate file...i'm gonna call it template.html <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } // Send the preloaded content to the function. $content = freeRTE_Preload(file_get_contents('template.html'); ?> Quote Link to comment Share on other sites More sharing options...
kev wood Posted May 20, 2008 Share Posted May 20, 2008 try using quotes around the table you want to enter i have created php pages with html in before and if you are asking what i think you are then it would be displayed like '<table> etc etc </table>' i have used this method when generating an html based email to be sent out using php. Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 try using quotes around the table you want to enter i have created php pages with html in before and if you are asking what i think you are then it would be displayed like '<table> etc etc </table>' i have used this method when generating an html based email to be sent out using php. I cant use that because my HTML page has ' in them so it makes errors. Anymore ideas? Thankyou Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted May 20, 2008 Share Posted May 20, 2008 rhodesa has the correct answers. Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 that doesn't work. The editor doesn't load or appear. this is the full code <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } // Send the preloaded content to the function. $content = freeRTE_Preload("THIS IS WHERE I WANT MY HTML CODE") ?> <form method="post" action="addgame.php"> <p>Name: <label> <input type="text" name="Name" id="Name" /> </label> </p> <p> <!-- Include the Free Rich Text Editor Runtime --> <script src="freerte_v1/js/richtext.js" type="text/javascript" language="javascript"></script> <!-- Include the Free Rich Text Editor Variables Page --> <script src="freerte_v1/js/config.js" type="text/javascript" language="javascript"></script> <!-- Initialise the editor --> <script> initRTE('<?= $content ?>', 'example.css'); </script> <input type="submit"> </p> </form> I how that helps. Please help Thankyou Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted May 20, 2008 Share Posted May 20, 2008 did you try or...you can have the HTML in a seperate file... ? Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 I have tryed all above. I don't know what to do or how i can help you help me. Thankyou anyway Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 woah...back up a sec...where is the 'content' that is going inside the editor coming from? the code you posted looks fine. try using real php tags instead of the short tags... initRTE('<?php echo $content; ?>', 'example.css'); <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } // Send the preloaded content to the function. $content = freeRTE_Preload("THIS IS WHERE I WANT MY HTML CODE") ?> <form method="post" action="addgame.php"> <p>Name: <label> <input type="text" name="Name" id="Name" /> </label> </p> <p> <!-- Include the Free Rich Text Editor Runtime --> <script src="freerte_v1/js/richtext.js" type="text/javascript" language="javascript"></script> <!-- Include the Free Rich Text Editor Variables Page --> <script src="freerte_v1/js/config.js" type="text/javascript" language="javascript"></script> <!-- Initialise the editor --> <script> initRTE('<?php echo $content; ?>', 'example.css'); </script> <input type="submit"> </p> </form> Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 OH...and a semicolon at the end of this line: $content = freeRTE_Preload("THIS IS WHERE I WANT MY HTML CODE"); Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 um...like this? or...you can have the HTML in a seperate file...i'm gonna call it template.html [code]<?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } // Send the preloaded content to the function. $content = freeRTE_Preload(file_get_contents('template.html'); ?> I have used that and what you said and it comes up with this error. Parse error: parse error, unexpected ';' in /home/www/notgiveingmyproperwebsite.com/addinggame2.php on line 13 [/code] Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 need an extra close parenthesis: $content = freeRTE_Preload(file_get_contents('template.html')); Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 All the code together should look like: <table width="100%" border="1" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC"> <tr><td width="23%" rowspan="2"><table width="66%" border="1" bordercolor="#000000"><tr><td><center><img src="http://www.civage.com/team/images/paul.gif" alt="Demo" width="175" height="170" longdesc="demo" /> </center></td></tr><tr><td><center>In Game Screenshot</center></td></tr></table></td> <td width="68%" height="38"><strong>Area T9</strong></td> <td width="9%"><img src="../Images/flag/UK.png" alt="English" width="65" height="34" longdesc="English"></td></tr><tr><td colspan="2"><p>Size: 9.4mb<br /> Version: 1<br /> Type: Beta<br /> <a href="http://civage.com/downloads/index.php?act=view&id=7" target="_self" onMouseOver="MM_swapImage('Download','','../downloads/skins/old/images/download.gif',0)" onMouseOut="MM_swapImgRestore()"><img src="../downloads/skins/old/images/download.gif" alt="Download" name="Download" width="142" height="52" border="0"></a></p></td></tr> <tr> <td colspan="3"><center> Loads of mini games! </center> </td> </tr> </table> <?php function freeRTE_Preload($content) { // Strip newline characters. $content = str_replace(chr(10), " ", $content); $content = str_replace(chr(13), " ", $content); // Replace single quotes. $content = str_replace(chr(145), chr(39), $content); $content = str_replace(chr(146), chr(39), $content); // Return the result. return $content; } ?> <form method="post" action="addgame.php"> <p>Name: <label> <input type="text" name="Name" id="Name" /> </label> </p> <p> <!-- Include the Free Rich Text Editor Runtime --> <script src="freerte_v1/js/richtext.js" type="text/javascript" language="javascript"></script> <!-- Include the Free Rich Text Editor Variables Page --> <script src="freerte_v1/js/config.js" type="text/javascript" language="javascript"></script> <!-- Initialise the editor --> <script> initRTE('<?php freeRTE_Preload(file_get_contents('template.html')); ?>', 'example.css'); </script> <input type="submit"> </p> </form> Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 The template still doesn't load or work but i dont want to waste anymore of your time. Don't reply if you got more important things to do. Thankyou all anyway Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 On the page, do a View Source, and copy/paste the contents here. It could be the JS library you are using too... Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 This is the page source from FIREFOX. <form method="post" action="addgame.php"> <p>Name: <label> <input type="text" name="Name" id="Name" /> </label> </p> <p> <!-- Include the Free Rich Text Editor Runtime --> <script src="freerte_v1/js/richtext.js" type="text/javascript" language="javascript"></script> <!-- Include the Free Rich Text Editor Variables Page --> <script src="freerte_v1/js/config.js" type="text/javascript" language="javascript"></script> <!-- Initialise the editor --> <script> initRTE('', 'freerte_v1/examples/example.css'); </script> <input type="submit"> </p> </form> Hope it helps Quote Link to comment Share on other sites More sharing options...
rhodesa Posted May 20, 2008 Share Posted May 20, 2008 ha...it's always something small...forgot the echo... initRTE('<?php echo freeRTE_Preload(file_get_contents('template.html')); ?>', 'example.css'); Quote Link to comment Share on other sites More sharing options...
paulman888888 Posted May 20, 2008 Author Share Posted May 20, 2008 EDIT: Doesn't matter now. Thankyou Quote Link to comment 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.