當前位置:首頁 » 編程語言 » 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-07-02 05:14:51 瀏覽:185
長安歐尚a800有哪些配置 發布:2025-07-02 04:43:57 瀏覽:873
資料庫語句轉換 發布:2025-07-02 04:27:43 瀏覽:62
蘋果手機登錄微信如何儲存密碼 發布:2025-07-02 04:22:05 瀏覽:817
現場解壓 發布:2025-07-02 04:14:37 瀏覽:668
ad域控伺服器長得什麼樣 發布:2025-07-02 04:14:32 瀏覽:159
企業如何高效率地配置資源 發布:2025-07-02 04:14:30 瀏覽:632
python遞增 發布:2025-07-02 04:12:15 瀏覽:419
租國際伺服器有什麼優勢 發布:2025-07-02 04:12:06 瀏覽:838
瓢蟲編程工具 發布:2025-07-02 04:10:48 瀏覽:714