PHP-MySQL second-hand trading platform management system (with source code)

@PHP-MySQL second-hand trading platform flea market management system

PHP-MySQL second-hand trading platform flea market management system (with source code)

The system is divided intofront-end users andback-end administratorsTwo characters
have complete functions, beautiful interface and run well.
Main functions:
User: Register and log in, view and modify personal information, manage personal orders, add shopping cart, view products Details, manage personal shopping cart, user comments, etc.

Administrator: User management, product management, order management, comment management, etc.
(There is a way to obtain the source code at the end of the article)

Main language:
PHP MySQL JavaScript HTML
This system can be customized and modified into any type of any theme mall, second-hand trading website.
Source code + database file.

This system adoptsphpstudy development platform, using PHP and MySQL database for development, and the development tool is HBuilder. At the same time, it can run normally in editor software such as Dw, PHPstorm, submit, Vscode, etc.

phpStudy is a PHP debugging environment program that integrates the latest Apache+PHP+MySQL+phpMyAdmin. It can be installed once and can be used without configuration. It is a very convenient and easy-to-use PHP debugging environment. (Other development platforms are acceptable)

Part of the picture

  • Front page

Front page

<?php
				$sql=mysql_query("select * from shangpin order by addtime desc limit 0,3",$conn);
				while($row=mysql_fetch_array($sql))
				{
    
    
			?>
			<div class="col-md-4 m-b">
				<a href="shopshow.php?id=<?php echo $row['id'];?>">
                	<figure class="effect-layla">
						<img src="<?php echo __BASE__;?>/upimages/<?php echo $row["tupian"];?>" />
						<figcaption><h4>会员价:<?php echo $row['huiyuanjia'];?><span style="text-decoration:line-through">市场价:<?php echo $row['shichangjia'];?></span></h4></figcaption>
					</figure>
				</a>
				<div class="m-b-text">
					<a href="shopshow.php?id=<?php echo $row['id'];?>" class="wd"><?php echo $row['mingcheng'];?></a>
					 <a class="read" href="shopshow.php?id=<?php echo $row['id'];?>&typeid=<?php echo $row['typeid'];?>">查看详细</a> <a class="order" href="addgouwuche.php?id=<?php echo $row['id'];?>">加入购物车</a>
				</div>
			</div>
            <?php
  • Administrator-Product Release

Administrator-Product Release

<?php
$action = !empty($_GET['action']) ? trim($_GET['action']) : '';
if($action == 'update')
	{
    
    
		if(is_numeric($_POST['shichangjia'])==false || is_numeric($_POST['huiyuanjia'])==false)
	 {
    
    
	   echo "<script>alert('价格只能为数字!');history.back();</script>";
	   exit;
	 }
	if(is_numeric($_POST['shuliang'])==false)
	 {
    
    
	   echo "<script>alert('数量只能为数字!');history.back();</script>";
	   exit;
	 }
	$mingcheng=$_POST['mingcheng'];
	$shichangjia=$_POST['shichangjia'];
	$huiyuanjia=$_POST['huiyuanjia'];
	$typeid=$_POST['typeid'];
	$xinghao=$_POST['xinghao'];
	$tuijian=$_POST['tuijian'];
	$shuliang=$_POST['shuliang'];
	if(!empty($_FILES['img']['name'])){
    
    
			$file = $_FILES['img'];//得到传输的数据
			//得到文件名称
			
			$name = $file['name'];
			$type = strtolower(substr($name,strrpos($name,'.')+1)); //得到文件类型,并且都转化成小写
			
			//判断是否是通过HTTP POST上传的
			$upload_path = ROOT_PATH.'/upimages/'; //上传文件的存放路径
			
			//开始移动文件到相应的文件夹
			$mu=mt_rand(1,10000000);
			if(move_uploaded_file($file['tmp_name'],$upload_path.$mu.".".$type)){
    
    
			  $fileName =$mu.".".$type;
			 
			}else{
    
    
			  //echo "Failed!";
			}
		}
		else
		{
    
    
			$fileName="";
			}
	$jianjie=$_POST['content'];
	$addtime=date("Y-m-j");
	mysql_query("insert into shangpin(mingcheng,jianjie,addtime,xinghao,tupian,typeid,shichangjia,huiyuanjia,tuijian,shuliang,cishu)values('$mingcheng','$jianjie','$addtime','$xinghao','$fileName','$typeid','$shichangjia','$huiyuanjia','$tuijian','$shuliang','0')",$conn);
	echo "<script>alert('商品".$mingcheng."添加成功!');window.location.href='addgoods.php';</script>";
}
include_once("foot.php");
?>
  • Administrator-Login page

Administrator-Login page

<?php
session_start();
 class chkinput{
    
    
   var $admin_name;
   var $admin_pwd;

   function chkinput($x,$y)
    {
    
    
     $this->admin_name=$x;
     $this->admin_pwd=$y;
    }

   function checkinput()
   {
    
    
     include("../conn/conn.php");
     $sql=mysql_query("select * from admin where admin_name='".$this->admin_name."'",$conn);
     $info=mysql_fetch_array($sql);
     if($info==false)
       {
    
    
          echo "<script language='javascript'>alert('不存在此管理员!');history.back();</script>";
          exit;
       }
      else
       {
    
    
          if($info['admin_pwd']==$this->admin_pwd){
    
    
			  $_SESSION['sessionname'] = $info['admin_name'];
				$_SESSION['sessionid'] = $info['id'];
               header("location:default.php");
            }
          else
           {
    
    
             echo "<script language='javascript'>alert('密码输入错误!');history.back();</script>";
             exit;
           }

      }    
   }
 }
    $obj=new chkinput(trim($_POST['name']),md5(trim($_POST['pwd'])));
    $obj->checkinput();

?>
  • User-personal information

User-personal information

<?php
	$act = !empty($_GET['act']) ? trim($_GET['act']) : '';
	if($act == 'edit')
	{
    
    
		$tel = !empty($_POST['tel']) ? trim($_POST['tel']) : '';
		$truename = !empty($_POST['truename']) ? trim($_POST['truename']) : '';
		$dizhi = !empty($_POST['dizhi']) ? trim($_POST['dizhi']) : '';
		$email = !empty($_POST['email']) ? trim($_POST['email']) : '';
		mysql_query("update usermember set email='$email',truename='$truename',tel='$tel',dizhi='$dizhi'",$conn);
		echo "<script>alert('修改成功!');location.href='usercenter.php';</script>";
	}
	$sql=mysql_query("select * from usermember where name='".$_SESSION['username']."'",$conn);
	$row=mysql_fetch_array($sql);
?>
  • User-My Order

User-My Order

<?php
$username=$_SESSION['username'];
 $sql=mysql_query("select * from dingdan where xiadanren='".$username."'",$conn);
$info=mysql_fetch_array($sql);
if($info==false)
	 {
    
    
	 echo "<div algin='center'>对不起,没有查找到该订单!</div>";    
	}
 else
 {
    
    
 ?>
  • Administrator-Product Information

Administrator-Product Information

<?php
			$pagesize=20;
		   if ($total<=$pagesize){
    
    
		      $pagecount=1;
			} 
			if(($total%$pagesize)!=0){
    
    
			   $pagecount=intval($total/$pagesize)+1;
			
			}else{
    
    
			   $pagecount=$total/$pagesize;
			
			}
			$page = !empty($_GET['page']) ? trim($_GET['page']) : '';
			if(($page)==""){
    
    
			    $page=1;
			
			}else{
    
    
			    $page=intval($_GET['page']);
			
			}
             $sql1=mysql_query("select * from shangpin order by id desc limit ".($page-1)*$pagesize.",$pagesize ",$conn);
             while($info1=mysql_fetch_array($sql1))
		     {
    
    
		  ?>

Jump to get the source code
Demo video

Guess you like

Origin blog.csdn.net/qq_57161040/article/details/129471726