Latest news from Xavier Media
It is currently Sun Dec 08, 2013 12:24 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: <a href = php function?
PostPosted: Wed Feb 28, 2007 7:16 pm 

Points:
can I use a link on a web page to call a function?
example
Code:
<?php
function test($file,$path){
  //force download an mp3 file
}
?>
<html>
<head>
<title>test</title>
</head>
<body>
<a href="<?php test(Rom1_1.mp3, Romans/Rom1_1.mp3); ?>">click here</a>

</body>
</htm>


basically I just want to force download an MP3 file. force download code below

Code:
<?php
$mp3Name ="Rom1_1.mp3";
$filename = "Romans/Rom1_1.mp3";

header("Content-Length: " . filesize($filename));
header('Content-Type: audio/mpeg');
header("Content-Disposition: attachment; filename= $mp3Name");

readfile($filename);
?>


I've been trying without success! what am I missing here? or is this possible?


Report this post
Top
  
Reply with quote  
 Post subject: Re: <a href = php function?
PostPosted: Wed Feb 28, 2007 7:55 pm 

Points:
If you post this question at [url]C2D[/url] I can answer you.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 28, 2007 8:18 pm 

Points:
OK I will! thank you, but do I have to login to C2D? if so the user name and password that I use on learnphpfree.com forum do I use that information or do I need to register again(on C2D)? thank you!


Report this post
Top
  
Reply with quote  
 Post subject: Re: <a href = php function?
PostPosted: Mon Jun 22, 2009 12:21 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Thu Jun 18, 2009 6:56 am
Posts: 1
Points: 0
Whats wrong in answering here? :?

_________________
Have faith in GOD...!


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: <a href = php function?
PostPosted: Mon Jun 22, 2009 5:02 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
C2D is his forum......

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]