Loading PHP page into HTML table

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

Rock

New Member
Impact
0
Hello,

I want to activate my nav buttons so the PHP pages that they are linked to will load into the HTML page.

Your input is greatly appreciated.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Rock said:
Hello,

I want to activate my nav buttons so the PHP pages that they are linked to will load into the HTML page.

Your input is greatly appreciated.

To ensure they are parsed, first of all rename the .html to .php (if you have access to your server I think there is a way to have PHP parse even in .html files).

Find the spot in your HTML and just do <? echo $variablename; ?>

If you want the contents of other PHP files to be loaded from another file you could also do something like <? include (somepath/file.php) ?>
I hope that was what you were looking for.

Cheers
 
0
•••
To make site-wide modifications easy, I create a master HTML file with a header and footer and use the following code to load a HTML file between the header and footer via PHP:

Code:
<!--- Call this file index.php -->
<?php if(isset($_GET['do'])) $do = $_GET['do'];
else $do = 'home'; ?>
<!--- HEADER CODE HERE (head, style tags, etc) --->
<?php if(file_exists($do.'.htm')) include $do.'.htm';
else print '<h2>Sorry</h2><p>The file requested was not found.</p>';?>
<!--- FOOTER CODE HERE -->

Links would look like index.php?do=mypage. For example index.php?do=files would load files.htm between the header and footer. If files.htm did not exist, the message would be display "Sorry. The requested file was not found". If no specific page was called (ie only index.php), it would load home.htm.

Hope this helps :)
 
0
•••
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back