dstt1818 2016-05-23 05:40
浏览 20
已采纳

使用$ _GET将变量传递到另一个页面无效

$_GET is not working when passing variables from one page to another page.

Title - ID - Embed are all showing in the URL on page two so I don't think the problem is on page 1 being that is appears to be passing the variables.

The $_GET['embed'] is working on page 2 but not the $_GET['id'] and $_GET['title']

Page 1:

$title = $row['title'];;
$id = $row['id'];;
$linkurl = $row['embed'];;
$src1 = $row['thumbs1'];; 
echo '<a href="show/video_show.php?title='.$title.'&id='.$id.'&embed='.$linkurl.'"><img height="160" width="260"  style="border:none;" src="'. $src1 .'" /></a>';

Page 2:

Title: <? echo $_GET['title']; ?>  
<iframe src="<?php echo $_GET['embed'];?>"allowfullscreen="allowfullscreen" scrolling="no" width="770" height="440"></iframe>
<p>Video Number: <? echo $_GET['id'];?>
 <!-- embed is working -->
  • 写回答

1条回答 默认 最新

  • dsa122870 2016-05-23 05:45
    关注

    You have issue in your PAGE 2 file :

    Replace <? with <?php

    Title: <?php echo $_GET['title']; ?>  // changed
    <iframe src="<?php echo $_GET['embed'];?>"allowfullscreen="allowfullscreen" scrolling="no" width="770" height="440"></iframe>
    <p>Video Number: <?php echo $_GET['id'];?> //changed
     <!-- embed is working -->
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!
  • ¥30 vue+element根据数据循环生成多个table,如何实现最后一列 平均分合并
  • ¥20 pcf8563时钟芯片不启振
  • ¥20 pip2.40更新pip2.43时报错
  • ¥15 换yum源但仍然用不了httpd
  • ¥50 C# 使用DEVMOD设置打印机首选项
  • ¥15 麒麟V10 arm安装gdal
  • ¥20 OPENVPN连接问题