Jump to content

Hiding php code from source


SirChick

Recommended Posts

How do you create a line in html to call a php file instead of having the php typed out fully withing the html ?

 

But i'd need to know two things, firstly im going to need to run php at different methods, these would be either the second the page loads the php would run or upon an action the code will run.

 

So basically i would have a html file + the php file seperate and then the html file calls up the php file.

 

I currently have the html and php all in one note pad and it displays all my code in the page source :S

Link to comment
https://forums.phpfreaks.com/topic/62089-hiding-php-code-from-source/
Share on other sites

an html file can't call a php file unless its a iframe, and that would be the really bad way to do it. You really need learn how to move between php and html inside the same page. For instance:

 

<p>this is html</p>
<?php
echo "this is php";
?>

an html file can't call a php file unless its a iframe, and that would be the really bad way to do it. You really need learn how to move between php and html inside the same page. For instance:

 

<p>this is html</p>
<?php
echo "this is php";
?>

 

 

I know that..... :S that wasn't what i was on about.......

 

Let me explain.

 

My registration code has the php right at the start of the page but only runs upon the register button being pressed, ive tested it and it all works dandy. Underneath that is the html that displays the page and form etc.

 

But on page source on a browser it displays the php aswell as the html. But i only want it to show the html and not the php.....otherwise they can see the connect to the database plus login n password that im using... which is not good obviously.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.