Mobile Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreMobile 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:
  #1  
Old July 17th, 2007, 10:43 PM
Northern Flame Northern Flame is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 8 Northern Flame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 44 sec
Reputation Power: 0
WML - PHP script isn't working, is their an alternative?

I am creating a ringtone website and I designed it so that the user can browse all my ringtones through his/her mobile phone, and once he/she clicks on a ringtone he wants, it will automatically download. The PHP script works fine on my computer, but when trying this on my phone, I get an error message.
Heres my script:

this page is called download.php
Code:
<?php

$saveName = stripslashes($_GET["name"]);
$savePath = stripslashes($_GET["path"]);

header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$saveName");
header("Content-Transfer-Encoding: binary");

header("Content-length: " . filesize($savePath));

readfile($savePath);

?>


Anf on the actual wap site I use this link to download the ringtones:
Code:
<a href="download.php?name=ringtone.qcp&path=/qcp/ringtone.qcp">Download Ringtone</a>


Why wont this work on a phone?

and if it is not possible for this to work on a phone, is their an alternative way to have my users download a ringtone?

Reply With Quote
  #2  
Old July 17th, 2007, 10:59 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Click here for more information.
 
Join Date: Feb 2002
Location: Finland
Posts: 8,910 jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 4 Weeks 1 Day 10 h 50 sec
Reputation Power: 1693
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Hi Northern Flame, welcome to Dev Shed.

Please take a look at the FAQs on please read ... and then try to explain what "doesn't work" actually means

You say you have an error message - what error's do you get?
What phone are your trying to use? Got a working link?

doesn't work    
Comments on this post
ryon420 agrees: Beaten again, someone distracted me.
__________________
Cheers,

Jamie

# mdb4u | mobile movie database] | Please help to test and promote
# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.



__________________

Last edited by jabba_29 : July 17th, 2007 at 11:02 PM.

Reply With Quote
  #3  
Old July 17th, 2007, 11:01 PM
ryon420's Avatar
ryon420 ryon420 is offline
Just here for comic relief
Click here for more information
 
Join Date: Jun 2006
Location: Was lost, then found, now lost again.
Posts: 3,134 ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 5 Months 3 Weeks 5 Days 14 h 6 m 37 sec
Reputation Power: 1018
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
Hello Northern Flame, and welcome to Dev Shed!
Quote:
I get an error message.

What is the error message?
Comments on this post
jabba_29 agrees: Gotta be quick in here
Axweildr agrees: for your helpful attitude
__________________

Warning, the post above may contain extreme sarcasm, crude language, and code that may confuse amateurs and professionals.


Helpful stuff: Google your question first | Read the rules | How to ask a question | Read the [PHP] manual, it is good for you
Proud supporter of: Philosophorum - "where even the trolls are smart" | Chikyu Hakken - digging for trolls
"Slow and steady wins the race doesn't apply to programming with a deadline" -- Me


Reply With Quote
  #4  
Old July 18th, 2007, 12:12 AM
Northern Flame Northern Flame is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 8 Northern Flame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 44 sec
Reputation Power: 0
Sorry about that,
the message I get is "Content Type Not Recognized"
and when I tried linking directly to the ringtone
Code:
<a href="/qcp/ringtone.qcp">Ringtone Name</a>


I get an "500 Internal Server Error"

The phone I use is a Motorola and my service provider is Metro PCS, I know that my phone accepts QCP ringtones because I have used a free service before to send my ringtones to my phone, I believe it was called "Mobilatory Send To Phone".
And, when I record something through my phone it saves as QCP (PureVoice File)

Reply With Quote
  #5  
Old July 18th, 2007, 12:24 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Click here for more information.
 
Join Date: Feb 2002
Location: Finland
Posts: 8,910 jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 4 Weeks 1 Day 10 h 50 sec
Reputation Power: 1693
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Does your server understand what that file type is?

If you are on an Apache host,
you should (provided you have correct permissions) be able to add the following
into .htaccess file in your root directory.
apache Code:
Original - apache Code
  1. AddType audio/vnd.qcelp .qcp 


Better still to add to your actual httpd.conf file,
but if you are on shared hosting you probably won't be able to.

Let us know if this helps.

See this article, should help you out a bit.
Contains links to useful resource site too.

Last edited by jabba_29 : July 18th, 2007 at 12:26 AM. Reason: added link

Reply With Quote
  #6  
Old July 18th, 2007, 12:34 AM
Northern Flame Northern Flame is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 8 Northern Flame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 44 sec
Reputation Power: 0
I am on a shared host,
but so far my host company has
been able to add anything
I request, So I will ask about this,
thanks for the help and I will
reply if this works

Reply With Quote
  #7  
Old July 18th, 2007, 01:08 AM
Northern Flame Northern Flame is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 8 Northern Flame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 44 sec
Reputation Power: 0
wooo hoooo!!!!!
it worked!
well, now I can view the QCP file,
how do I make it downloadable to a mobile phone?

Reply With Quote
  #8  
Old July 18th, 2007, 01:37 AM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Click here for more information.
 
Join Date: Feb 2002
Location: Finland
Posts: 8,910 jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 4 Weeks 1 Day 10 h 50 sec
Reputation Power: 1693
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
Have you tried application/force-download instead of
application/octet-stream?

Reply With Quote
  #9  
Old July 18th, 2007, 08:02 PM
Northern Flame Northern Flame is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 8 Northern Flame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 44 sec
Reputation Power: 0
um....
I dont know what that is lol,
can you explain please?

Reply With Quote
  #10  
Old July 18th, 2007, 08:09 PM
ryon420's Avatar
ryon420 ryon420 is offline
Just here for comic relief
Click here for more information
 
Join Date: Jun 2006
Location: Was lost, then found, now lost again.
Posts: 3,134 ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)ryon420 User rank is General 1st Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 5 Months 3 Weeks 5 Days 14 h 6 m 37 sec
Reputation Power: 1018
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
In your header() function:
PHP Code:
 header("Content-Type: application/force-download"); 
Comments on this post
jabba_29 agrees: Yep, that's what I meant.

Reply With Quote
  #11  
Old July 18th, 2007, 09:47 PM
Northern Flame Northern Flame is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 8 Northern Flame User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 44 sec
Reputation Power: 0
oh lol,
where do i place this?

Reply With Quote
  #12  
Old July 18th, 2007, 09:51 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Click here for more information.
 
Join Date: Feb 2002
Location: Finland
Posts: 8,910 jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)jabba_29 User rank is General 11st Grade (Above 100000 Reputation Level)