0

我有两个页面 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>";

谢谢您的帮助

4

2 回答 2

0
//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-09T21:32:43.573 回答
-1

请这样做:

<?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">
于 2013-11-09T22:04:33.207 回答