paradoxmime Posted July 28, 2009 Share Posted July 28, 2009 I have a search result page that displays a link to a file if the file exists. I want to instead create another page that contains some java that I want to use to embed a pdf instead of trying to open the file with Adobe reader or any pdf reader. I need to pass 2 variables when the link is clicked. Those 2 variables are then caught by the page with the java on it and the correct location of the file will then display the PDF in the applet. My question is whether to pass those variables using php or using hidden form fields. It's been years since I've worked on my site and I have no idea what or how to do it. Link to comment https://forums.phpfreaks.com/topic/167852-php-or-basic-form-method/ Share on other sites More sharing options...
WolfRage Posted July 28, 2009 Share Posted July 28, 2009 Is the Java applet secure? If it is then just pass them with hidden form vars. But if you need PHP to protect your Java applet then use PHP to intercept the form and clean the variables before passing them to the Java applet. With out further information can't help beyond that. Link to comment https://forums.phpfreaks.com/topic/167852-php-or-basic-form-method/#findComment-885322 Share on other sites More sharing options...
paradoxmime Posted July 28, 2009 Author Share Posted July 28, 2009 Yes, I believe it is secure. Not so much the applet but the location of the pdf's are secured with cgi scripting. Trying to load the page without passing through the security measure would just show the java loader with no file. Link to comment https://forums.phpfreaks.com/topic/167852-php-or-basic-form-method/#findComment-885447 Share on other sites More sharing options...
paradoxmime Posted July 29, 2009 Author Share Posted July 29, 2009 here is the simple code for the page with the java: <?php echo "<applet src=\"EmbedPDF.class\" archive=\"EmbedPDF.jar\" width=\"900\" depth=\"500\"><param name=\"pdf\" value=\"http://".$_SERVER["HTTP_HOST"]."/Designers/".$row_Recordset2['Des_ID']."/pdf/review/".$row_Recordset2['Review_PDF']."\"<a href=\"http://".$_SERVER["HTTP_HOST"]."/Designers/".$row_Recordset2['Des_ID']."/pdf/review/".$row_Recordset2['Review_PDF']."\"><strong>Click Here</strong></a></applet>" ; ?> The two variables are Des_ID and Review_PDF Link to comment https://forums.phpfreaks.com/topic/167852-php-or-basic-form-method/#findComment-885452 Share on other sites More sharing options...
WolfRage Posted July 30, 2009 Share Posted July 30, 2009 I think that what you have will do just fine, you have ensured that the applet is only reading files with in the server, so you should be fine with out additional PHP so long as your CGI is good. Link to comment https://forums.phpfreaks.com/topic/167852-php-or-basic-form-method/#findComment-887101 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.