Where can i find php source code?

Why Don't I See My PHP Code When I View Source?

Why saving a PHP page from a browser doesn't work

Updated on February 26, 2019

Web developers and others who are knowledgeable about web pages know you can use a browser to view the HTML source code of a website. However, if the website contains PHP code, that code is not visible, because all the PHP code is executed on the server before the website is sent to a browser. All the browser ever receives is the result of the PHP embedded in the HTML. For this same reason, you cannot go to a .php file on the web, save it, and expect to see how it works. You are only saving the page produced by the PHP, and not the PHP itself.

PHP is a server-side programming language, meaning it is executed at the web server before the website is sent to the end-user. This is why you can't see the PHP code when you view the source code.

Sample PHP Script

When this script appears in the coding of a web page or .php file that is downloaded by an individual to a computer, that viewer sees:

My PHP Page

Because the rest of the code is just instructions for the web server, it isn't viewable. A view source or a save simply displays the results of the code—in this example, the text My PHP Page.

Server-Side Scripting vs. Client-Side Scripting

PHP isn't the only code that involves server-side scripting, and server-side scripting isn't limited to websites. Other server-side programming languages include C#, Python, Ruby, C++ and Java. 

Client-side scripting operates with embedded scripts—JavaScript is the most common—that are sent from the web server to a user's computer. All the client-side script processing takes place in a web browser on the end-user's computer. 

Where can i find php source code?

Motivation

Hello friends. Maybe many of us are already familiar with what a programming language is and in particular what is PHP programming language. this time we will continue a discussion about the basics of PHP programming. let’s go straight to the first discussion.

Executing Source Code

Where can i find php source code?

How to Execute PHP Source Code

We start from this discussion.

  1. first, we have to Create source code with a text editors like Sublime Text or Notepad++.
  2. and then Save the source code into a file with a .php extension in the C:/xampp/htdocs folder.
  3. Open the xampp application and click start in the Apache section.
  4. Open a web browser. Enter the address /localhost/htdocs/filename.php. Filename.php is the file that contains the source code saved in step 1. Don’t forget to write the .php extension after the filename.

Where can i find php source code?

Note : 
The picture above is the result of the execution of the PHP program in which there is also the HTML language. The server will read or detect the PHP code When the server finds the <?php tag and ends When it finds the ?> . tag

Where can i find php source code?

Both scripts produce the same display. The difference lies in the way the PHP source code is executed.

Note :
The picture above is an example of the HTML language that is loaded using the PHP script

Conclusion

We have come to a conclusion. The conclusion from our discussion is The PHP file is stored in the c:/xampp/htdocs folder so that it can be executed. and then run apache module on xampp application to start execution. We will continue our discussion of Basic PHP in the next article. I hope this article can be useful.

Thank you.

How do I find the source code in PHP?

The only NORMAL way to view PHP source code sitting in some file is to use phps extension, instead of normal php extension. If you make the file extension . phps, decently configured server will output a color-formated source instead of generated html that one would expect.

Can I see PHP source code in browser?

PHP is a server-side programming language, meaning it is executed at the web server before the website is sent to the end-user. This is why you can't see the PHP code when you view the source code.

What is PHP source code?

PHP is a server-side scripting language created in 1995 by Rasmus Lerdorf. PHP is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

How do I copy a PHP source code from a website?

What to Know.
Chrome: Right-click a blank space on the page and choose View Page Source. Highlight the code, then copy and paste to a text file..
Firefox: From the menu bar, choose Tools > Web Developer > Page Source. Highlight the code, then copy and paste to a text file..
Safari: Select Show Develop in Advanced Settings..