adam291086 Posted September 2, 2008 Share Posted September 2, 2008 i have a simple switch statement switch ($status) { case delete: if(is_file($filename)) { unlink($filename); } else { remove_dir($filename); } break; case download: break; and in the case of download i want to include the javascript file <script type="text/javascript" src="/admin/FTP/script/ftp.js"> and run the function call popup from there. How can i do this? Link to comment https://forums.phpfreaks.com/topic/122354-solved-switch-statment-running-javascript-function/ Share on other sites More sharing options...
BlueSkyIS Posted September 2, 2008 Share Posted September 2, 2008 simply echo that line of .js in your output, wherever you need it to go: switch ($status) { case delete: if(is_file($filename)) { unlink($filename); } else { remove_dir($filename); } break; case download: echo "<script type='text/javascript' src='/admin/FTP/script/ftp.js'>"; break; } Link to comment https://forums.phpfreaks.com/topic/122354-solved-switch-statment-running-javascript-function/#findComment-631886 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.