iframe_demo实例:消息发送(PHP版本)
生活随笔
收集整理的這篇文章主要介紹了
iframe_demo实例:消息发送(PHP版本)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
【index.html】編碼:
<!DOCTYPE html> <html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>Document</title> </head><body><iframe id="fr1" frameborder="1" style="width: 800;height:150px"></iframe><p><input type="text" name="userName" id="userName" placeholder="請輸入姓名"></p><p><input type="text" name="info" id="info" placeholder="請輸入信息"></p><p><input type="button" value="發送" onclick="sendMsg()"></p><script>function sendMsg() {var userName = document.getElementById("userName").value;var info = document.getElementById("info").value;var url = "index.php?userName=" + userName + "&info=" + info;document.getElementById("fr1").src = url;}</script> </body></html>【index.php】編碼:
<?php $userName=$_GET['userName']; $info=$_GET['info']; var_dump($userName,$info); ?>效果如下:
?
總結
以上是生活随笔為你收集整理的iframe_demo实例:消息发送(PHP版本)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 程序员——令人喷饭的代码注释
- 下一篇: 【2022年蓝桥杯】蓝桥杯第一次海选考试