我有两个页面index.php和currentmovies.php。我正在尝试在currentmovies.php中显示给定电影的电影名称,但我无法显示整个名称,只显示了第一个单词。我用index.php编写了查询,并将值传递给currentmovies.php。
如果电影的名字是“指环王”,那么只有“指环王”在播放。
// index.php echo中的代码"";
//code in currentmovies.php
<?php
echo "<b><font size='3'>Current Movie:",$_GET['movie_name']," </font></b>";
echo "<p> The movie ",$_GET['movie_name']," was released on ",$_GET['rdate']," and falls under the ",$_GET['genre']," category. </p>";
谢谢你的帮助
发布于 2013-11-10 05:32:44
//code in currentmovies.php
<?php
echo "<b><font size='3'>Current Movie: ".$_GET['movie_name']."</font></b>";
echo "<p>The movie ".$_GET['movie_name']." was released on ".$_GET['rdate']." and falls under the ".$_GET['genre']." category.</p>";
试试这个:
发布于 2013-11-10 06:04:33
请这样做:
<?php
echo '<b><font size="3">Current Movie: '.$_GET['movie_name'].' </font></b>';
echo '<p> The movie '.$_GET['movie_name'].' was released on '.$_GET['rdate'].' and falls under the '.$_GET['genre'].' category. </p>';
请记住,在这种情况下,点而不是逗号。
还有一件事:如果你没有在配额中使用任何变量,请使用单一配额,加上html更好更容易使用单一配额,例如:
<font size="3">
https://stackoverflow.com/questions/19883198
复制相似问题