|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
java games download PHP programming ?
Hi fellows !
I'm not english so i'm going to try to explain myself the best I can. In order to program an application for java game download, i'm trying to force download so the user won't be able to download the game if he got the link ( i putted an .htaccess in game folder ). Here is the link from the page that lists the games : <a href="force.php?jadpath=$file[url]">mario</a> here is force.php download script : if (isset($_REQUEST['jarpath'])){ $file=fopen($_REQUEST['jarpath'],"rb"); header("Content-Type: application/java-archive"); header("Content-Disposition: filename=".basename($_REQUEST['jarpath'])); fpassthru($file); }elseif(isset($_REQUEST['jadpath'])) { $myfile=fopen($_REQUEST['jadpath'],"rb"); header("Content-Type: text/vnd.sun.j2me.app-descriptor"); header("Content-Disposition: filename=".basename($_REQUEST['jadpath'])); fpassthru($myfile); } here is a sample of the mario.jad file : MIDlet-Jar-URL: ../force.php?jarpath=uploads/mario.jar but it do not work. Have you got an idea ? |
|
#2
|
|||
|
|||
|
Simply, edit httpd.conf file
Append in your httpd.conf file follow lines:
AddType text/vnd.sun.j2me.app-descriptor .jad AddType application/java-archive .jar From php code, use only : header("Content-Type: text/vnd.sun.j2me.app-descriptor"); header("Content-Disposition: filename=".basename($_REQUEST['jadpath'])); In midlet jar file, use : MIDlet-Jar-URL: path_to_jar_file/mario.jar |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > WAP Programming > java games download PHP programming ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|