传递变量和其他变量
这是 IMDB 代码
http://pastie.org/private/s8m72fndjvqzdtcjjel5w
为了使用它我必须通过插入此内容来创建另一个页面 http://lab.abhinayrathore.com/imdb/usage.htm
我想到了一个我尝试使用通过 url 传递变量来代替创建每个页面 并以某种方式将变量或任何内容放入 getMovieInfo("INTHISPLACE");
$movieArray = $imdb->getMovieInfo("MovieName in here");
我不想每次为一部电影创建一个新页面,而是想要像这样的 site.com/movie.php?m=tt0068646 <
<?php
include("imdb.php");
$imdb = new Imdb();
$movieArray = $imdb->getMovieInfo
var getMovieInfo = $m;
$val = $_GET['m'];
echo "$m";
echo '<table cellpadding="3" cellspacing="2" border="1" width="80%" align="center">';
foreach ($movieArray as $key=>$value){
$value = is_array($value)?implode("<br />", $value):$value;
echo '<tr>';
echo '<th align="left" valign="top">' . strtoupper($key) . '</th><td>' . $value . '</td>';
echo '</tr>';
}
echo '</table>';
?>
^ 这不起作用,因为每当我写 site.com/movie.php?m=ANYKINDOFMOVIeCode 时,它都不会带我去同一部电影或无处可去。
原始代码:
<?php
include("imdb.php");
$imdb = new Imdb();
$movieArray = $imdb->getMovieInfo("MovieName in here");
echo '<table cellpadding="3" cellspacing="2" border="1" width="80%" align="center">';
foreach ($movieArray as $key=>$value){
$value = is_array($value)?implode("<br />", $value):$value;
echo '<tr>';
echo '<th align="left" valign="top">' . strtoupper($key) . '</th><td>' . $value . '</td>';
echo '</tr>';
}
echo '</table>';
?>
尝试将其添加到 ^:
$val = $_GET['m'];
echo "$m";
This is the IMDB code
http://pastie.org/private/s8m72fndjvqzdtcjjel5w
and in order to use it I must create another page by inserting this
http://lab.abhinayrathore.com/imdb/usage.htm
I thought of an idea instead of creating an each page I tried to use passing variables via url
and somehow to put a variable or anything in getMovieInfo("INTHISPLACE");
$movieArray = $imdb->getMovieInfo("MovieName in here");
Instead of creating a new page and for each time for a single movie I wanted something like this site.com/movie.php?m=tt0068646 <
<?php
include("imdb.php");
$imdb = new Imdb();
$movieArray = $imdb->getMovieInfo
var getMovieInfo = $m;
$val = $_GET['m'];
echo "$m";
echo '<table cellpadding="3" cellspacing="2" border="1" width="80%" align="center">';
foreach ($movieArray as $key=>$value){
$value = is_array($value)?implode("<br />", $value):$value;
echo '<tr>';
echo '<th align="left" valign="top">' . strtoupper($key) . '</th><td>' . $value . '</td>';
echo '</tr>';
}
echo '</table>';
?>
^ that didnt work because whenever I wrote site.com/movie.php?m=ANYKINDOFMOVIeCode it didnt bring me to the same movie or nowhere.
The Original Code:
<?php
include("imdb.php");
$imdb = new Imdb();
$movieArray = $imdb->getMovieInfo("MovieName in here");
echo '<table cellpadding="3" cellspacing="2" border="1" width="80%" align="center">';
foreach ($movieArray as $key=>$value){
$value = is_array($value)?implode("<br />", $value):$value;
echo '<tr>';
echo '<th align="left" valign="top">' . strtoupper($key) . '</th><td>' . $value . '</td>';
echo '</tr>';
}
echo '</table>';
?>
tried to add this to that ^:
$val = $_GET['m'];
echo "$m";
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该是
Should be