Jump to content

admin question regarding, edit and delete function...


bossman

Recommended Posts

Hi all,

 

I am currently in the process of building an admin for a directory website we are currently working on.. here is a link to the admin...

 

http://mediagenius.biz/test/hairlossdir/index_test_admin.php

 

as you can see, there are 3 basic functions. Add, edit, and delete...universal among content management systems.

 

The problem i am having, is that i stopped coding for a short while, and i need a point in the right direction regarding the edit and delete functions...

 

so far the add function works fine.

 

here is the code for the add...

 

<?
require("db_connect.php");

$new_name = $_POST['name'];
$new_contact = $_POST['contact'];
$new_streetaddress = $_POST['streetaddress'];
$new_city = $_POST['city'];
$new_state = $_POST['state'];
$new_zipcode = $_POST['zipcode'];
$new_country = $_POST['country'];
$new_phonenumber = $_POST['phonenumber'];
$new_email = $_POST['email'];
$new_website = $_POST['website'];

//query to insert files and info into database
$query = "INSERT INTO hair_loss_clients (name, contact_name, street_address, city, state, zipcode, country,  phone_number, email, website)
VALUES
('$new_name', '$new_contact', '$new_streetaddress', '$new_city', '$new_state', '$new_zipcode', '$new_country',  '$new_phonenumber', '$new_email', '$new_website' )";

$result=mysql_query($query);

mysql_close($link);

header("Location: http://mediagenius.biz/test/hairlossdir/index_test_admin.php");

?>

 

when i click the 'edit' button, i want it to pull in all the information into the text fields based on the id. I have done this before, but im not positive how to put the code together...

 

i know that in the 'edit' link, i will have to pass the $id so that it knows which information to pull into the text fields...once i do that i know what to do...

 

any help is appreciated!

 

 

 

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.