Hello
Good morning!
The present code that is used below for the FCKeditor to work on a server on the Internet and works perfectly.
I would like to achieve by running this code on my computer at localhost.
<?php $hostname = "localhost"; $database = "intranet"; $username = "root"; $password = "psiqur"; $login = mysql_connect ( $hostname, $username, $password ) or trigger_error ( mysql_error(),E_USER_ERROR ); mysql_select_db ( $database ); ?> <script type="text/javascript" src="fckeditor.js"></script> <script type="text/javascript"> window.onload = function() { var oFCKeditor = new FCKeditor( 'texto' ) ; oFCKeditor.BasePath = '' ; oFCKeditor.ReplaceTextarea() ; oFCKConfig.EditorAreaCSS = './css/estilos.css' ; } </script> <a href="editor.php?tipo=site_imagens&id=1&fazer=editar" class="azul"><b>[site imagens]</b></a><br><br> <table cellpadding="0" cellspacing="0" border="0" width="820"> <? $verf = $_GET['listar']; if ($verf != ""){ $listar = $_GET['listar']; }else{ $listar = $_POST['listar']; } if ($listar != ""){ // inicio listar if ($listar == "site_imagens"){ $sql = mysql_query("SELECT * FROM site_imagens"); ?> <tr> <td colspan="4" align="center" valign="middle"><br><a href="editor.php?tipo=site_imagens&fazer=inserir"><b>[Inserir Novo Registo]</b></a><br><br></td> </tr> <tr bgcolor="#B4CE07" align="center" class="branco"> <td></td> <td></td> </tr> <? while($row = mysql_fetch_array($sql)) { $id = $row["id"]; $site_imagens = $row["site_imagens"]; ?> <tr> <td height="50"><?=$site_imagens ?></td> <td align="center" valign="middle"></td> </tr> <? } } //fim listar }else{ $verf1 = $_REQUEST['tipo']; $tipo = $_REQUEST['tipo']; $fazer = $_REQUEST['fazer']; $id = $_REQUEST['id']; $site_imagens = $_REQUEST['site_imagens']; //inicio acções if ($tipo == "site_imagens"){ if ($fazer == "inserir"){ if ($accao == "ok"){ $sql = mysql_query("INSERT INTO `site_imagens` (`site_imagens`) VALUES ('$site_imagens');"); echo ("<div align=center>Registo inserido com sucesso.</div>"); }else{ ?> <tr> <td> <form name="form" action="editor.php" method="POST"> <table align="center" width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="#EAEAEA"> <input name="tipo" value="site_imagens" type="hidden" /> <input name="fazer" value="inserir" type="hidden" /> <input name="accao" value="ok" type="hidden" /> <tr> <td></td> <td> </td> </tr> <tr> <td></td> <td><textarea id="textarea" name="site_imagens" rows="35" cols="120"><?=$site_imagens ?> </textarea> <input type="submit" name="Inserir" value="Inserir" /></td> </tr> </table> </form> </td> </tr> <? } } if ($fazer == "editar"){ if ($accao == "ok"){ $sql = mysql_query("UPDATE site_imagens SET site_imagens = '$texto' WHERE id = '$id'"); echo ("<div align='center' valign='bottom' class='azul'>Registo editado com sucesso.</div>"); }else{ $sql = mysql_query("SELECT * FROM site_imagens WHERE id = $id LIMIT 1"); while($row = mysql_fetch_array($sql)) { $id = $row["id"]; $site_imagens = $row["site_imagens"]; } ?> <tr> <td align="center" height="20"></td> </tr> <tr> <td align="center" valign="middle"><div class="azul">site_imagens </div> <form name="form" action="editor.php" method="POST"> <table align="top" width="810" cellpadding="0" cellspacing="0" border="0"> <input name="tipo" value="site_imagens" type="hidden" /> <input name="fazer" value="editar" type="hidden" /> <input name="accao" value="ok" type="hidden" /> <input name="id" value="<?=$id ?>" type="hidden" /> <tr> <td> </td> <td align="center" valign="top"><textarea id="site_imagens" name="texto" rows="35" cols="120"><?=$site_imagens ?></textarea></td> </tr> <tr> <td></td> <td align="left" valign="top"><input type="submit" name="Editar" value="Editar" class="botao"/></td> </tr> </table> </form> </td> </tr> <? } } if ($fazer == "apagar"){ $sql = mysql_query("DELETE FROM site_imagens WHERE id = $id LIMIT 1"); echo ("<div align=center>Registo apagado com sucesso.</div>"); } //fim acções }} ?> </table>
Re: FCKeditor does not work on my computer
If so, then the PHP interpreter doesn't parse code between <? ?> but only between <?php ?>.
I recommend changing <? to <?php instead of changing the setting.
Re: FCKeditor does not work on my computer
hello Kon
Thanks for reply
in fact i have 'short_open_tag' disabled in my php.ini
i did not changed the settings
Instead I did what you recommend, changing all code <? to <?php
but now the browser does not appear anything even the code html .
Re: FCKeditor does not work on my computer
and check if there is something wrong.
Re: FCKeditor does not work on my computer
first of all, excuse my English i'm from Portugal.
i put the code error_reporting (E_ALL); ini_set ( 'display_errors', 1);
and reported several errors as Notice: Undefined index: listar in /home/divercom/public_html/dmaisnews/admin/editor.php on line 158
As I said before, I have no problem with this code online only to work in local server.
the error mentioned above is also reported under code with <? code ?>
i did an experience to put on line the two diferent code, one with <? code ?> and the other with <?php code ?> and only the <? code ?> works.
there is a slight difference in the change of code in the form that is when I change <?=$inicio ?> by <?php $inicio ?> does not working well
I think the problem is there
i put the form below
Thanks!
Re: FCKeditor does not work on my computer
You have to put an echo in front, otherwise it will be siltenly ignored by PHP and not be echoed to the HTML.
Re: FCKeditor does not work on my computer
i all ready change
Re: FCKeditor does not work on my computer
I think I found the solution to my problem:
i changed the register_globals to on
By now I can edit the FCKeditor in the local server.
Thanks a lot!