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 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题