473,800 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Secure Login PHP

I am trying to develop a PHP site so that I may record my poker
winnings and display the results on my blog. I haven't used php in a
long time so I need to beginner type help. I know I am going to have
to write a login page that communicates with a MYSQL sever so that
shouldn't be an issue either. My issue is I am not sure if I should
write code to check login state to appear on every page after the
login. I also when the user hits the submit button on the webpage
should I post the webpage to itself or should I pass the user info to
the next page and do the user validation there. Please let me know
what I should do.
Dec 29 '07 #1
2 1622
wqmmnm wrote:
I am trying to develop a PHP site so that I may record my poker
winnings and display the results on my blog. I haven't used php in a
long time so I need to beginner type help. I know I am going to have
to write a login page that communicates with a MYSQL sever so that
shouldn't be an issue either. My issue is I am not sure if I should
write code to check login state to appear on every page after the
login. I also when the user hits the submit button on the webpage
should I post the webpage to itself or should I pass the user info to
the next page and do the user validation there. Please let me know
what I should do.
Yes, you need to check the login state on every page where that state is
important (i.e. it probably isn't on your home page, so you wouldn't
need it there).

As for validation - it all depends. I do it both ways; which one I use
depends on the needs at the moment.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Dec 29 '07 #2
On Dec 29 2007, 9:43 pm, wqmmnm <wqm...@gmail.c omwrote:
I am trying to develop a PHP site so that I may record my poker
winnings and display the results on my blog. I haven't used php in a
long time so I need to beginner type help. I know I am going to have
to write a login page that communicates with a MYSQL sever so that
shouldn't be an issue either. My issue is I am not sure if I should
write code to check login state to appear on every page after the
login. I also when the user hits the submit button on the webpage
should I post the webpage to itself or should I pass the user info to
the next page and do the user validation there. Please let me know
what I should do.
Your question is somehow unclear but, as far as i understood, you did
not need a mysql server and looking some way to keep others from your
pages being watched something like that.

<?php
$user="myuserna me";
if($_POST['username']==$user)
echo("some directive");
else die("you are not authorized");
?>
Furthermore you can start a session and assign the username session
variable on each page so will setup a basic login authorization.
However you need to pass through the php lang reference to remind,
giving you a code here will not be useful.

Best code in the world is the code you coded. ;)
Jan 3 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3451
by: ojorus | last post by:
Hello! I want to make a login system as secure as possible on a website I develop. * The user shall log on using a Username and a password (which is stored in a mySQL database) *The server which I use to run my application has "register_globals" activated (set to "on"), so that has to be taken into concideration *The system should be secure even if the user do not click "log out" when he is finished. (Users often just close the browser...
6
3137
by: Sarah Tanembaum | last post by:
I was wondering if it is possible to create a secure database system using RDBMS(MySQL, Oracle, SQL*Server, PostgreSQL etc) and web scripting/programming language(Perl, PHP, Ruby, Java, ASP, etc) combination? I have the following in mind: I wanted to store all my( and my brothers and sisters) important document information such as birth certificate, SSN, passport number, travel documents, insurance(car, home, etc) document, and other...
3
2118
by: Aaron | last post by:
Hey, I have a question about how secure the following will be.... I want to have a login form that posts to itself, so when it loads it checks if there is a username and password on the query list. If there is not, it asks for one. If there is, it checks to see if the information is valid. If it is not valid, it deletes the attributes and calls itself again.
18
2479
by: | last post by:
Please help. After a number of wrong turns and experiments I need advice on login management system to secure our web pages without inconveniencing our visitors or our internal staff. What I need: A system whereby the user only has to register ONCE and he will have automatic entry to ANY page without havinto to RE-LOGIN even if he comes in
6
4842
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and the other named Public. I placed my web.config file in my
1
2153
by: sharp2037 | last post by:
Hi Everyone, I am working on an ASP.net application and I have a homepage to which everyone visits of course and on that front page I have a user ID and password box and a login button. What I don't understand is some sites I visit don't use SSL on the login page. Instead you visit the homepage and there is no padlock. Then you type in your user ID and password and then click login and then it redirects to a secure area.
0
1491
by: Holly | last post by:
I copied this code that works to connect into Unix. I am looking for a way to get it to work with a secure Unix box. Anyone have any insights on how to do this? I am trying to build an sftp service. Thanks Holly Imports System Imports System.Net Imports System.IO
14
4927
by: knal | last post by:
Hi there, I'm looking for a secure login script for a sort-of-community site... (PHP, MySQL, sessions, or maybe something else ... ) I know there are a lot of scripts out there, but none of them really seem secure, or have other kind of flaws (like IP based login etc.). Why i'm asking here, is because there's experience out there, and i hope experience can tell me what my best shot is. I'm aware that i will very probably have to do...
2
1851
by: raknin | last post by:
Hi, I am looking for a close package of secure login and registeration written in PHP.The package that I am looking for should have the following functionality I believe this is standard functionality today: Login: 1. User enter user name and passsword 2. Forgot your password 3. Remember me on this computer
8
2872
by: Harris Kosmidhs | last post by:
Hello, while I'm developing sites for some time I never coded a login form with security in mind. I was wondering what guidelines there are. For my point of view I'm thinking of using md5 passwords (it's an one way function right?) in db. Is this a correct approach?
0
9691
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
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10276
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
10253
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
9090
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...
1
7580
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
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

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.