answersLogoWhite

0

What is the source code for sample login by php language?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

This is completely basic login script. you'll definitely have more users(so user database in mySql or a file) and also security and session control stuffs.

<?PHP

if(isset($_POST['submit']))

{

$userName=trim($_POST['userName']);

$passWord=$_POST['passWord'];

if($userName=="yourName" and $passWord=="yourPassword")

{

//Contents for logged in user goes here

echo 'You are logged in to view protected contents!';

}

}

echo '<form method="post">

Username : <input type="text" name="userName" />

Password : <input type="password" name="passWord" />

<input type="submit" name="submit" value="Login">

</form>';

?>

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the source code for sample login by php language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Login code for HTML?

If you mean how to create a login code with HTML, you need a tag called and a tag called and something in another programming language, such as php or java. There is no login code necessary to use HTML.


How can text be converted into a language that computers understand?

Source code is translated into machine code by an interpreter, a compiler or an assembler, depending on the language that was used to write the source code.


In c language what is source program?

Source program or source code in any language is the code you write to make the program do what you want. Things like: #include &lt;stdio.h&gt; void main (); and so on are all pieces of source-code or source program


Is Ruby an interpreted language or a compiled language?

It is an interpreted language, however there are some versions that compile the source code to byte code which can then be interpreted with much greater efficiency than the original source code.


How do you change source code into machine code?

A program called a compiler, or sometimes an assembler (depending on the programming language) does this for you. You write the source code, then invoke the program that will convert this into machine language.


An assembler converts source program into?

An Assembler converts an assembly language source code into machine-specific code.


What do you mean programming language?

A programming language is a symbolic language that a computer programmer uses to write computer program source code. Source code is non-executable code and must be translated into machine code. A computer can be programmed to perform this conversion and thus produce the required machine code.


What do you mean by programming language?

A programming language is a symbolic language that a computer programmer uses to write computer program source code. Source code is non-executable code and must be translated into machine code. A computer can be programmed to perform this conversion and thus produce the required machine code.


Which is correct source program is a high level language or machine language?

Neither. Programming languages are what we use to create source code.


What language translates source code into binary form?

A Compiler.


Getting source code of c?

C is a programming language, so it doesn't have source code.(On the other hand, C compilers do have source code, but you, as a beginner in programming, could not understand them.)


Is gaming software for a fast paced action game that runs on a single computer a high or low level language?

The software that runs is neither--it is the binary or machine code. The binary code was generated from source code by an compiler or assembler. The source code can be written in a high or low level language or in a mixture. Most source code today is written in high-level language because it is easier to maintain and more portable. However, sometimes speed-critical sections of source code are written in low-level language such as assembly.