Jump to content

[SOLVED] php on mobile phones


Northern Flame

Recommended Posts

im trying to make a ringtone website but im have trouble

getting the ringtones to the phones LOL,

im not to familiar with the way phones read

the coding on websites, and when i tried to make

a php script that forces the download when clicked on,

it didnt work! it works on my computer, but my phone

just gives me an error message. Im starting to think

its because phones dont accept PHP or something

but i dont know.

the link tag looks like this:

 

<a href="download.php?name=ringtone.mp3&path=/mp3/ringtone.mp3">Ringtone</a>

 

I dont know, maybe i did something wrong with the tag, and the PHP script I used to force the download is:


<?php

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

//send headers to initiate a binary download
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$saveName");
header("Content-Transfer-Encoding: binary");

//set file length so browser can calculate download time
header("Content-length: " . filesize($savePath));

//read file
readfile($savePath);

?>

 

Anyone know if phones accept PHP or if I just messed up the script?

Link to comment
https://forums.phpfreaks.com/topic/59391-solved-php-on-mobile-phones/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.