douke3442 2013-01-01 22:16
浏览 54
已采纳

谎言\使用youtube链接进入数据库[关闭]

this is so that when I lie a link into my database then tag / download video and lie it on the page like this

so when it is that I lie it into the database so it's going to look like this in the database, and I can not really figure out what is wrong since there doing this then to be \ into like it the link in php

show here:

this is how I think of it. However, I did not try anything. but here is my code for my site:

<tr>
                    <td>Video:</td>
                    <td><input type="text" name="video"></td>
                </tr>

and my code to all my infomation to youtube

if ($stmt = $this->mysqli->prepare("INSERT INTO `artiker` (`title`, `kort`, `video`, `tekst`, `img`, `img_title`) VALUES (?, ?, ?, ?, ?, ?)")) { 

            $stmt->bind_param('ssssss', $title, $kort, $video, $tekst, $img, $img_title);

            /* Sæt værdier på parametrene */
            $title = $_POST['title']; 
            $kort = $_POST['kort'];
            $video = $_POST['video'];
            $tekst = $_POST['tekst'];
            $img = $pb;
            $img_title = $_POST["img_title"];

            /* Eksekver forespørgslen */
            $stmt->execute();

            /* Luk statement */
            $stmt->close();

            ?>
            <script language="javascript" type="text/javascript">  
                window.location.href = "/artikler-programmering/";  
            </script> 
            <?php

        } else {
            /* Der er opstået en fejl */
            echo 'Der opstod en fejl i erklæringen: ' . $this->mysqli->error;
        }   

Really hope you can help me to not set \ into my youtube links

  • 写回答

2条回答 默认 最新

  • donglao7947 2013-01-01 22:26
    关注

    Just a guess... After you retrieve the youtube link from the database, you will want to call stripslashes() on the video link.

    What that function will do is transform:

    https:\/\/www.youtube.com\/watch?v=RlfLCWKxHJ0
    

    into

    https://www.youtube.com/watch?v=RlfLCWKxHJ0
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失
  • ¥60 要数控稳压电源测试数据
  • ¥15 能帮我写下这个编程吗
  • ¥15 ikuai客户端l2tp协议链接报终止15信号和无法将p.p.p6转换为我的l2tp线路