Jump to content

ek editor is not loading ( help needed)


abeer

Recommended Posts

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

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/239998-ek-editor-is-not-loading-help-needed/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.