简体   繁体   English

我第一页的照片没有传递到第二页

[英]My photo from my 1st page is not passing down to my 2nd one

I have a problem and was wondering if anyone could help or suggest me on what to do to fix this.I am trying to pass down a photo(from database) from my 1st page to my 2nd page when i click on it.At the moment when i click on the photo it redirects me to the 2nd page with the < img > icon 我有一个问题,想知道是否有人可以提供帮助或建议我如何解决此问题。当我单击它时,我试图将照片(从数据库)从第一页传递到第二页。当我单击照片的那一刻,它使用<img>图标将我重定向到第二页

1st page 第一页

   <?php
    $conn = mysqli_connect("localhost","root","","photos");
    echo $conn ? 'connected' : 'not connected';
    $result = mysqli_query($conn, "SELECT * FROM images");
    ?>

    <center>
    <?php
    while ($row = mysqli_fetch_assoc($result)) {
    echo "<a  href='test2.php? mydata=<img src='".$row['image']."''><img 
    src='".$row['image']."' ></a>";
    }
    ?>
    </center>

2nd page 第二页

    <center>
    <?php

    $conn = mysqli_connect("localhost","root","","photos");


    $data = $_GET['mydata'];
    echo "$data;"
    ?>
    </center>

remove the image tag after the parameter delimetre 删除参数delimetre之后的图片标签

<?php
    while ($row = mysqli_fetch_assoc($result)) {
    echo "<a  href='test2.php?mydata=".$row['image']."'><img 
    src='".$row['image']."' ></a>";
    }
?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在第一天之前设置我的第二个日期选择器? - How do I set my 2nd datepicker one day ahead of the 1st? 如何使用第一个 API 通话中的数据并在我的第二个 API 通话中使用该数据? - How to use a data from the 1st API call and use that in my 2nd API call? 我只想按第一个字母的字母顺序对数组中的单词进行排序,然后根据我给定的与第一个字母匹配的模式按第二个字母排序 - I just want to sort my words from array alphabetically by 1st letter and then by 2nd letter according to my given pattern which matched by 1st letter 为什么我的第二个javascript承诺调用返回与第一个相同的值? - Why does my 2nd javascript promise call return the same value as the 1st? 我的滑块仅显示第1和第3个滑块,但不显示表格的第2和第4个滑块 - My slider only shows 1st and 3rd slider but not the 2nd and 4th slider for table 从第一个填充第二个列表框 - populate 2nd listbox from 1st 如何将所选日期选择器值从第一页显示到第二页日期选择器 - How to display the selected datepicker value from the 1st page onto the 2nd page datepicker 如何在新页面中打开链接,然后从第二个页面链接回到第一个页面 - How to open link in new page, then link back to the 1st page from the 2nd 单击第一页的链接后如何更改第二页div的背景颜色 - How to change the background color of a div on 2nd page once the link from 1st page is clicked 单击第一页的锚点时如何替换第二页中的图像? 在 JavaScript - How to replace images in 2nd page when an anchor from 1st page was clicked ? in JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM