abeer Posted June 21, 2011 Share Posted June 21, 2011 Hi there... plese check the below url fisrt http://www.rintlbd.com/update4.php look ck editor is loding nicely . but when i am going to the url http://www.rintlbd.com/update4.php/?id=1 or http://www.rintlbd.com/update4.php/?id=2 .. then the ck editor disappers here is my code with ck ediotr intregration <?php $hostname = "sql1";$username = "plegu";$password = "plegu";//Connect to database $db = mysql_connect($hostname, $username, $password) or die ("not able to connected to mysql");mysql_select_db("plegu")or die("Connection Failed");//Check if form was POSTed if(isset($_POST['id'])){ //Update record if POST data submitted $id = (int) $_POST['id']; $content = mysql_real_escape_string($_POST['content']); $sql="UPDATE page SET dtl='$content' WHERE id = $id"; mysql_query($sql) or die(mysql_error()); if(mysql_affected_rows()>0) { $message = "<span style=\"\">The data was sucessfully saved</span>"; } else { $message = "<span style=\"color:red;\">There was a problem saving the data.</span>"; }}elseif(isset($_GET['id'])){ //Get ID from query string $id = (int) $_GET['id'];}else{ $message = "<span style=\"color:red;\">No record ID available.</span>";}if(isset($id)){ //Get current value for selected record $sql = "SELECT `id`, `dtl` FROM `page` WHERE `id` = $id"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result);}mysql_close($db);?> <html> <head><head><script type="text/javascript" src="js/ckeditor/ckeditor.js"></script></head> <body> <?php echo $message; ?></span><form name="change_content" method="POST" action="update4.php"><input type="hidden" name="id" value="<?php echo $row["id"]; ?>"><textarea name="content"><?php echo $row["dtl"]; ?></textarea> <script type="text/javascript"> CKEDITOR.replace( 'content', { filebrowserBrowseUrl :'/blog/js/ckeditor/filemanager/browser/default/browser.html?Connector=http://kodemaster.co.cc/filemanager_in_ckeditor/js/ckeditor/filemanager/connectors/php/connector.php', filebrowserImageBrowseUrl : '/blog/js/ckeditor/filemanager/browser/default/browser.html?Type=Image&Connector=http://kodemaster.co.cc/filemanager_in_ckeditor/js/ckeditor/filemanager/connectors/php/connector.php', filebrowserFlashBrowseUrl :'/blog/js/ckeditor/filemanager/browser/default/browser.html?Type=Flash&Connector=http://kodemaster.co.cc/filemanager_in_ckeditor/js/ckeditor/filemanager/connectors/php/connector.php', filebrowserUploadUrl :'http://sqadbd-enews.com/blog/js/ckeditor/filemanager/connectors/php/upload.php?Type=File', filebrowserImageUploadUrl : 'http://sqadbd-enews.com/blog/js/ckeditor/filemanager/connectors/php/upload.php?Type=Image', filebrowserFlashUploadUrl : 'http://sqadbd-enews.com/blog/js/ckeditor/filemanager/connectors/php/upload.php?Type=Flash' }); //]]> </script> <input type="submit" value="change"></form></body></html> waiting for yours kind help Quote Link to comment https://forums.phpfreaks.com/topic/239998-ek-editor-is-not-loading-help-needed/ Share on other sites More sharing options...
Alex Posted June 21, 2011 Share Posted June 21, 2011 It's not a PHP problem. Your issue is that when accessing the page from the other URLs the relative path for the JavaScript file gets messed up. For example, when accessing from another URL the file it tries to access is: http://www.rintlbd.com/update4.php/js/ckeditor/ckeditor.js Which isn't the right file. To fix this you can change it to an absolute path: <script type="text/javascript" src="/js/ckeditor/ckeditor.js"></script> /js/ckeditor/ckeditor.js instead of js/ckeditor/ckeditor.js Quote Link to comment https://forums.phpfreaks.com/topic/239998-ek-editor-is-not-loading-help-needed/#findComment-1232815 Share on other sites More sharing options...
abeer Posted June 21, 2011 Author Share Posted June 21, 2011 thanks Mate. problem solved thanks again Quote Link to comment https://forums.phpfreaks.com/topic/239998-ek-editor-is-not-loading-help-needed/#findComment-1232816 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.