answersLogoWhite

0


Best Answer

Your Question is difficult to make out But I think your asking "What is the source code in php language?" ... right?

If so then Let me first explain how PHP works. PHP is server side scripting wich means all the the source code resides on the server and is never reviled to the user. Most of the time the PHP scirpt will tell the user somthing but the user can never see the original context of the php script its self.

A very simply scipt in php looks like this:

<?php echo 'Hello World!'; ?>

This will show a page that simply says:

Hello World!

and nothing else. Below is a very simple secure script that requires a username and password to view the page:

[PHP Code Start]

<!--

Script Written by Wayne Hartmann

email: drhart4000@gmail.com

Feel free to use and modify this script.

-->

<?php

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

{

$user = 'User'; //Username to access script

$pass = '5f4dcc3b5aa765d61d8327deb882cf99'; // Password to access script (Use an MD5 hash to keep your password secret:

// http://www.adamek.biz/md5-generator.php can be used to generate an MD5 hash.

if (strtolower(addslashes($_POST['user'])) <> strtolower($user)) { die('Error invalid Username or Password.<BR>')};

if (md5(addslashes($_POST['pass'])) <> $pass) {{ die('Error invalid Username or Password.<BR>')};

//Start protected content

?>

<!-- Your conent goes here! NOTE that this area is not php enabled

unless you delete the ?> tag above and < ?php tag below. -->

<?php

//End protected content

}else{

//Start Login Form

?>

<HTML>

<head>

</head>

<body>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="auth">

This script is Protected. Please authenticate to continue.&lt;?php<BR>

<table width="460" border="0">

<tr>

<td width="77" height="24">Username:</td>

<td width="373"><input type="text" name="user" id="user2"></td>

</tr>

<tr>

<td>Password:</td>

<td><input type="password" name="pass" id="pass"></td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="button" id="button" value="Run Script">

</td>

</tr>

</table>

</form>

</body>

</HTML>

<?php

//End Login form

}; ?>

[PHP Code END]

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

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

Why do we use Php?

PHP is an Open Source Scripting Language. We can create Web Pages and Web Applications using PHP.


What is syntax in php?

We can use php tags in different ways. &lt;?php //php code to be written here ?&gt; OR &lt;? //php code ?&gt; This tag will not work when we using editors such as macromedia dreamweaver. OR &lt; script language="php"&gt; //php code &lt;/script&gt;


How can one easily style a PHP code?

There are many ways that one could style a PHP code. One would first have to learn how to properly format PHP coding and use the C++ programming language to make it look nice.


Why we use php?

PHP is a web programming language . It is majorly used in web applications. \ It is used for creating dynamic webpages that interact with the user . PHP offers many advantages; it is fast, stable, secure, easy to use and open source


What web language use at facebook?

PHP


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

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


How can you create a language converter for website in English to Spanish in PHP?

You can use PHP to create a language converter for a website by storing language translations in a database or files, and then using PHP to dynamically switch the content based on the selected language. You can create language files for each language, and then use PHP sessions or cookies to store the user's language preference across pages. Finally, use PHP functions to display the content in the appropriate language based on the user's selection.


What scripting engine does PHP use?

PHP itself is a scripting language, and uses it's own PHP interpreter (engine).


What are the PHP tags?

There are no PHP tags. Unlike HTML, PHP is not Markup language. They use scripts. An example would be &lt;?php echo "Hello, World!"; ?&gt;


Is there an event in PHP?

By an event I assume you mean a pre determined page of code that you can run at a specific date and time. In the language PHP, the answer is no. You cannot do this. On most Linux / Unix servers that use PHP, you can create a cron job that will run your code at a given date and time. When you put in the page address, make sure you use the full root address or it will not run.


Can i use php without a php admin or account?

Yes, you can use PHP without any admin account. It is a programming language you can install on any computer and does not have accounts inherently.


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.