Current location: Hot Scripts Forums » General Community » Script Requests » Need Login which will then redirect


Need Login which will then redirect

Reply
  #1 (permalink)  
Old 11-18-05, 02:23 PM
jwcrosby jwcrosby is offline
New Member
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Need Login which will then redirect

I need a script that works with a My SQL database (I'm assuming) that would allow a user to first of all login with a username and password (which I can assign, so I don't necessarily need a "register" option). Then, they will be taken to a specific page on the site that is their personal page. (For the curious, it's for a piano teacher's website. Parents will login to see their monthly statement, and maybe the teacher's comments on their child's progress. Doesn't need to be elaborate...we're only talking about 15 parents.)

Any ideas?

Jerry
Reply With Quote
  #2 (permalink)  
Old 11-18-05, 03:04 PM
chrille112 chrille112 is offline
Newbie Coder
 
Join Date: Nov 2005
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jwcrosby
I need a script that works with a My SQL database (I'm assuming) that would allow a user to first of all login with a username and password (which I can assign, so I don't necessarily need a "register" option). Then, they will be taken to a specific page on the site that is their personal page. (For the curious, it's for a piano teacher's website. Parents will login to see their monthly statement, and maybe the teacher's comments on their child's progress. Doesn't need to be elaborate...we're only talking about 15 parents.)

Any ideas?

Jerry

Hmm, try look around hotscripts, there should be something like that. Personally I prefer custom solutions Contact me if interested!

Have a nice evening!
Chrille
Reply With Quote
  #3 (permalink)  
Old 11-29-05, 09:35 AM
BLiZZaRD BLiZZaRD is offline
New Member
 
Join Date: Nov 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Not sure if this is usefull, ('specially for 15+, but I use it for 3, and don't see why it wont work )

Code:
<?php
if($_POST['user']) {
if(($_POST['user'] == "User1") && ($_POST['pass'] == "Pass1")) header("Location: /user1.htm");
else if(($_POST['user'] == "User2") && ($_POST['pass'] == "Pass2")) header("Location: /user2.htm");
else if(($_POST['user'] == "User3") && ($_POST['pass'] == "Pass3")) header("Location: /user3.htm");
else header("Location: wrong.htm"); 
} else {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Welcome, Please Enter!</title>
</head>


<body>
<br><br>
<center>
<font size= "6">Please enter your Username and Password!</font><br><br><br>
<form action="<?=$PHP_SELF?>" method="post">
<p>Username: <input type="text" name="user"/>
Password: <input type="password" name="pass"/>
<input type= "submit" value= "Enter"/></p>
</form>
</center>
</body>
</html>
<?php } ?>
.Just change the BLUE text with the usernames and passwords you choose for each parent, change the RED text with the folder/page they will be redirected too. And the GREEN text with the error page location if they enter the wrong username and/or password.

Then just add the

Code:
else if(($_POST['user'] == "User3") && ($_POST['pass'] == "Pass3")) header("Location: /user3.htm");
lines for each user you need. You can also change the HTML (page title, welcome message, and submit button text) as needed.

Hope it helps!
Reply With Quote
  #4 (permalink)  
Old 07-27-07, 01:05 AM
analoguedependent analoguedependent is offline
New Member
 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
i am very (very) new to php, but wouldnt that make username & password accessible by public ie/security issue?

Last edited by analoguedependent; 07-27-07 at 01:06 AM. Reason: **** grammar!
Reply With Quote
  #5 (permalink)  
Old 07-30-07, 07:53 AM
Boraan's Avatar
Boraan Boraan is offline
Coding Addict
 
Join Date: Jul 2007
Location: Clayton, NC
Posts: 292
Thanks: 0
Thanked 1 Time in 1 Post
I agree with custome solutions. Let's say that you have 1,000 customers. Intead of having 1,000 different pages for each customer, (nasty burden on your server during peak hours), I'd go back to basics - Cascading Style Sheets.

Everybody would have the same default page and would be allowed to make their own changes and save their preferences. Of course you would have to implement a relational database for those preferences, which shouldn't be difficult.

Just create a table with a userid, username, bgcolor, h1, etc... and when the user logs in it retreives those variables.

This will also mean that your default page will have to be loaded from the database as well.
__________________
Dexter Nelson
Techdex Development & Solutions
========================
Internet Marketing For Programmers | Free Market Research in 15 Minutes or Less
My Software: Hotscripts Softpedia software.techdex.net
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Login Redirect Jig0901 ASP.NET 2 04-17-05 04:40 AM
Combine Multiple Login Scripts fernandose PHP 2 02-04-05 04:09 PM
Login and Redirect user script alistairgd Script Requests 4 01-03-05 03:30 PM
Redirect previous 2 pages after login mcrob PHP 5 01-01-05 07:35 AM
HELP! Php to login to HTACCESS? godfather PHP 4 03-06-04 12:03 AM


All times are GMT -5. The time now is 11:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.