Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Login Script W/ Page Redirection


I am in need of help in forming a script that will log users in securely and redirect each user to a user-specific page if login is successful. For example - login: user1 would be redirected to http://www.mydomain.com/users1.php or user1.html

I understand setting up the table with 3 variables - username / password / destinationpage. But how do I get it to redirect after the login? Can someone provide the script fo rme to edit or point me in the right direction?




View Complete Forum Thread with Replies

Related Forum Messages:
Login Script Redirection To A Other Page
I am new to programming and have been given the task of creating 3 login area's on our site that will allow multiple users to login, but to only one of the 3 area's using 1 login box. It is apparently some sort of redirection that needs to occur but I cannot figure it out. I have spent 3 days looking all over the internet for any information to help, but anything I found was a dead end.

View Replies !
Login Lgout And Login Without Closing Session Gives Redirection Error
I am stepping through a text book that sets up different websites. The
one I am testing is user registration.

I set up the scripts and this is what I observe:

Login (verifying against a mysql db) - no problem.
Logout - no problem.

Close the browser and try again - no problem.

Login > Logout > Login WITHOUT closing browser I get:

An error occurred while loading http://login.php when it should redirect
me to http://localhost/index.php.

I read somewhere on the news group that the
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname
($_SERVER['PHP_SELF']) . "/index.php") (in my example code) is called
once and so the error?

The logout.php destroys the $_SESSION variables, session itself and any
cookies so I thought it would be "like new" the second time around?

It appears to be linked to sessions but don't know enough to know how to
correct.

View Replies !
Login Redirection
I am having a bit of trouble with getting my redirection to work..for some reason no matter what login I use, I keep getting sent to the user.php page...here is the code I am working with.. Code:

View Replies !
User Login Redirection
If a user is not logged in on my site and goes to a page which they need to be, they are redirected to the login page. When they login, they are redirected to the page they were pm.

The preoblem is, if there are 2 $_GET values, it only reads the first.

Example:
http://www.mydomain.com/page.php?get=value&get2=value2

http://www.mydomain.com/login.php?redirect=http://www.mydomain.com/page.php?get=value

$_GET['get2'] is not in the login.php url.

I am using $_SERVER['REQUEST_URI']

View Replies !
Problem With Sessions In Login And Redirection
My website flow looks like this:

1. home.php (session start, session assigns id, then user can login with email and password);

2. home.php call process.php to check for login.

3. process.php calls session->login(username, password) to validate parameter

4. session.php then calls database.php to run the actual query and execute.

5. result comes back to session.php

6. result comes back to process.php

7. result comes back to home.php

8. if verified, it will call header("Location: home.php");

my problem is at step 8 where when i calls home.php, it actually resets the session variables to Guest, or null. Code:

View Replies !
Page Redirection - Link Index.html Page To A .php Pag
I have an index.html page with a link to a .php page This is the complete code of the .php page Code:

View Replies !
Page Redirection - Allow The User To Click A Button That Sent Them To A New Page
I am writing a little section of a home made shopping basket. I collect information and put it in the basket / db. However, I want to update into a new database the final order as and when I click a button that directs the usuer to Pay Pal. My thought was to allow the user to click a button that sent them to a new page that updates the final order database and then redirects to PayPal the information required for billing without the user having to press another button. Would this be a sensible wat to go about it.

View Replies !
Regarding Page Redirection
I have a form which when updated takes the user to an update screen. I was wondering if it was possible to redirect the user back to the screen where they entered the information and refresh the data basically just refreshing the page (and obviously updating the data in the database which is working fine).

I have tried using some code and I can easily redirect back to the right page but I also need to have the 'id' selected so that it displays the recently updated record. Below is the code I attempted to use (i have tried everything I can think of).

header('Location: OrganiseIDASX.php?id=echo $_GET[$id]');

View Replies !
Page Redirection
I'm building a site that has a notes/blog on it. I have the blog set up so that there will only be a certain number of posts per page. The posts are submitted via a simple form. I'm trying to figure out how to redirect the browser to the page that the post will show up on after it is submitted. Right now it just goes back to page one even though you're making a post that will display on page two, for example. I have this line in my code:

header("Location: index.php?page=notes");I'm thinking that I need to set up some kind of variable to pass the page info to so that it goes back to the corresponding page after the post is submitted. Something like this:
header("Location: index.php?page=notes&pagenumber=some variable");How would I set this up?

View Replies !
Redirection To Another Page
I'm interested in doing something like what follows in PHP. php. By default, it shows them an HTML page without leaving page.php. However, if the user enters page.php?id=1 , then it will redirect them to another page, such as http://www.google.com. ID 2 would be different and so on and so forth. Could you do this with a switch or something?

View Replies !
Redirection To Previous Page
I'm trying to make a script that would upon execution would redirect current page to previous page. I'm integrating a user comment system for my website and when I do no specify "After inserting, go to page" it reloads current page but user comment is not visible, so I decided after adding a comment to send user to say redirect.php page, what would instantly send user back to submition page to see it's comment.

I cannot seem to find a suitable script to do this. Or maybe there is some other way to reload current page and for the comment to appear just after submition? Because I do not want people to reload page manualy to see their comments, in which case it would sumbit the comment twice.

View Replies !
Redirection Back To The Page Before You Log In When You Log In.
how to do redirection back to the page before you log in when you log in.

View Replies !
Entrance Page Cookie/redirection
I'm trying to find a way to allow visitors to my website who have already seen my entrance page to skip that and go directly to the main page. I'm not sure how to do this, or what my options are, but I think it's possible to do this with php and setting up a cookie.

I found some code online for this task, but it didn't seem to work (I made sure to enable all cookies in my browser). It seems to generate the cookie because I can see the cookie file on my computer, but it still doesn't skip the entrance page like it's supposed to. Code:

View Replies !
Page Redirection - Submit Button
file name: index.php

echo "<form action='swversion.php' METHOD=POST>";
echo "<input type=hidden name='action'value='swlist'>";
echo "<INPUT TYPE=HIDDEN NAME='entry' VALUE='.'>
";
echo "<input type='submit' value='List Software' class = 'formstyle'>";
echo "</form>";

I wanted to add something to this little form code; How do i redirect this index.php, once I click on the submit button it will take to me swversion.php as you could see that my action is doin that. I want that to happen after 5 secs or right away. As soon as hit the button, I want to that page to go back to this index.php again.

View Replies !
Create A Separate Page With One Login That Let's Me Login To All Of The Sripts At Once?
I'm building a website using various php scripts from I found on hotscripts. Because I'm not much of a programmer myself I'm using a separate script for the blog, another one for the links section and a different one for the gallery and so on. The downside to this is that I have to login on a separate page to update the gallery and another page to update the blog and so on.

Is there a simple way to either remove the need for a login for all the scripts and just create a separate page with one login that let's me login to all of the sripts at once?
Or if there's a script that can kinda save the passwords and logs in for me?

View Replies !
Alternative Command To HEADER For Page Redirection
Is there an alternative command to HEADER for page redirection using PHP? How can I use this alternative within buttons to go to a page when I onClick the button?

View Replies !
Main Page Login = Forum Login
This is going to be a website for a club im in at University. Now, I only want members of that club to be able to register.

The problem is that they pay a member fee. I want to know a way that when they pay me the fee (in person) I can give them a unique confirmation number from which they can register properly (sorta like a CD-Key). Code:

View Replies !
Page Redirection - Warning: Cannot Modify Header Information Headers Already Sent
Warning: cannot modify header information headers already sent( at start of D:search.php: 108) in d:search_play.php on line 242.i suggest a way I redirect or be automatically sent to a nother page without using header()? HTML Code:

//search.php is the html form
<form action="<php echo $SERVER['PHP_SELF'];?>" method = "post"> <!--line 108-->

PHP Code:

<?
//search_play.php process and display results
header("Location:../user_info.php"); //line 242

?>

View Replies !
Redirect From The Login Page To The Login Page
I have been working on a cms, and I got the login and main admin page working, so what I am trying to do is make it so if your not logged it, it redirects you to the login page. But the problem is once it gets to the login page, it continues to redirect from the login page to the login page, so its nonstop. How can I fix this.. Code:

View Replies !
Login Page Not Redirecting After Login
I've used this same snippet of code in other login forms without a problem (with some slight modifications from script to script) but this one seems to baffle me.

Basically it takes the login and validates the entries (validation works, error messages display if left blank), then checks the database for a match. If there's a match then it is supposed to forward the person onto the proper page using the 'header' function. Problem is it's not. Basically it's reverting back to the 'index.php' page (login page) and the display is completely blank. Here's the code for index.php: Code:

View Replies !
Warning: Cannot Modify Header Information - Redirect From Login Page To Logged In Page
I am trying to redirect from login page to logged in page, but using the {header( 'Location: C:wampwww' ) ;} is giving me this error {
Warning: Cannot modify header information - headers already sent by (output started at C:wampwwwpassword.php:14) in C:wampwwwpassword.php on line 35}, find below my code:

View Replies !
Login In A User, And Then Pass The Username And Session_id From Page To Page
I want to login in a user, and then pass the username and session_id from page to page until the leave the admin area of the site. Here's a simplified function: PHP Code:

View Replies !
Mail Server - Use My Page Login For The Mail Login User Is Stored In $_SESSION
I have a problem and no time to google it and i hope someone will guide me. I have a linux server (slack10) php/mysql and a website where you can create accounts and login.

i need to install a mail server with a web interface, i need to have a script that creates automaticly an email account when my page creates an account and a way to use my page login for the mail login user is stored in $_SESSION and the mail will be shown in iframe any sugestions?

View Replies !
User Login Page - Password Requiring Page
i just created a user login page which works. However, I don't know how to get them to a new password requiring page after they press the submit button. How do I go about getting them there?

View Replies !
Login Page Produces Blank Page
What I get when I enter username/password and hit submit is a blank page and the URL never changes. In other words, the login page is 'index.php' and when submitted it should redirect to 'admin.php'. Instead the url/address stays at 'index.php' and the page turns completely blank.

In the previous thread, the problem turned out to be some missing indicator to the md5 encrypted password. Well, in this version, that's there! In fact, I used the ending scripts for that project in creating this project. So, why it won't work is a real mystery. Code:

View Replies !
I Want The Page To Go Back To My Login Page.
I want to logoff my application and I have set up a link to do this. I
got it to destroy my session, but I can't get the page to go to the top
of the browser and do a page refresh. Here is the code I am using.

First there is the link I am using.

printf("<a href="%s?logoff=%s">%s</a><br>", $_SERVER['PHP_SELF'],"logoff", "LOGOFF");

Here is piece I use right at the top of the script to destroy the
session and try to refresh the page.

if (isset($_REQUEST['logoff'])){
session_destroy();
$_SERVER['PHP_SELF'];
}

What do I have to do to get the refresh to work?

View Replies !
Login Page - Previous Page
I have a login page, and instead of going to the index.php page all the time after a successful login, I want the user to be directed to the last page they where at, as long as it is a page on the website.

View Replies !
Login Page/members Page
I am having trouble getting my login page and mebers page to work. I believe it has something to do with the way the cookies are set or something because the if(isset($_COOKIE['cookiename'])) area of the code seems to be what is not functioning correctly. Code:

View Replies !
Login On Same Page
in my login page i redirect to a second page logincheck.php to check the details then redirect to the myaccount.php page when all is well, but i'm not sure how to put the code in the 1 page, because headers can't be sent twice error login.php Code:

View Replies !
Login Page Using Php
is possible using a php page and not using a MySql database? I want to have the client go to a login page and enter their username and password. There are 3 different clients.

If they enter the correct username and password they will be ridirected to their individual catalog page, if not they will go to a permission denied page. The code below is not the correct syntax but I hope it gets my idea across. Code:

View Replies !
WML PHP Login Page
I am having problems with the blow page. I have a login page where I enter the userid and password. This then connects to this page.

If I enter the userid and password correctly, it prints successfully logged into system. If I enter the wrong information all I get is an erro page HTTP status 502 etc. Code:

View Replies !
Login Page
I tried to make a login page, and store all the required information so that the user will not be able to go directly to a non-authorized page, but the whole idea was a failure. Does anybody know where I can find a script like that.

View Replies !
Login In Page Trouble
Ive been trying to get this login to work all day and it seems like i found the problem, im just unsure how to fix it.. PHP Code:

View Replies !
Get Page Source After Login
I want to get the source of a web page.
The problem is that this page is accessible only after I login, using
user name and password.
I wrote a simple script to get a page source and it works as long as no
login is necessary, but for the page I want I only get part of the
source, while part is missing. The missing part is with the personal
information.
I have my username and password, but I don't know how to send them in
the script, or what the other side is expecting.
(I know the site uses cookies, to store the session information.)

View Replies !
Login Page: Remember ME
This is my 1st posting to this group. Can any1 help me with the
"Remember Me" which is there in a login form. Im pasting the code
below. Im not able to set a cookie..

<?php
// saving script
session_start();
displayLogin();
// connect to the server
$conn= mysql_connect( 'localhost', 'csci242', 'spring2006' )
or die( "Error! Could not connect to database: " . mysql_error()
);

// select the database
mysql_select_db( 'blogtagz' )
or die( "Error! Could not select the database: " . mysql_error()
);
// get the variables from the URL request string

$uname = $_POST['uname'];
$password = base64_encode($_POST['password']);
$reme=$_POST['rememberme'];

/**
* checkLogin - Checks if the user has already previously
* logged in, and a session with the user has already been
* established. Also checks to see if user has been remembered.
* If so, the database is queried to make sure of the user's
* authenticity. Returns true if the user has logged in.
*/

function checkLogin(){
/* Check if user has been remembered */
if(isset($_COOKIE['cookname']) && isset($_COOKIE['cookpass'])){
$_SESSION['uname'] = $_COOKIE['cookname'];
$_SESSION['password'] = $_COOKIE['cookpass'];
}

/* Username and password have been set */
if(isset($_SESSION['uname']) && isset($_SESSION['password'])){
//if(confirmUser($_SESSION['uname'], $_SESSION['password']) == 0){
/* Confirm that username and password are valid */
if(confirmUser($_SESSION['uname'], $_SESSION['password']) != 0){
/* Variables are incorrect, user not logged in */
unset($_SESSION['uname']);
unset($_SESSION['password']);
return false;
}
return true;
}
/* User not logged in */
else{
return false;

}
}

View Replies !
Login / Log Out - Need To Refresh Page?
I got a login / logout script that resides on the same page. Basically if the URI includes action=logout I call a logout function that kills all the session variables. Otherwise I try to log in using the posted data, or do nothing if the form wasn't posted.

My problem is that I have somewhere on the page a small piece of code that says: 'You are logged in - <link>logout</link>'.

Now upon successful login this piece of code does not appear (until I refresh the page or navigate away from it) and similarly the piece of code still appears once I am logged out (until I refresh the page or navigate away from it).

View Replies !
Unexpected 0 On My Login Page
I'm trying to intergrate a Login PHP System and it was all going well till I noticed a 0 come up at the bottom of my page. On the original script (before I edited it to fit in with my website) it never came up but now I don't know how to get rid of it. It appears in a little table that shows the result of the login, ie. the errors.

But now before the user logs in/when they go onto the page a zero pops up. I wanted to keep the system fairly simple and get rid of all the css stuff. Here is the edited source code that gives me the 0. Code:

View Replies !
Referring Page After Login
I am using Dreamweaver's built in authorization code (with modifications to make it actually work) and php5 and I would like the user to go back to the referring page after they login. In other words, a user will read a webpage that says "read more". When they click that it will take them to that page but if they are not already logged in they will go to the login page first. After they log in I need them to be taken to the page that they were headed to. Right now it's taking them to the "  $MM_redirectLoginSuccess = "memberarea.php"; page. Code:

View Replies !
Different Page For Different User After Login
i want to make a login page and every user will use the same page for login. when they will give user id and password and the system will automatically show different page for different user. Sample:

Admin will automatically redirect to admin.php page

User will automatically redirect to user.php page.

Any idea and sample code for it ??

View Replies !
Create A Php Login Page
I just want to know how can I create a php login page and a download page for each customer that login's in.

View Replies !
Redirect To Same Page After Login..
I have login box running across all pages for login, template based.. so the script is module based ..

on login script page

tep_redirect(tep_href_link(FILENAME_DEFAULT)); and it goes to index.php  -- I want the filename to go the same page after login....    ie stay on the same page... how can I define this ?  I thought I could define a _DEFAULT2 and define that where the filenames.php are located... what is the script for redirecting to the self/ same page in php..tried a few things but no luck,,,should be pretty simple?

View Replies !
Login - Opens A Different Page.
How is it possible, to have my login, so that when the username equallys staff 01 staff 02 or admin it opens a different page.

View Replies !
Login Page Processing
I have to use a login form in my web based project. After the username and password has been verified from the database, the system has to display the module for which the user is given access to. How do I code this aspect without using the anchor link.

eg: echo "<a href='somepage.php'>Youhave been directed to the abc system</a>; "
I have considered 2 options:
1).To have a select case and display the module address;
2).To get the module address from the database and direct the user to that page.

View Replies !
Secure Page Login?
I'm a newbie and learning using a php book and Sam's PHP, mysql and apache. The following is on a test site and the db has only user auth info. This accesses a test page. Can anyone see any issues? When I login in it directs back to the Login page per code for an invalid username and password.

View Replies !
Administrative Login Page
The short version: Is there any way to write an HTML form such that the $_SERVER['HTTP_REFERER'] in the PHP script will not be what it really was (ie spoofed)? Code:

View Replies !
User Login Page
I am not able to figure out where the problem lies for this code. When I input wrong id, it does not show me any error and when I put the correct user name and password, it does not go to main.php.

<?php
// we must never forget to start the session
session_start();
$errorMessage = ''

if (isset($_POST['txtUserId']) && isset($_POST['txtPassword'])) {

include 'connect.php'

$userId = $_POST['txtUserId'];
$password = $_POST['txtPassword'];

// check if the user id and password combination exist in database
$sql = "SELECT user_id
FROM tbl_auth_user
...............

View Replies !
Direct To Login Page
how to prevent a user from downloading a file if he simply types a file name at the browser (eg. http://www.abc.com/myfile.zip). If this happens, the browser would direct the user back to the login page and ask him to login first before he can process.

View Replies !
Simple Login Page
I would like to ask on how to create a PHP script with my login page. These are my details:

txtusername -> for username
txtpassword -> for password

$host = "localhost"
$database = "crismon"

View Replies !
Regarding The Sessions For A Login Page
I have created a login page with username i,e mail Id n Password and a sign in Button......that mail id n password were already created in Database.....!!! Code:

View Replies !
Login Page Not Working
I have a database installed that can accept a csv file.
when I installed onto a new server, it wont upload.  is there anything obvious in the phpinfo that could be causing this? also, the login page wont work on this server.
just reloads the page again when submitting the user and pass Code:

View Replies !
After Login, Go To Previous Page
I'm currenting doing a rating program. Anyone can access the profile of any member, but if you want to rate someone, you must login.

Say you are at the member page, you want to rate the person. You select the rating from a drop down menu and hit submit.

The next page first checks to see if you are a member, if you are not, it forces you to login. Code:

View Replies !
Login Page Doesn't Always Redirect
Form login.php page user post username and passwd. in login_ckh.php page it validated usename and passwd from Mysql DB. but the problem is --> login_chk.php not redirect user automatically every time (some time it does,some time it does not).

when it does not redirect, if i press F5/refresh then it redirects to desired page. Their is a BUG in the script. Hours passed but i cannt find any solution. (note: i m new in PHP and session concept). Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved