Jump to content

alright just made up this.. can someone edit this need more tweaks


Fryle

Recommended Posts

1. in security.php it wont allow me to enter my username and password even sql is admin and admin

2. i dont know how to put a delete product  to delete specific product

3. i cant add/update/ product.

4. i cant register a new user..

 

 

can you guys edit it for me? you can check all the files and recode  it if you want.

 

i just need it for my school project. and so i can review my work and your work to learn more better that teacher is so bitchy his not giving a lesson and now he wants to build us that and this

maybelle website1.zip

Link to comment
Share on other sites

We're not going to look through 18 files to do free work for you. We're certainly not going to do your homework. If you can't get help from the teacher then get help from your classmates.

 

If you have specific questions about specific parts of your code, we can help you with that if you post the relevant parts of the code.

Link to comment
Share on other sites

We're not going to look through 18 files to do free work for you.

 

We're definitely not going to do your homework. If you can't get help from the teacher then get help from your classmates.

all of us are ready to blown are brains out bro :(

Link to comment
Share on other sites

You mentioned security.php. start with that file.

security.php

<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body{

	background-image: url(images/nature.jpg);
	background-size: cover;
}
.aa{

width: 300px;
height: 230px;
background-color: rgba(0,0,0,0.5);
margin: 0 auto;
margin-top: 60px;
padding-top: 10px;
padding-left: 50px;
padding-right: 0px;
border-radius: 15px;
-webkit-boarder-radius:15px;
-o-boarder-radius:15px;
-moz-boarder-radius:15px;
color: white;
font-weight:bolder;

}

.aa input[type="text"]{
	width: 200px;
	height: 35px;
	border:0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   padding-left: 5px;
   font-weight: bolder;


}
.aa input[type="password"]{
	width: 200px;
	height: 35px;
	padding-left: 5px;
	border:0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   font-weight: bolder;

}

.aa input[type="submit"]{
	width: 100px;
	height: 35px;
	border: 0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   background-color: skyblue;
   font-weight: bolder;
}



</style>
</head>
<body>
<div class="aa">
<h2>Members Area</h2>
<form>

<input type="text" placeholder="Username"><br><br>
<input type="password" placeholder="Password"><br><br>
<input type="submit" value="Login"><br><br>



</body>
</html>

here is my sql.

-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 08, 2016 at 09:58 AM
-- Server version: 5.1.36
-- PHP Version: 5.3.0

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `activity`
--

-- --------------------------------------------------------

--
-- Table structure for table `product`
--

CREATE TABLE IF NOT EXISTS `product` (
  `id` int( NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `code` varchar(255) NOT NULL,
  `image` text NOT NULL,
  `price` double(10,2) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `product_code` (`code`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `product`
--

INSERT INTO `product` (`id`, `name`, `code`, `image`, `price`) VALUES
(1, 'sampleproduct', '001', '1.png', 100.00),
(2, 'productsample2', '002', '2.png', 200.00);

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE IF NOT EXISTS `user` (
  `userid` int(2) unsigned zerofill NOT NULL AUTO_INCREMENT,
  `username` varchar(150) NOT NULL,
  `password` varchar(150) NOT NULL,
  PRIMARY KEY (`userid`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `user`
--

INSERT INTO `user` (`userid`, `username`, `password`) VALUES
(01, 'admin', 'admin');

here is the delete product

<!DOCTYPE html>
<html>
<head>
<title>Admin template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="admin.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,600,400italic,600italic,700' rel='stylesheet' type='text/css'>
</head>
<body>

<div id="header">
  <div class="logo">
    <a href="#">Xero<span>Source</span></a>
  </div>
  
</div>


<a class="mobile">MENU</a>


<div id="container">

  <div class="sidebar">
    <ul id="nav">
     
      <li><a class="selected" href="index.php">Homepage</a></li>
      <li><a href="productupdate.php">Update Product Product</a></li>
      <li><a href="delete.php">Delete Product</a></li>
<li><a href="productadd.php">Add Products</a></li>
    </ul>
    
  </div>

  <div class="content">
    <h1>Delete Product</h1>

   <table width="968" height="200" align="center" border="1" cellpadding="20">
  <tr>
    <td width="860" height="150" background="images/flower.png" bgcolor="#FFFFFF"></td>
  </tr>
</table>
<?php
if (isset($_POST['new']))
{
  header ("Location:productadd.php");   
}
?>
<?php
if (isset($_POST['delete']))
{
  header ("Location:productdelete.php");    
}
?>
<?php
if (isset($_POST['update']))
{
  header ("Location:productupdate.php");    
}
?>
</form>


<form name="Delete" method="post" action="delete.php">
<table width="55%" height="47%" border = "1"align="center" cellpadding="5" cellspacing="5" bgcolor="#FFFFFF">
  <tr>
  <td width="34%" background="images/g5.png">
  <p align="center" class="style1"> P R O D U C T  </p>
  <p align="center"><strong>I N F O R M A T I O N </strong></p></td>
  <td width="66%" height="240" background="images/s1.png">
  
    <p align="center"><strong>
      <?php
  require 'defaultproduct.php';
  $sql = "SELECT * from product order by name asc";
  $result = mysqli_query($conn, $sql);
  if (mysqli_num_rows($result) > 0) 
    {
    while($row = mysqli_fetch_assoc($result)) 
  {
  ?>
      <?php echo '<input type = "radio" name ="selectrow" value="'.$row['id'].'>"';?>
    <br>
    <br>
      <?php echo 'Product Code :'.$row["code"];?>
      <br>
      <?php echo 'Product :'.$row["name"];?>
    <br>
      <?php echo 'Price :'.$row["price"];?>
    <br>
        <?php
  }
  }
  ?>


  </div>


</div><!-- #container -->

<script type="text/javascript">

	$(document).ready(function(){
     $("a.mobile").click(function(){
      $(".sidebar").slideToggle('fast');
     });

    window.onresize = function(event) {
      if($(window).width() > 480){
      	$(".sidebar").show();
      }
    };


	});

</script>

</body>
</html>

add product

<!DOCTYPE html>
<html>
<head>
<title>Admin template</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="admin.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,600,400italic,600italic,700' rel='stylesheet' type='text/css'>
</head>
<body>

<div id="header">
  <div class="logo">
    <a href="#">Xero<span>Source</span></a>
  </div>
  
</div>


<a class="mobile">MENU</a>


<div id="container">

  <div class="sidebar">
    <ul id="nav">
      
      <li><a class="selected" href="index.php">Homepage</a></li>
      <li><a href="productupdate.php">Update Product Product</a></li>
      <li><a href="delete.php">Delete Product</a></li>
<li><a href="productadd.php">Add Products</a></li>


    </ul>
    
  </div>

  <div class="content">
   <table width="55%" height="47%" border = "1"align="center" cellpadding="5" cellspacing="5" bgcolor="#ff9999">
  <tr>
  <td width="34%" background="images/nature.jpg">
  <p align="center" class="style1"> P R O D U C T  </p>
  <p align="center"><strong>I N F O R M A T I O N </strong></p></td>
  <td width="66%" height="240" background="nature.jpg">
    <div align="center">
      <p> </p>
      <p><strong><color=red>Product Code :</color> 
        <input type="text" name="productcode">
      </strong><br>
        </p>
      <p><strong>Product Name:
        <input type="text" name="productname">
        </strong><br>
        <br>
        <strong> Price :</strong>
        <input type="text" name="price">
        </p>
      <p>
        <strong>Description :</strong>
        <input type="text" name="textfield">
        </label>
      </p>
      <p>
          <input class="input-group" type="file" name="user_image" accept="image/*" />
        </p>
        <p>
          <input type="submit" name="add" value="ADD">
        </p>
    </div>
  </div>


</div><!-- #container -->

<script type="text/javascript">

	$(document).ready(function(){
     $("a.mobile").click(function(){
      $(".sidebar").slideToggle('fast');
     });

    window.onresize = function(event) {
      if($(window).width() > 480){
      	$(".sidebar").show();
      }
    };


	});
<?php
if (isset($_POST['add']))
  { 
  if($_POST["productcode"] == null || $_POST["productname"] == null || $_POST["price"] == null || $_POST["user_image"] == null)
  {
  echo 'ERROR , Product information required!';
  }
  else
  {
  require 'defaultproduct.php';
  $sql = "INSERT INTO product (code,name,price,img) VALUES ('".$_POST["productcode"]."' , '".$_POST["productname"]."' , '".$_POST["price"]."' , '".$_POST["user_image"]."')";
  mysqli_query($conn,$sql);
  echo 'Product ADD !';
  }
  }
?>
<?php
if (isset($_POST['delete']))
  { 
  header("Location:productdelete.php");
  }
?>

<?php
if (isset($_POST['new']))
  { 
  header("Location:productadd.php");
  }
?>

<?php
if (isset($_POST['update']))
{
  header ("Location:productupdate.php");    
}
?>
</script>

</body>
</html>

update

<!DOCTYPE html>
<html>
<head>
<title>Admin template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="admin.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,600,400italic,600italic,700' rel='stylesheet' type='text/css'>
</head>
<body>

<div id="header">
  <div class="logo">
    <a href="#">Xero<span>Source</span></a>
  </div>
  
</div>


<a class="mobile">MENU</a>


<div id="container">

  <div class="sidebar">
    <ul id="nav"><li><a class="selected" href="index.php">Homepage</a></li>
      <li><a href="productupdate.php">Update Product Product</a></li>
      <li><a href="delete.php">Delete Product</a></li>
<li><a href="productadd.php">Add Products</a></li>
    </ul>
    
  </div>

  <div class="content">
    <h1>Update Product</h1>

    <form name="Delete" method="post" action="">
<table width="55%" height="47%" border = "1"align="center" cellpadding="5" cellspacing="5" bgcolor="#FFFFFF">
  <tr>
  <td width="34%" background="images/g8.png">
  <p align="center" class="style2"> P R O D U C T  </p>
  <p align="center"><strong>I N F O R M A T I O N </strong></p></td>
  <td width="66%" height="240" background="images/g8.png">
  
    <p align="center">
      <strong>Product Code :</strong>
      <input type="text" name="productcode">
      </p>
     <p align="center"><span class="style1">Product Code Required!</span><br>
        <br>
        <br>
        <strong>Product Name :        </strong>
        <input type="text" name="productname">
        <br>
        <br>
        <br>
        <strong>Price :       </strong>
        <input type="text" name="price">
      </p>
    <p align="center">
      <input type="submit" name="updateselect" value="Update">
      </p>
    <p align="center">
      <?php
if (isset($_POST['updateselect']))
  { 
  if($_POST["productcode"] == null || $_POST["productname"] == null || $_POST["price"] == null)
  {
  echo 'ERROR , Product information required!';
  }
  else
  {
  require 'defaultproduct.php';
  $name = $_POST['productname'];
  $price = $_POST['price'];
  $code = $_POST['productcode'];
  $sql = "UPDATE product SET name='$name',price='$price' WHERE code='$code'";
  mysqli_query($conn,$sql);
  echo 'Product Updated!';
  }
  }
  
?>
      </p></td>
  </tr>
</table>

</form>

</div><!-- #container -->

<script type="text/javascript">

	$(document).ready(function(){
     $("a.mobile").click(function(){
      $(".sidebar").slideToggle('fast');
     });

    window.onresize = function(event) {
      if($(window).width() > 480){
      	$(".sidebar").show();
      }
    };


	});

</script>

</body>
</html>

register user

<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
body{

	background-image: url(images/nature.jpg);
	background-size: cover;
}
.aa{

width: 300px;
height: 280px;
background-color: rgba(0,0,0,0.5);
margin: 0 auto;
margin-top: 60px;
padding-top: 10px;
padding-left: 50px;
padding-right: 0px;
border-radius: 15px;
-webkit-boarder-radius:15px;
-o-boarder-radius:15px;
-moz-boarder-radius:15px;
color: white;
font-weight:bolder;

}

.aa input[type="text"]{
	width: 200px;
	height: 35px;
	border:0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   padding-left: 5px;
   font-weight: bolder;


}
.aa input[type="password"]{
	width: 200px;
	height: 35px;
	padding-left: 5px;
	border:0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   font-weight: bolder;

}
.aa input[type="email"]{
	width: 200px;
	height: 35px;
	padding-left: 5px;
	border:0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   font-weight: bolder;

}

.aa input[type="submit"]{
	width: 100px;
	height: 35px;
	border: 0;
	border-radius: 5px;
   -webkit-boarder-radius:5px;
   -o-boarder-radius:5px;
   -moz-boarder-radius:5px;
   background-color: skyblue;
   font-weight: bolder;
}



</style>
</head>
<body>
<div class="aa">
<h2>New User Registration</h2>
<form>

<input type="text" placeholder="Username"><br><br>
<input type="password" placeholder="Password"><br><br>
<input type="email" placeholder="Email"><br><br>
<input type="submit" value="Register"><br><br>



</body>
</html>
Link to comment
Share on other sites

ugh...

 

1. in security.php it wont allow me to enter my username and password even sql is admin and admin

1. Be more specific.

2. The file has barely anything in it - least of all no PHP code. I don't know what you expect it to do because it's not set up to do anything.

 

2. i dont know how to put a delete product  to delete specific product

1. There's no button to submit the form. There isn't in security.php either but hitting Enter typically works.

2. You cannot use a redirect to process a form submission. Do the work to delete products in delete.php. (The ID to delete is in $_POST if you know where to look for it.)

 

3. i cant add/update/ product.

Be more specific.

 

4. i cant register a new user..

Be more specific.
Link to comment
Share on other sites

By the way: You'll make life a lot easier for yourself and everybody involved if you implement the features one by one and test them before moving on.

 

What good is your collection of 14 PHP scripts when appearently none of the relevant features work? Now you have lots of broken code which you can't fix and others don't want to fix.

 

Pick one feature (e. g. user registration). Work on just this one feature until it reliably yields the expected results. The major benefit of this approach is that debugging and getting help is so much easier, because there's just one or maybe two scripts involved, not 14.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.