當前位置:首頁 » 編程語言 » PHPlink

PHPlink

發布時間: 2025-01-21 22:41:42

㈠ link.php這是什麼文件,要怎麼樣才能打開

link.php是網站後台php程序文件,一般是從某一個頁面跳轉到另一個頁面的文件。

如果想看裡面的代碼,直接用記事本,如果想執行這個文件,就需要一個php的環境。有集成的程序,phpStudy或者AppServ都可以。

㈡ PHP刪除資料庫記錄

1、首先在視圖頁面找到要刪除的id:
<?php
$link=mysql_connect("localhost","root","管理員密碼");
mysql_select_db("infosystem", $link);
$q = "SELECT * FROM info";
mysql_query("SET NAMES GB2312");
$rs = mysql_query($q, $link);

echo "<table>";
echo "<tr><td>部門名稱</td><td>員工姓名</td><td>PC名稱</td></tr>";
while($row = mysql_fetch_object($rs)) echo "<tr><td><a href='dodel.php?id=$row->id'>del</a></td><td>$row->depart</td><td>$row->ename</td></tr>";
echo "</table>";
?>
2、寫一個delete.php頁面,代碼如下:
<?php
$link =mysql_connect("localhost","root","管理員密碼");
mysql_select_db("infosystem", $link);
$del_id=$_GET["id"];
$exec="delete from info where id=$del_id";
mysql_query($exec, $link);
echo "刪除成功!";
mysql_close($link);
?>
說明:用於MySQL數據刪除的SQL語句為:
delete from 表名 where 條件=值
這里的值通過$del_id=$_GET["id"]來接收,並傳遞給SQL語句,最後通過mysql_query來執行這句SQL語句刪除的。

㈢ 用PHP獲取鏈接及圖片路徑的方法

<?php

$str="Thisisatest.Thisisatest.Thisisa<ahref=http://link1.com><imgsrc=http://img1.jpg/></a>test.Thisisatest.Thisisatest. ".
"Thisisatest.Thisisatest.<ahref=http://link2.com><imgsrc=http://img2.jpg/></a>Thisisatest.Thisisatest.Thisisatest. ".
"<ahref=http://link3.com><imgsrc=http://img3.jpg/></a>";

$regex='/<as+href=(.*)s*><imgs+src=(.*)s*/></a>/';
$output=array();

if(preg_match_all($regex,$str,$matches)!==false){
if(isset($matches[1])&&isset($matches[2])){
$links=$matches[1];
$imgs=$matches[2];

foreach($linksas$key=>$link){
$img=isset($imgs[$key])?$imgs[$key]:'';
$output[]="<ahref="{$link}"><imgsrc="{$img}"/></a>";
}
}
}

var_mp($output);

熱點內容
網盤解壓包怎麼打開 發布:2025-09-16 16:59:19 瀏覽:814
紅火腳本 發布:2025-09-16 16:53:21 瀏覽:985
centosphp56 發布:2025-09-16 16:52:24 瀏覽:254
修改逃跑吧少年不用找腳本 發布:2025-09-16 16:50:43 瀏覽:143
php慢日誌 發布:2025-09-16 16:44:46 瀏覽:308
什麼電腦配置做pr比較順暢 發布:2025-09-16 16:42:03 瀏覽:297
centosphprpm 發布:2025-09-16 16:40:34 瀏覽:146
抖音社區源碼 發布:2025-09-16 16:12:48 瀏覽:134
酷派內置存儲空間不足 發布:2025-09-16 15:50:44 瀏覽:400
php設置編碼格式 發布:2025-09-16 15:20:04 瀏覽:614