473,387 Members | 1,575 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,387 software developers and data experts.

Log username and password

3
Hi! I'm looking for a script to keep track of players password and usernames. Simply, keep track of information that enters into a textbox. I've tried to make it work for about 1 week now, but i really can't find anything. I'm new to php but i know the bases of PHP.
I would appreciate if someone could help me with this!!
Apr 8 '12 #1
5 1612
Luuk
1,047 Expert 1GB
Why not post the code you have so far?
If you know 'some' PHP, it cannot be SO BAD that you are afraid to post it....

BTW, its not the website that is responsible for keeping track of passwords. A website only has to validate if the password is correct.
Apr 8 '12 #2
dridia
3
I mean, when you enter something in the two textboxes and hit a button it will create another HTML page like "log.htm" and when you enter that website you will be able to see what the person writed.
Apr 8 '12 #3
Luuk
1,047 Expert 1GB
a very simple, but straightforward example is here http://www.php.net/manual/en/tutorial.forms.php
This gives an example of how to enter name and age, and how to display this on another page.

If you understand how to do that, you can go a step further to learn hoe to store the info in some database, and retreive it for later reviewing....
Apr 8 '12 #4
dridia
3
I Got it working!
The "index.php" code
Expand|Select|Wrap|Line Numbers
  1. <form action="log.php" method="post">
  2.  <p>username<input type="text" name="name" /></p>
  3.  <p>password<input type="text" name="age" /></p>
  4.  <p><input type="submit" /></p>
  5. </form>
and for "log.php"
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3.     $name = $_POST['name'];
  4.     $age = $_POST['age'];
  5.     $file = "log-information.htm";
  6.     $open = fopen($file, "a+");        
  7.     fwrite($open, "<b>name</b> " .$name . "<br/>"); 
  8.     fwrite($open, "<b>age</b>". $age . "<br/>");
  9.     fclose($open);    
  10. ?>
Apr 8 '12 #5
Luuk
1,047 Expert 1GB
i would add this line of code after line 9:
Expand|Select|Wrap|Line Numbers
  1. header('Location: log-information.htm');
Becasue in you examle the user will see a blank page when sibmitting, with this line he will be redirected to the log-information page
Apr 9 '12 #6

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

Similar topics

4
by: Lobang Trader | last post by:
Hi all, I am trying to create a username and a password class. I would like to know what are the RECOMMENDED minimum and maximum length for both fields? These fields will be something like...
2
by: john brown | last post by:
There is a web page that I access frequently and would like to automate the authentication of the username and password. I would like to user a perl script but I'm not really sure about the steps....
14
by: John Davis | last post by:
Anyone knows how to create the username/password authorization dialog in ASP? Thanks, John
1
by: thoducng | last post by:
I am writing some code to access share folder on a remote network. DirectoryInfo dicInfo = new DirectoryInfo("remoteNetwork\shareFolder"); if (dicInfo.Exists) { //application code...
12
by: Cecil | last post by:
Does this make sense for a logon table: CREATE TABLE Logon ( ID INT NOT NULL IDENTITY PRIMARY KEY, name VARCHAR(15) NOT NULL, password VARCHAR(15) NOT NULL ) GO CREATE UNIQUE INDEX...
0
by: nemo | last post by:
I've included a list of username/password combinations in the Web.Config file and I've a simple aspx page with a username and password field for the users to log in. While the password field seems...
4
by: nemo | last post by:
I've included a list of username/password combinations in the Web.Config file and I've a simple .aspx page with a username and password field for the users to log in. While the password field is...
1
by: Grant Merwitz | last post by:
Is it possible to do an anonymous lookup in active directory through a web page? I am running a site with Domain Authentication activated. I am looking up a users email address in Active...
5
by: livefreeordie | last post by:
Hi, I'm part of a 5-person team that develops websites for our company. I need to use the ftp_* functions to find some files on another file server. I need to authenticate to the file server...
0
by: =?Utf-8?B?TW9uaXF1ZQ==?= | last post by:
I just reinstalled IIS as I worked with wamp before and yet I didn't find out how to have a php and a asp server working the same time on a computer. (I had to uninstall the IIS to get wamp at...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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
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...

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.