473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1602
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*******@attglobal.net
==================

Dec 29 '07 #2
On Dec 29 2007, 9:43 pm, wqmmnm <wqm...@gmail.comwrote:
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="myusername";
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
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...
6
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)...
3
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...
18
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...
6
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...
1
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...
0
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...
14
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...
2
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...
8
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.