Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2004, 12:54 AM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to IP076
Default 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!

Reply With Quote
  #2 (permalink)  
Old November 30th, 2004, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this:
if(!(isset($_SESSION['username']) && isset($_SESSION['username'])) {
$_SESSION['username']=$_POST['user'];
$_SESSION['userpass']=$_POST['pass'];
$_SESSION['authuser']=0;
}

Christian
Reply With Quote
  #3 (permalink)  
Old November 30th, 2004, 12:34 PM
Authorized User
 
Join Date: Nov 2004
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to IP076
Default

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!

Reply With Quote
  #4 (permalink)  
Old November 30th, 2004, 01:08 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Fairfield, Iowa, USA.
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My pleasure

Christian
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change user name option jackandjo BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 October 11th, 2006 03:40 PM
PrintPreviewDialog1. Change printer option peterasimpson VB How-To 0 July 24th, 2006 06:44 AM
adding option elements dynamically to a select richard.york Javascript 4 December 5th, 2003 04:57 AM
change password help budakcomel Classic ASP Databases 0 July 29th, 2003 09:51 PM



All times are GMT -4. The time now is 06:12 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.