0

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

2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by -==Zero==-
0

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

0

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

0

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

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.