 |
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6  | This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

November 30th, 2004, 12:54 AM
|
|
Authorized User
|
|
Join Date: Nov 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Adding an option to change password to movie db
Hey all, I've successfully changed the login to call my db and verify passwords for different users.
I've even successfully set up pages that allow the user to change their password.
Now, after the user changes the password, I give them a link back to the main movie1.php page.
When you go back to that page, I get two undefined index errors at the top...here is the code at the top of my page, errors are on line 3 & 4 for user and pass
<?php
session_start();
$_SESSION['username']=$_POST['user'];
$_SESSION['userpass']=$_POST['pass'];
$_SESSION['authuser']=0;
Now....I dont want to start the session over again correct? the session variables should still be set, but how do I let the script know that?
I'm sure theres probably a simple answer, if anyone takes a second to let me know, I'd greatly appreciate it.
Thank you!
|
|

November 30th, 2004, 12:12 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
try this:
if(!(isset($_SESSION['username']) && isset($_SESSION['username'])) {
$_SESSION['username']=$_POST['user'];
$_SESSION['userpass']=$_POST['pass'];
$_SESSION['authuser']=0;
}
Christian
|
|

November 30th, 2004, 12:34 PM
|
|
Authorized User
|
|
Join Date: Nov 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks again for the info...
I'll try that as another option.
Basically, I have my login form page, then I have a script page that logs you in and redirects you to the index main page. This works fine for my needs, so far, but I'll remember your tidbit of code there.
Thanks again!
|
|

November 30th, 2004, 01:08 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
My pleasure
Christian
|
|
 |