H69UNtblNBNpha2dtB1Odn8qYp1Qk5NK2gi7yfceofo9N
/
home
/
ymswebso
/
public_html
/
reliancecleaning
/
sitecms
/
process-insert
/
Nama File / Folder
Size
Action
format.php
0.374KB
Hapus
Edit
Rename
insert-attribute.php
1.501KB
Hapus
Edit
Rename
insert-testimonial.php
1.311KB
Hapus
Edit
Rename
<?php ob_start(); ?> <?php include("../includes/session.php"); ?> <?php include("../includes/login-verify.php"); ?> <?php include("../includes/printmsg.php"); ?> <?php include("../includes/extra-vars.php"); ?> <?php include("../includes/connection.php"); ?> <?php ///// code start here ///// // define variables and set to empty values if ($_SERVER["REQUEST_METHOD"] == "POST") { $attribute_name = form_fields($_POST["attribute_name"]); $for_franchise = form_fields($_POST["for_franchise"]); $attribute_value = form_fields($_POST["attribute_value"]); $slug_replaced = preg_replace("/[^a-zA-Z ]/", "", $attribute_value); $attribute_slug = strtolower(str_replace(' ', '-', $slug_replaced)); $status = form_fields($_POST["status"]); $modified = form_fields($today); $created = form_fields($today); } function form_fields($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); $data = mysql_real_escape_string($data); return $data; } $sql = "insert into attributes (attribute_name, for_franchise, attribute_slug, attribute_value, status, modified, created)values('$attribute_name', '$for_franchise', '$attribute_slug', '$attribute_value', '$status', '$modified', '$created')"; $result = mysql_query($sql); $_SESSION['msg'] = '<div class="alert alert-success text-center"><strong>Attribute has been added successfully.</strong></div>'; header("location: ../manage-attributes?attribute_name=$attribute_name"); ?> <?php ob_flush(); ?>