Jump to content

SauloA

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Everything posted by SauloA

  1. I created a form to insert a record.  There is a a text box that is supposed to submit the date of when record is posted.  I'm trying to submit a value of Now() to the database but my datetime field in my MySQL database stored '0000-00-00 00:00:00'.  The problem seems to be the value of Now(). Here's my code.  The red is where I think the problem lies.  I'd appreciate any help. <body> <h1>Admin Home Page</h1> <p>Welcome <?php echo $_SESSION['MM_Username']; ?> </p> <p><a href="logout.php">Logout</a></p> <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">  <table>  <caption>Insert New Review</caption>    <tr valign="baseline">      <td nowrap="nowrap" align="right">Review Date:</td>      [color=red]<td><input type="text" name="urev_date" value="Now()" size="32" /></td>[/color]    </tr>
  2. Although Dreamweaver may have been a bad approach to create my website, is there still a way to fix my situation?
  3. I am new to PHP and have been using Dreamweaver to develop my blog.  When a user logs into the website I want there "user_id" to be stored but Dreamweaver's Log In User Server Behavior doesn't store a session variable for the "user_id".  I tried modifying the code slightly to add a MM_UserID session variable but the "user_id" isn't being stored, I think.  When a user adds a comment the "user_id" is supposed to be filled into the form with the MM_UserID session variable into the hidden field. Here's my code below.  The red text is what I added into the code.  I'd appreciate the help since this problem has been bugging me for 1 week. [font=Verdana]<?php require_once('../Connections/connBlog.php'); ?> <?php // *** Validate request to login to this site. if (!isset($_SESSION)) {  session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) {  $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (isset($_POST['username'])) {  $loginUsername=$_POST['username'];  $password=$_POST['password'];  $MM_fldUserAuthorization = "al_levelid";  $MM_redirectLoginSuccess = "home.php";  $MM_redirectLoginFailed = "failed.php";  $MM_redirecttoReferrer = true;  mysql_select_db($database_connBlog, $connBlog);    $LoginRS__query=sprintf("SELECT [color=red]user_id[/color], user_sname, user_pass, al_levelid FROM user_tbl WHERE user_sname='%s' AND user_pass='%s'",  get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));    $LoginRS = mysql_query($LoginRS__query, $connBlog) or die(mysql_error());  $loginFoundUser = mysql_num_rows($LoginRS);  if ($loginFoundUser) {        $loginStrGroup  = mysql_result($LoginRS,0,'al_levelid');        //declare three session variables and assign them    $_SESSION['MM_Username'] = $loginUsername; [color=red]$_SESSION['MM_UserID'] = $loginFoundUser['user_id'];[/color]    $_SESSION['MM_UserGroup'] = $loginStrGroup;          if (isset($_SESSION['PrevUrl']) && true) {      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];    }    header("Location: " . $MM_redirectLoginSuccess );  }  else {    header("Location: ". $MM_redirectLoginFailed );  } } ?>[/font]
×
×
  • 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.