当前位置:网站首页>PHP development 14 compilation of friendship link module
PHP development 14 compilation of friendship link module
2022-06-13 04:31:00 【qq_ forty-two million three hundred and seven thousand five hun】
newly build flink_list.php
<?php
include_once "head.php";
include_once "../common/Page.class.php";
$page=isset($_GET['page'])? $_GET['page']:1;
$subPages=8;
if ($_GET['action'] == 'del'){
$id = filterstr($_GET['id']);
$conn->query("delete from flink where id='$id'");
if($conn->affected_rows>0){
redirect(2,'flink_list.php',' Delete successful ');
}
else{
redirect(2,'flink_list.php',' Delete failed ');
}
}
?>
<!doctype html>
<html>
<!--/sidebar-->
<div class="main-wrap">
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="index.html"> home page </a><span class="crumb-step">></span><span class="crumb-name"> Work management </span></div>
</div>
<div class="result-wrap">
<form name="myform" id="myform" method="post">
<div class="result-title">
<div class="result-list">
<a href="flink_add.php"><i class="icon-font"></i> New friendship link </a>
</div>
</div>
<div class="result-content">
<table class="result-tab" width="100%">
<tr>
<th>ID</th>
<th>URL</th>
<th> Website title </th>
<th> operation </th>
</tr>
<tr>
<?php
$result = $conn->query("select * from flink ");
while($row = $result->fetch_assoc()){
?>
<td><?php echo $row['id'];?></td>
<td title="<?php echo $row['url']; ?>" name="url"><a target="_blank" href="<?php echo $row['url'];?>" title="<?php echo $row['url']; ?>"><?php echo $row['url']; ?></a>
</td>
<td><?php echo $row['url_name'];?></td>
<td>
<a class="link-update" href="flink_edit.php?id=<?php echo $row['id'];?>"> modify </a>
<a class="link-del" href="javascript:del(<?php echo $row['id'];?>);"> Delete </a>
</td>
</tr>
<?php }?>
</table>
<div class="list-page">
<?php
$result1=$conn->query("select * from flink");
$result_count1=$result1->num_rows;
$p = new Page($result_count1,4,$page,$subPages);
echo $p->showPages(1);
?>
</div>
</div>
</form>
</div>
</div>
<!--/main-->
</div>
<script>
function del(id){
if(false==confirm(" Are you sure to delete the record ?")) return;
location.href='?action=del&id='+id;
}
</script>
</body>
</html>
flink_editor.php
<?php
include_once "head.php";
header("Content-type: text/html; charset=utf-8");
$id = filterstr($_GET['id']);
$url = filterstr($_POST['url']);
$url_name = filterstr($_POST['url_name']);
if($_POST['sub']){
//echo "update article set title = '$title',content='$content',author='$author',keyword='$keyword',c_time=$c_time,catid=$catid where id='$id'";
$conn->query("update flink set url_name = '$url_name',url='$url' where id='$id'");
if ($conn->affected_rows > 0) {
redirect(2, 'flink_list.php', ' Edit success ');
} else {
redirect(2, 'flink_edit.php', ' Edit failed ');
}
}
//$sql="insert into article (title,content,author,keyword,catid,c_time) value ('$title','$content','$author','$keyword',$cateid,'$c_time')";
?>
<!doctype html>
<html>
<!--/sidebar-->
<div class="main-wrap">
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/"> home page </a><span class="crumb-step">></span><a class="crumb-name" href="/jscss/admin/design/"> Work management </a><span class="crumb-step">></span><span> Editing works </span></div>
</div>
<div class="result-wrap">
<div class="result-content">
<form action="" method="post" id="myform" name="myform" enctype="multipart/form-data">
<table class="insert-tab" width="100%">
<tbody>
<?php
$result = $conn->query("select * from flink");
$row = $result->fetch_assoc();
?>
<tr>
<th><i class="require-red">*</i> Website title :</th>
<td>
<input class="common-text required" id="title" name="url_name" value="<?php echo $row['url_name']; ?>" size="50" type="text">
</td>
</tr>
<tr>
<th>url</th>
<td><input class="common-text" name="url" size="50" value="<?php echo $row['url'];?>" type="text"></td>
</tr>
<tr>
<th></th>
<td>
<input class="btn btn-primary btn6 mr10" value=" Submit " name ="sub" type="submit">
<input class="btn btn6" onClick="history.go(-1)" value=" return " type="button">
</td>
</tr>
</tbody></table>
</form>
</div>
</div>
</div>
<!--/main-->
</div>
</body>
</html>
flink_add.php
<?php
include_once 'init.php';
include "head.php";
header("Content-type: text/html; charset=utf-8");
$url_name = filterstr($_POST['url_name']);
$url = filterstr($_POST['url']);
//echo $cateid;
//$sql="insert into article (title,content,author,keyword,catid,c_time) value ('$title','$content','$author','$keyword',$cateid,'$c_time')";
//echo $sql;
if($_POST['sub']) {
$conn->query("insert into flink (url_name,url) value ('$url_name','$url')");
if ($conn->affected_rows > 0) {
redirect(2, 'flink_list.php', ' Add success ');
} else {
redirect(2, 'flink_add.php', ' Add failure ');
}
}
?>
<!doctype html>
<html>
<!--/sidebar-->
<div class="main-wrap">
<div class="crumb-wrap">
<div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/"> home page </a><span class="crumb-step">></span><a class="crumb-name" href="/jscss/admin/design/"> Work management </a><span class="crumb-step">></span><span> New works </span></div>
</div>
<div class="result-wrap">
<div class="result-content">
<form action="" method="post" id="myform" name="myform" enctype="multipart/form-data">
<table class="insert-tab" width="100%">
<tbody>
<tr>
<th><i class="require-red">*</i> Website title :</th>
<td>
<input class="common-text required" id="title" name="url_name" size="50" value="" type="text">
</td>
</tr>
<tr>
<th>url</th>
<td><input class="common-text" name="url" size="50" value="" type="text"></td>
</tr>
<tr>
<th></th>
<td>
<input class="btn btn-primary btn6 mr10" value=" Submit " name="sub" type="submit">
<input class="btn btn6" onClick="history.go(-1)" value=" return " type="button">
</td>
</tr>
</tbody></table>
</form>
</div>
</div>
</div>
<!--/main-->
</div>
<script type="text/javascript" src="ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" charset="utf-8">// Initialize editor
window.UEDITOR_HOME_URL = "ueditor/";// The configuration path is set to UEditor Where you put it
window.onload=function(){
/* window.UEDITOR_CONFIG.initialFrameHeight=600;// The height of the editor */
/* window.UEDITOR_CONFIG.initialFrameWidth=1200;// The width of the editor */
var editor = new UE.ui.Editor({
imageUrl : '',
fileUrl : '',
imagePath : '',
filePath : '',
imageManagerUrl:'', // The processing address of image online management
imageManagerPath:''
});
editor.render("EditorId");// Here EditorId And <textarea name="content" id="EditorId"> Of id Value correspondence </textarea>
}
</script>
</body>
</html>
边栏推荐
- Unity shader learning 004 shader debugging platform difference third-party debugging tools
- 【Flutter 問題系列第 67 篇】在 Flutter 中使用 Get 插件在 Dialog 彈窗中不能二次跳轉路由問題的解决方案
- Answer private message @ Tiantian Wx //2022-6-12 C language 51 single chip microcomputer led analog traffic light
- web自动化测试之webdriver api总结
- Differences and relations between three-tier architecture and MVC
- Advanced Mathematics (Seventh Edition) Tongji University exercises 1-2 personal solutions
- MySQL索引
- String full summary
- Applet - uniapp realizes the functions of two-dimensional code picture pop-up and picture saving
- Alipay native components (hotel time selection)
猜你喜欢
Applet - uniapp realizes the functions of two-dimensional code picture pop-up and picture saving
Simple static web page + animation (small case)
The could not find com scwang. smart:refresh-layout-kernel:2.0.3. Required by: project: the app cannot load the third-party package
Li Kou brush question 647 Palindrome substring
基于DE2-115平台的VGA显示
VGA display based on de2-115 platform
Knife4j aggregation 2.0.9 supports automatic refresh of routing documents
120. triangle minimum path sum - Dynamic Planning
Ctfshow SQL injection (231-253)
Interpretation and implementation of proxy mode
随机推荐
Introduction to applet Basics (dark horse learning notes)
Zoom and move the H5 part of the mobile end
力扣刷题647.回文子串
Returns the width and height of an element
SEO specification
Differences and relations between three-tier architecture and MVC
Et framework -22 creating serverinfo entities and events
Day 007: go language string
【剑指Offer】面试题24.反转链表
Checkmarks and crosses to collect
Suffix Automaton
SQL advanced challenge (1 - 5)
Express framework knowledge - Art template template, cookie, session
Modeling discussion series 143 data processing, analysis and decision system development
Applet version update
Google Chrome browser reports an error: net:: err_ BLOCKED_ BY_ CLIENT
The problem that ionic3 cannot automatically install the APK package
Use the visual studio code terminal to execute the command, and the prompt "because running scripts is prohibited on this system" will give an error
String full summary
Webpack system learning (VIII) how contenthash can prevent browsers from using cache files