如何在php中从html或javascript调用参数

如何在php中从html或javascript调用参数,javascript,php,html,Javascript,Php,Html,在html页面中,我有一个脚本: <script type="text/javascript" src="player.js"></script> <head> <script> $radioURL = "90.100.100.10"; $radioPort = "8000/xxx; </script> </head> .... 最后,在php文件(song.php)中,我需要替换代码,

在html页面中,我有一个脚本:

<script type="text/javascript" src="player.js"></script>
<head>
    <script>
     $radioURL = "90.100.100.10";
     $radioPort = "8000/xxx;
    </script>
</head>
....
最后,在php文件(song.php)中,我需要替换代码,并从html页面或javascript文件的脚本调用变量:

$t = new streaminfo('http://90.100.100.10:8000/xxx');


请帮忙!!!。。。如何继续?

在你的
歌曲.php中,你几乎是对的。
只需使用您通过
POST
收到的数据即可。。。并使用PHP字符串连接而不是Javascript字符串连接:)


因为这是一篇文章,您正在发布变量:
currentradiourl
currentradioport
。在PHP文件中,可以执行以下操作:

$radioURL = $_POST['currentradiourl'];
$radioPort = $_POST['currentradioport'];

$t = new streaminfo("http://{$radioURL}:{$radioPort}");

“我需要替换代码”,你说的代码是什么意思?????请粘贴文件
song.php
脚本是hire:我想你应该试着理解服务器和浏览器之间的区别,请求是什么等等。看起来你完全不知道这些东西是什么,没有这些基本知识是不可能帮到你的。Mike Szyndel,对不起,但是我得到了立即的回应,所以我对那些帮助我的人表示了成千上万的感谢。谁把这门语言掌握得很好(这里有很多人)回答说,没有给出剧本的细节,只给出必要的东西。我不自称是专家,否则我就不会求助!!!如果你能帮助我,我认为这是不道德的,如果你不能,不!非常感谢。
$t = new streaminfo('http://'+$radioURL+':'+$radioPort');
$radioURL = isset($_POST['currentradiourl') ? $_POST['currentradiourl' : '';
$radioURL = isset($_POST['currentradioport') ? $_POST['currentradioport' : '';
$t = new streaminfo('http://' . $radioURL . ':' . $radioPort);
$radioURL = $_POST['currentradiourl'];
$radioPort = $_POST['currentradioport'];

$t = new streaminfo("http://{$radioURL}:{$radioPort}");