duanjiaren8188 2016-01-17 18:05
浏览 36
已采纳

我无法在php中找到链接中的数据

I try to make linke and when I click to that link I want to get some data from database in new page (details.php) but when I try to do this the (details.php)page it open empty without anything!!

the link code is:

         <a href='details.php?pro_id=$pro_id' sytle='float:left;'>Details</a>

and the php code in details.php page is:

<?php


    if(isset($_Get['pro_id'])){

        $Product_id= $_Get['pro_id'];

    $get_pro= "select * from products where Product_id = '$Product_id'";

 $run_pro= mysqli_query($con, $get_pro);

 while($row_pro= mysqli_fetch_array($run_pro)){

     $pro_id=$row_pro['Product_id'];
     $pro_title=$row_pro['Product_title'];
     $pro_price=$row_pro['Product_price'];
     $pro_image=$row_pro['Product_image'];
     $pro_desc=$row_pro['Product_desc'];

     echo "

     <div id='single_product'>

     <h3>$pro_title</h3>

     <img src='admin_area/product_images/$pro_image' width='400px' height='300px' />

     <p><b> Price  $pro_price RO</b></p>

     <a href='index.php?pro_id=$pro_id' sytle='float:left;'>Go Back</a>

     <a href='index.php?pro_id=$pro_id'><button style='float:right';>Add to Cart</button></a>

     </div>
     ";

 }
    }


 ?>

Ican not find where is my mistake

  • 写回答

2条回答 默认 最新

  • dsy19890123 2016-01-17 18:11
    关注

    Variables are case sensitive in PHP and the correct name for the get array is $_GET so amend you code like this

    if(isset($_GET['pro_id'])){
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持