By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Secure Login PHP

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.