thats what i mean...of course! lol
It seems my Session date storer isnt working now...it was working yesterday tho..i think. What it does is everytime submit is hit (when it was incrementing the day yesterday), it just decrements the month by 1 and the day switches to either 29,28,27 or 26...its really wierd...
here is the code where my session things happens....
<?php
session_start();
$_SESSION['name'] = $_POST['Name'];
$_SESSION['date'] = $_POST['Date'];
$_SESSION['projID'] = $_POST['ProjectID'];
$_SESSION['projName'] = $_POST['ProjectName'];
$_SESSION['client'] = $_POST['Client'];
$_SESSION['type'] = $_POST['Type'];
if($_SESSION['date'] != null){
$year = substr($_SESSION['date'],0,4);
$month = substr($_SESSION['date'],5,2);
$day =substr($_SESSION['date'],7,2);
$dateMK = mktime(0,0,0,date($month),date($day)+1,date($year),dst);
$_SESSION['date'] = date('Y-m-d',$dateMK);
}
then this is on the form where the date is autopopulated...wrong
if($_SESSION['date'] == null){
?>
<tr><td align="right" width="20%">Date: </td><td colspan="2"><input type="text" name="Date" value="yyyy-mm-dd"/></td>
<?php
}else{
?>
<tr><td align="right" width="20%">Date: </td><td colspan="2"><input type="text" name="Date" value="<?php echo $_SESSION['date']; ?>"/></td>
Also, another question regarding the code you wrote up there. I have to query from another database...is it alright to half way thru my code switch databases??:
(could this be where the error comes from, it wasnt until i added this code)
mysql_connect("url",$username,$password) or die ("Unable to connect to server");
@mysql_select_db("my second database") or die("Unable to select database");
$query="SELECT * FROM tblProjects";
$result=mysql_query($query);
?>
<tr><td align="right" >Project ID: </td><td colspan="2">
<?php
$f='<select name="ProjectID">';
while ($row = mysql_fetch_array($result)) {
$f.='<option value= "'.$row['ProjectID'].'">'.$row['ProjectID'].'</option>';
}
$f.='</select>';
echo $f;
?>
</td>
<td align="right"></td><td colspan="2"><input type="submit" name="projInfo" value="Show Project Information" /></td></tr> <!-- the button will generate project info for Project Name, Client and Type based on project number-->
I hope this all makes sense,
Paul