ok, here's the thing, I had to create a DateAdded into the dd_users table exactly like the one for posting something new, which would assign a date to each item...
the post.php file looks like this.....
<php><?
require_once("conn.php");
require_once("access.php");
if(isset($POST[s10]))
{
$MyTitle = strip_tags($POST[title1]);
$cats = explode("|", $_POST[cat1]);
$MyCategory = $cats[0];
$MySubcategory = $cats[1];
$MyText = strip_tags($_POST[text1]);
$t = time();
$q1 = "insert into dd_items set
ItemTitle = '$MyTitle',
ItemCategory = '$MyCategory',
ItemSubcategory = '$MySubcategory',
ItemText = '$MyIn|$MyText',
Contributor = '$_SESSION[username]',
DateAdded = '$t' ";
mysql_query($q1) or die(mysql_error());
header("location:YourItems.php");
exit();
}
//create the categories dropdown
$SelectCategory = "<select name=cat1>\n\t<option value=\"\"></option>\n";
$q1 = "select * from dd_categories order by CategoryName";
$r1 = mysql_query($q1) or die(mysql_error());
while($a1 = mysql_fetch_array($r1))
{
$SelectCategory .= "<option value=\"$a1[CategoryID]|0\">$a1[CategoryName]</option>\n";
//get the subcategories
$q2 = "select * from dd_subcategories where CategoryID = '$a1[CategoryID]' order by SubcategoryName ";
$r2 = mysql_query($q2) or die(mysql_error());
if(mysql_num_rows($r2) > '0')
{
while($a2 = mysql_fetch_array($r2))
{
$SelectCategory .= "<option value=\"$a1[CategoryID]|$a2[SubcategoryID]\">$a1[CategoryName] - $a2[SubcategoryName]</option>\n";
}
}
}
$SelectCategory .= "</select>";
//get the templates
require_once("templates/MainHeader.php");
require_once("templates/MainPost.php");
require_once("templates/MainFooter.php");
?></php>
So I dedided, in order to get an actual number, make sure when they register, they get a date....so I applied this code to the register.php
<php><?
require_once("conn.php");
if(isset($_POST[s1]))
{
$t = time();
$qm = "insert into dd_newsletter set nemail = '$_POST[e1]' ";
mysql_query($qm);
$q1 = "insert into dd_users set
username = '$_POST[u1]',
password = '$_POST[p1]',
email = '$_POST[e1]' ";
DateAdded = '$t' ";
mysql_query($q1);
if(mysql_error())
{
$error = "<center>The username <b>$_POST[u1]</b> is already in use.<br>Please, select another one.</center>";
}
else
{
$to = $_POST[e1];
$subject = "Your $_SERVER[HTTP_HOST] registration";
$message = "Hello,\nthis is your login information for $_SERVER[HTTP_HOST]\n\nUsername: $_POST[u1]\nPassword: $_POST[p1]\n\nHave some fun with http://$_SERVER[HTTP_HOST]";
$from = "From: $_SERVER[HTTP_HOST] <$aset[ContactEmail]>";
mail($to, $subject, $message, $from);
$_SESSION[username] = $_POST[u1];
header("location:post.php");
exit();
}
}
//get the templates
require_once("templates/MainHeader.php");
require_once("templates/MainRegister.php");
require_once("templates/MainFooter.php");
?></php>
the two things I've added : $t = time();
'
DateAdded = '$t' ";
of course, whenever I click register, the page doesn't show up....I believe I'm doing it right....but something is wrong. I have to figure out how to allow the guest to register and it add the date to the database before I can move on and use the other script. Any ideas?