SunQuest
           WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old December 18th, 2004, 06:35 AM
wonderphone wonderphone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 1 wonderphone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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 ?

Reply With Quote
  #2  
Old January 30th, 2005, 02:43 PM
counterzone counterzone is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 counterzone User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > java games download PHP programming ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway