Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8286961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:54:46+00:00 2026-06-08T11:54:46+00:00

I have a page, play.html : <form method=post action=play.php> <input type=hidden name=mp3name value=/MP3/1.mp3> <input

  • 0

I have a page, play.html:

    <form method="post" action="play.php">
         <input type="hidden" name="mp3name" value="/MP3/1.mp3">
         <input type="submit"  value="Play My MP# #1" />
    </form>


<form method="post" action="play.php">
    <input type="hidden" name="mp3name" value="/MP3/2.mp3">
    <input type="submit"  value="Play My MP# #2" />
</form>

This calls another page, play.php:

<?php

$formurl = "play.html" ;
$playerurl = "player.html" ;

$mymp3 = $_GET["mp3name"]; 

header( "Location: $playerurl?mp3name=$mymp3" );
exit ;
?>

Then it calls another page, player.html:

<audio id="player" src="$mymp3" autoplay preload="auto"> </audio>
       <div>
       <button onclick="document.getElementById('player').play()">Play</button>
       <button onclick="document.getElementById('player').pause()">Pause</button>
       <button onclick="document.getElementById('player').volume+=0.1">Volume Up</button>
       <button onclick="document.getElementById('player').volume-=0.1">Volume Down</button>
          </div> 

How do I pass a variable from PHP to player.html?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:54:48+00:00Added an answer on June 8, 2026 at 11:54 am

    You are getting the variable $mymp3 with $_GET while you are using <form method='post'.., change it to $mymp3 = $_POST['mp3name'];

    Then, change your player.html extension to player.php to use PHP code on it.

    So, when you have your player.php file, change this…

    <audio id="player" src="$mymp3" autoplay preload="auto"> </audio>
    

    to this…

    <audio id="player" src="<?php echo $mymp3 ?>" autoplay preload="auto"> </audio>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would it be possible to have a HTML page play a flash animation
I have an html page with the following content: [...] <tr><td class=n><a href=play-1.0.1.zip>play-1.0.1.zip</a></td></tr> <tr><td
I have a html page which has animations which will play over time, i
I have a page of several videos. One can click a thumbnail to play
in my application i have the playvideo page where video will play, below that
I have a video, and I need to play it in my ASP.NET page's
I have page named page--news.tpl.php, which i created for my news page. But after
I'm trying to have my HTML page call my functions in my AS3 but
I have a music player swf embedded on an html page. Is there any
So I have a javascript library setup on http://www.topholidayrecipes.com/crockpot-chicken-recipes.html and this page uses fancy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.