Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Use include statement in html file?


  • Please log in to reply

#1
magusbuckley

magusbuckley

    Member

  • Member
  • PipPipPip
  • 625 posts
Hello:

I'm using a web program that generates various .php pages for the backend of my business.

To make these pages look like the rest of my website, I'm copying and pasting their code into my own layout code and then saving it back into their program. The problem, however, is that the portion of code I can see and edit in the program is just the html code. So now their pages "look" like mine, but they certainly don't behave like they are supposed to.

I would like to use some include statements to call the necessary .php files required to bring back the functionality but I can't seem to do that in standard html. All of their templates render this way so I don't have the option of changing the file type to .php.

Any idea how I can have an html file include some php pages?

Thanks,

Magus
  • 0

Advertisements


#2
sajithafathima

sajithafathima

    New Member

  • Member
  • Pip
  • 2 posts
The include statement includes and evaluates the specified file.
Basic include example
vars.php
<?php

$color = 'green';
$fruit = 'apple';

?>

test.php
<?php

echo "A $color $fruit"; // A

include 'vars.php';

echo "A $color $fruit"; // A green apple

?>
  • 0

#3
magusbuckley

magusbuckley

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 625 posts
Thanks for the information.

After contacting the company that makes this program, I found that the only wasy I can only use the include statement in a specific DIV they created. If I use the statement in any other DIV, it won't work.

After that, I just created my own pages and used their DIV in their program to "include" the pages I created. Ha. Now, in their program, all of the pages just look like a single DIV with an include statement. Sill work around but it worked!

Thanks,

Magus
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP