Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.