Error messages should be displayed within the html if certain fields on my member register form are left empty, if they are invalid types or if the username entered already exists. I've tried adding a record with an already existing username and it does direct to the member registration failed webpage however the error messages aren't displayed. I have shown the code for the member_registration file, validation file and the member_registration_failed file below: member_registration.php: [CODE]<?php require_once('InitDB.php'); echo <<< HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Member Login</title> <link rel="stylesheet" type="text/css" …

Member Avatar
Member Avatar
+0 forum 14

I create the session variable $_SESSION['SESS_MEM_ID'] within my validateLogin.php file shown here: [CODE] <?php include'db_config.inc'; require_once('InitDB.php'); $error_msg = ''; $error_flag = false; function clean($str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql_real_escape_string($str); } try { $dbh = new PDO("mysql:host=127.0.0.1;dbname=$db", $user, $password); } catch (PDOException $e) { die($e->getMessage()); } $username = clean($_POST['username']); $password = clean($_POST['password']); if((!isset($username))or(!isset($password))){ $error_msg = 'Missing Value or Values'; $error_flag = true; } if($error_flag){ $_SESSION['ERR_MSG'] = $error_msg; session_write_close(); header("location: login.html"); exit(); } $loginmatches = $dbh->query ("SELECT * FROM Member WHERE username = '$username' AND password = '$password'"); if($loginmatches){ if($loginmatches->rowCount() == 1){ $member = $loginmatches->fetch(PDO::FETCH_ASSOC); …

Member Avatar
Member Avatar
+0 forum 7

I have a form in account.php that is prefilled with the user's current info but can be changed and then when you submit, it updates the database. However, when returned to the page after the update, the prefilled text is not updated. It only updates if you re-log in. At this point I have only messed with updating the username. ACCOUNT.PHP [CODE]<div id="main_middle"> <h1>&nbsp; </h1> <h1>MANAGE YOUR ACCOUNT INFORMATION</h1> <p>&nbsp;</p> username : <form method="post" action="update_check.php"> <input type="text" name="username" value="<?php echo "".$_SESSION['username'].""; ?>" size="40" /> <input name="update data" type="submit" id="update data2" value="save changes"/> </form> <br /> <p>&nbsp;</p> email:<br /> <form method="post" …

Member Avatar
Member Avatar
+0 forum 4

Hello all, I am trying to transfer some variables to another page for editing. I am having troubles with the checkboxes. [CODE]GridView1.Rows(e.NewEditIndex).Cells(12).Text & "~\/~" & _[/CODE] is a checkbox and when passed and split it comes up as a empty string. I know there has to be a way to do this. This is the view side, triggered on a buttonpress. [CODE] Private Sub gridview1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing Session("wr_id") = GridView1.Rows(e.NewEditIndex).Cells(2).Text & "~\/~" & _ GridView1.Rows(e.NewEditIndex).Cells(3).Text & "~\/~" & _ GridView1.Rows(e.NewEditIndex).Cells(4).Text & "~\/~" & _ GridView1.Rows(e.NewEditIndex).Cells(5).Text & "~\/~" & _ GridView1.Rows(e.NewEditIndex).Cells(6).Text & "~\/~" & …

Member Avatar
+0 forum 0

I have the login page created that captures the userid & also an edit page that shows all info of a certain table in database. Trying to figure out when a user views the edit page to have it only show the info the user created. Making it only possible to edit info specific to that logged in user. I have a validate session that checks to make sure the user is logged, any suggestions would help greatly. - Thanks in advance.

Member Avatar
Member Avatar
+0 forum 6

Hey everyone, I'm relatively new to PHP coding and I have a question I've been having trouble finding the answer to - it may be I'm not sure [I]exactly[/I] what I'm needing or what it's called. I am trying to create a very rudimentary login in system where users will register, log in, and then other pages will check whether the user is logged in and if so, display their first name from the mySQL database. Here's what I have: [B]Login Page[/B] [CODE=php]<?php session_start(); // Start a new session require('dbconnection.php'); // Holds all of our database connection information // Get …

Member Avatar
Member Avatar
+0 forum 1

Hi While learning how to create and manage a session, I got through session time out technique, I got throw 2 ways : 1. Setting up garpage collection directive in php.ini file and 2. Create a session variable named, say, EXPIRE that holds the value [code]$_SESSION['EXPIRES']=time()+360;[/code] at the beginning of a session and then keep checking if it's the correct time to expire or not yet. My question is : which is the best practice in practical life? to depend on the server configuration file? or create your custom time out session?? Thank you in advance

Member Avatar
Member Avatar
+0 forum 2

Hello Frnds, I have an application developed in ASP.Net(C#) and MS SQL, its working fine and fulfilling the requirements. Now the problem is I have a [I]MS Access Database[/I] from where I have to read some data and feed it into ASP.Net form and then save it to [I]MS SQL Database[/I]. [I]Keep in mind i can't convert the MS Access DB to SQL directly as I need only few data from the MS Access DB.[/I] Well I tried to connect the MS Access DB with an ASP Page and stored the particular data in session variable and tried to feed …

Member Avatar
Member Avatar
+0 forum 5

I have searched the forum and Google but there was nothing that would give me a clue what's wrong with my code. I'm just starting PHP and I'm trying a few things. :) I have a page with login. Logging in works wonderfully, storing sessions with username does too. However, each user also has a user group assigned (stored in database), so I can control what the users can access. I'm getting the group value from the DB and into the session name. When I (admin) log in, the session is set correctly to 'admin' right after. However, on the …

Member Avatar
Member Avatar
+0 forum 3

The above classes provide an interface for reading the PHP session data. PHP alone only gives you access to the current users session. This class allows you to read all session files, and thus allow you to read session data across different users. This may be useful if you want to copy, backups session data, or transfer to a different format/handler etc.. At the moment it only reads file based session handling, with PHP doing the serializing and handling (the default setting). It does not support other session handlers or serializers. You can extend the base abstract class for different …

Member Avatar
Member Avatar
+2 forum 4

Hi, I have made a log in script that checks the database for username and password. I have everything working for the users (they must be logged in to access member.php). Now I have admin.php redirecting to a different page, but how do i keep users OUT of that page? Because I think the way this code is now, is if a USER logs in and somehow copies and pastes the admin page...they can access it. here is my log in script: [CODE]<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Shots by Shell User …

Member Avatar
Member Avatar
+0 forum 3

Hi I'm trying to develop a site that users can log into. It's all standard enough the details are being kept on a mysql database. I can add the details to the db but my code for logging in isn't working. here is my login script [CODE]function user_login($username, $password) { // Try and get the salt from the database using the username $query = "SELECT salt FROM users WHERE username='$username'"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { // Get the user $user = mysql_fetch_array($result); // Using the salt, encrypt the given password to see if it // matches the …

Member Avatar
Member Avatar
+0 forum 4

Hi, Is there any way of storing some variables, say username for a particular session in ASP.NET. E.g, If we let a user login in a page, then I want him to stay logged in for all the pages he traverses on the server. Currently, I am trying Server.Transfer and the Hashtable() methods to retrieve the value and use it again in other pages. Is there any better method than this? thanks in advance, Regards, Abhijit

Member Avatar
Member Avatar
+0 forum 5

The End.