當前位置:首頁 » 編程語言 » 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);

熱點內容
oppoa37怎麼給應用加密 發布:2025-07-01 12:20:53 瀏覽:641
java毫秒數 發布:2025-07-01 12:19:14 瀏覽:518
評委打分c語言 發布:2025-07-01 12:10:05 瀏覽:143
c語言中e的次方 發布:2025-07-01 12:02:23 瀏覽:177
php訪問量統計代碼 發布:2025-07-01 11:57:56 瀏覽:211
粵核酸的賬號密碼是什麼 發布:2025-07-01 11:52:41 瀏覽:209
我的世界國際版java版伺服器在哪 發布:2025-07-01 11:45:57 瀏覽:880
存儲米酒 發布:2025-07-01 11:45:13 瀏覽:986
使用openssl加密 發布:2025-07-01 11:43:54 瀏覽:546
客戶端腳本語言和伺服器腳本語言有什麼區別 發布:2025-07-01 11:42:27 瀏覽:52