473,657 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The user just logged in... now what?

4 New Member
So I'm developing a web site and the user has just logged in.

What's the best way to get the user to the "main" page (as in redirect them)?

[PHP]if($sql->confirmLogin($ _POST['email'], $_POST['password']))
{
//insert brilliant code here
}
else
{
echo "Log in failure.";
}
[/PHP]

btw this is my first post!
Jul 6 '08 #1
4 1069
dlite922
1,584 Recognized Expert Top Contributor
If only I could have a dime for every time I get this question!

Expand|Select|Wrap|Line Numbers
  1. // begin brilliant code
  2.  
  3. header("Location: mainPage.php"); 
  4. exit();
  5.  
  6. // end brilliant code
  7.  
  8.  
Your welcome,


Dan
Jul 6 '08 #2
Markus
6,050 Recognized Expert Expert
If only I could have a dime for every time I get this question!
I? I'm sure you mean we.

;]
Jul 6 '08 #3
tkahn06
4 New Member
Sweet!


Thanks so much :-)
Jul 6 '08 #4
dlite922
1,584 Recognized Expert Top Contributor
I? I'm sure you mean we.

;]
I don't share money.

:D
Jul 6 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

15
7651
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not there at all? Any feedback would be helpful. Thanks! -Josh
7
8181
by: Aarti | last post by:
I have written a windows service that needs to perform certain functions only if a User is logged in. The problem I am running into is that I get an error if the computer is in the process of being shut down or restarted. At all other times, the service runs just fine. I need to either detect a logon/logoff event OR check somehow as to whether there is currently a valid logged on user. The closest I have found is ManagementEventWatcher...
4
1628
by: Brian Lowe | last post by:
I'm using Forms authentication with my user data in a SQL db. I have pages in the main appliaction folder accessible to anonymous users and I've set security to deny annonymous users access to pages in several sub folders (e.g. admin). I've set up a login page where users trying to access any /admin/ page are diverted to and on successful login they are redirected back to the page they requested. All is well. Everything works. I want...
11
4647
by: Alan Silver | last post by:
Hello, I am just planning a new ASP.NET site, and wondered about the best way to handle the following common scenario... The site has the option that registered users can log in and will have access to extra features. The log in form is a simple username/password affair that will appear in the margin of every page if they aren't yet logged in. If they are logged in, their user name will be shown, along with a button to log out.
3
1667
by: Alan Silver | last post by:
Hello, I have some pages that are protected by forms authentication, and am adding code to the global.asax so that if someone tries to load (say) /order83.aspx, if they are logged in, it will rewrite the url to /order.aspx?orderid=83, and if they aren't logged in, it will redirect them to the default page. The reason for this is that I don't want people seeing the login page if they aren't site admin folk. If I just let the normal...
2
2417
by: Scott M. Lyon | last post by:
I'm having some strange problems with a VB.NET application that I support. The application currently uses SystemInformation.UserName() and SystemInformation.UserDomainName() to determine who is logged in, and what network domain they are logged into. And for our environment here (logged into a domain), it seems to work just fine.
3
5757
by: Dave Smithz | last post by:
Hi there, I have a website where users can log into. This users sessions as I believe most people use when implementing a login section of a website (each php page first checks a valid parameter has been set to authorise that the user has logged in and if it is not found it redirects the user to the login page). I have my code and it works fine, however on the live server, after a period of inactivity the user will be logged out...
7
1771
by: John | last post by:
Hi We can get the current logged in user's name but is it also possible to get the default email form outlook of the currently logged-in user as well? The reason for this is that I need to email the users warnings from time to time. As the system may be running by different users on different pcs, I need to pick up the email of the currently logged-in user to send him/her the email. Thanks
8
28645
by: simonlpwaters | last post by:
I need to obtain the username of the currently logged in user on a machine. However, the program that needs to do this will be running under different credentials to the logged in user, so using Environment.UserName will give the user name of the user that is running the program. Any help would be appreciated, this is giving me a headache.
9
6271
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who only has read access to the users table so that users can log in. Once a user has been logged in successfully I want to escalate that user's access level to one appropriate to their role, which will include switching the postgres user they are...
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.