954,576 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Question About Tables

Hey Iam New Here And Iam Noob In Php

I Made A Web Site Directory Script

A Form So The User Can Post His Site And E Mail

This Site Show Directly

I Need To Make This Site Under Moderation First

Before It Show In Main Index File

I Have Admin Page

What Should I Do To Make Sites Waiting For Moderation First Before Its Show In The Dir

I Need Just To Know The Idea

-==Zero==-
Junior Poster
105 posts since Feb 2011
Reputation Points: 7
Solved Threads: 3
Infraction Points: 5
 

in the table with the sites put a status field.
then when listing the sites check for status=1 (e.g. approved)
when inserting you will use status=0 by default

lordspace
Junior Poster in Training
90 posts since May 2006
Reputation Points: 18
Solved Threads: 6
 

Thanks Can U Plz Send Me Example ?

Thats The Addsite Page

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("dir", $con);

$sql="INSERT INTO info (SiteName, SiteLink, Email)
VALUES
('$_POST[sitename]','$_POST[sitelink]','$_POST[email]')";

if (!$_POST['sitename'] )
{
header("location:Empty_Fields.php?msg=Fields-Empty"); 
}

if (!$_POST['sitelink'] )
{
header("location:Empty_Fields.php?msg=Fields-Empty"); 
}

if (!$_POST['email'] )
{
header("location:Empty_Fields.php?msg=Fields-Empty"); 
}

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }

print "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=./Success.php\"> ";

mysql_close($con)
?>


You Will Find Million Of Errors Coz Iam Noob Sorry

Plz Provide Me With The Code To Insert The Data In Db And Make It Under Moderation

-==Zero==-
Junior Poster
105 posts since Feb 2011
Reputation Points: 7
Solved Threads: 3
Infraction Points: 5
 
lordspace
Junior Poster in Training
90 posts since May 2006
Reputation Points: 18
Solved Threads: 6
 

Thanks So Much But Plz

CREATE TABLE `cmt_post` (
`post_id` int(5) NOT NULL auto_increment, `p_name` varchar(10) NOT NULL, `dt` date NOT NULL, `name` varchar(25) NOT NULL, `email` varchar(50) NOT NULL, `dtl` text NOT NULL, `status` varchar(4) NOT NULL default 'ns', UNIQUE KEY `post_id` (`post_id`,`p_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


Can You Short This Code To Include Just Only This Only

Site Name
Site Link
Status
Email

-==Zero==-
Junior Poster
105 posts since Feb 2011
Reputation Points: 7
Solved Threads: 3
Infraction Points: 5
 

nope. if you're serious about learning php/mysql you should spend some time reading.
there aren't any shortcuts to greatness ;)

lordspace
Junior Poster in Training
90 posts since May 2006
Reputation Points: 18
Solved Threads: 6
 

Hehe Ok Thank You :) I WIll Try To See What Can I Do Thanks Anyway

-==Zero==-
Junior Poster
105 posts since Feb 2011
Reputation Points: 7
Solved Threads: 3
Infraction Points: 5
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You