hi together, following problem:
My Code:
<script type="text/javascript">
function test(funcNum,url)
{
window.parent.CKEDITOR.tools.callFunction('funcNum','url','');
window.close();
}
</script>
<?php
include "config.php";
include "funktionen.php";
@mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());
mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());
session_start();
if(!isset($_SESSION['id']))
header ("Location: index.php");
echo '<link rel="stylesheet" type="text/css" href="style.css">';
$funcNum=(int)$_GET['CKEditorFuncNum'];
if($files=scandir(...directory...))
{
for($i=0;$i<count($files);$i++)
{
if(!is_dir('...directory.../'.$files[$i]))
{
if($files[$i]!=".htaccess" && $files[$i]!=".htpasswd" && $files[$i]!="404.php" && $files[$i]!="index.php")
{
echo "<input type='image' src='...directory.../".$files[$i]."' height='100' onclick=test('$funcNum','TEST');>";
}
}
}
}
?>
Problem: the test function won't send the url to the ckeditor.
if i remove the callfunction-line, it's closing the window.
so the test function is called.
but when i add the line nothing happens.
i searched the forum for almost 3 hours and tried several things but nothing worked?
Thx
My Code:
<script type="text/javascript">
function test(funcNum,url)
{
window.parent.CKEDITOR.tools.callFunction('funcNum','url','');
window.close();
}
</script>
<?php
include "config.php";
include "funktionen.php";
@mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());
mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());
session_start();
if(!isset($_SESSION['id']))
header ("Location: index.php");
echo '<link rel="stylesheet" type="text/css" href="style.css">';
$funcNum=(int)$_GET['CKEditorFuncNum'];
if($files=scandir(...directory...))
{
for($i=0;$i<count($files);$i++)
{
if(!is_dir('...directory.../'.$files[$i]))
{
if($files[$i]!=".htaccess" && $files[$i]!=".htpasswd" && $files[$i]!="404.php" && $files[$i]!="index.php")
{
echo "<input type='image' src='...directory.../".$files[$i]."' height='100' onclick=test('$funcNum','TEST');>";
}
}
}
}
?>
Problem: the test function won't send the url to the ckeditor.
if i remove the callfunction-line, it's closing the window.
so the test function is called.
but when i add the line nothing happens.
i searched the forum for almost 3 hours and tried several things but nothing worked?
Thx
Re: File Browsing not working
Or is it too obvious? Or do you need any further information?
I'd really be happy if anyone could help me....
Re: File Browsing not working
try this one
Re: File Browsing not working
I now simplified my Code to find the bug easier, but it's still not working:
<script type="text/javascript">
function test(funcNum,url)
{
window.parent.CKEDITOR.tools.callFunction(funcNum,url,'');
window.close();
}
</script>
<?php
$funcNum=$_GET['CKEditorFuncNum'];
echo "<input type='button' name='egal' value='senden' onclick=test('$funcNum','TEST');>";
?>
Could anyone here tell me what i could do anymore to find the bug?
Re: File Browsing not working
I just missed the File with the example code.
It's well hidden!
You need to use:
window.opener.CKEDITOR.tools.callFunction
instead of:
window.parent.CKEDITOR.tools.callFunction
I'm sorry for boring all of You.