tooletime
10-14-2010, 07:04 PM
i need help bad. It might be an easy fix but i cant figure it out to save my life.
Here is what i am trying to accomplish. I want to show a link if a file exists on a remote server. That part works. The problem i am having is having the link actually open the dhtml window when the link appears.
Its in php 5.3 now
The script that works is this:
[ICODE]<a href='#' onClick="readmewin=dhtmlwindow.open('README', 'iframe', 'file:////bas-vm01/iso/docs/CM11886.pdf', 'README for CM<?php echo $row_Master_Detail_Recordset['ID']; ?>.pdf ', 'width=500px,height=300px,center=1, resize=1'); return false">README</a>;[ICODE]
so that link opens up the window and shows me the pdf. WONDERFUL!! :)
Now the part that i need to work
[CODE]
<?php
$id = $_GET['ID'];
$path = '//bas-vm01/iso/docs/cm';
$filename= $path.$id.'.pdf';
if (file_exists($filename))
echo '<a href="#" onClick="readmewin=dhtmlwindow.open(\'readme\', \'iframe\', \'$filename\', \'README for CM<?php echo $row_Master_Detail_Recordset[\'ID\']; ?>.pdf \', \'width=500px,height=300px,center=1, resize=1\'); return false">README</a>';
else
echo "The file $filename does not exist";
?>
[CODE]
So the link shows up if the file exists or the else statements shows up. So that part works.
The part that doesn't work is the link to the dhtml window.
PLEASE HELP!!! its gotta be something simple im sure LOL
Here is what i am trying to accomplish. I want to show a link if a file exists on a remote server. That part works. The problem i am having is having the link actually open the dhtml window when the link appears.
Its in php 5.3 now
The script that works is this:
[ICODE]<a href='#' onClick="readmewin=dhtmlwindow.open('README', 'iframe', 'file:////bas-vm01/iso/docs/CM11886.pdf', 'README for CM<?php echo $row_Master_Detail_Recordset['ID']; ?>.pdf ', 'width=500px,height=300px,center=1, resize=1'); return false">README</a>;[ICODE]
so that link opens up the window and shows me the pdf. WONDERFUL!! :)
Now the part that i need to work
[CODE]
<?php
$id = $_GET['ID'];
$path = '//bas-vm01/iso/docs/cm';
$filename= $path.$id.'.pdf';
if (file_exists($filename))
echo '<a href="#" onClick="readmewin=dhtmlwindow.open(\'readme\', \'iframe\', \'$filename\', \'README for CM<?php echo $row_Master_Detail_Recordset[\'ID\']; ?>.pdf \', \'width=500px,height=300px,center=1, resize=1\'); return false">README</a>';
else
echo "The file $filename does not exist";
?>
[CODE]
So the link shows up if the file exists or the else statements shows up. So that part works.
The part that doesn't work is the link to the dhtml window.
PLEASE HELP!!! its gotta be something simple im sure LOL