-
Like I said before, you can include almost anything so you don't need to change the name of the file you are including. If you mean the name of the file which has this code, then you can use the .htaccess code I wrote before to be able to have the php code in html files.
-
thanks a lot my friend :D
-
For others coming across this thread, a small clarification/rephrasing...
The solution that Snookerman suggests basically tells the server to parse your HTML files through the PHP handler. This means that you can add PHP code within your HTML files. So, the .htaccess rule takes away the necessity to have a .php extension. This is useful if you're not at liberty to rename all of your website files.
-
Help please.
Hi guys,
Can I used the HTML markup below, save it as highslidegallery.html or highslidegallery.php and include inside a <td> using
<?php
include('/highslidegallery.html');
?>
I'm new to web design and would appreciate any expert comments/help.
Basically I have four "mini-galleries" on my gallery page and the page is infinite with the HTML mark up. All I want is to keep it nice and tidy, and if possible link/load it externally/dynamically using PHP. Can this be achieved?
Thanks for your time. Much appreciated.
<div class="highslide-gallery">
<a id="thumb1"href="highslide/images/1.jpg" class="highslide"
title="This is just an image"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/1thumb.jpg" alt=""/>
</a>
<div class="hidden-container">
<a href="highslide/images/2.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/2thumb.jpg" alt=""/>
</a>
<a href="highslide/images/3.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/3thumb.jpg" alt=""/>
</a>
<a href="highslide/images/4.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/4thumb.jpg" alt=""/>
</a>
<a href="highslide/images/5.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/5thumb.jpg" alt=""/>
</a>
<a href="highslide/images/6.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/6thumb.jpg" alt=""/>
</a>
<a href="highslide/images/7.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/7thumb.jpg" alt=""/>
</a>
<a href="highslide/images/8.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/8thumb.jpg" alt=""/>
</a>
<a href="highslide/images/9.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/9thumb.jpg" alt=""/>
</a>
<a href="highslide/images/10.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/10thumb.jpg" alt=""/>
</a>
<a href="highslide/images/11.jpg" class="highslide"
title="Caption from the anchor's title attribute"
onclick="return hs.expand(this, config1 )">
<img src="highslide/images/11thumb.jpg" alt=""/>
</a>
</div>
</div>
-
Cubikated ! Yes you can do that. If you save your frontpage as index.php you can include the images as Snookerman said with something like this
Code:
<?php
include('highslidegallery-1.html');
?>
And you can include several more image arrays the same way other places on your page. I am assuming it's your frontpage but you can do it with any page as long as it has php extension. Snookerman mentions .htacces but you dont need to mess with that as long as you save the page as .php.
-
Hummmmmm....now that's a problem cos I have all my pages as .html
How do I convert all my pages to .php without loosing any thing?
Do I have to install something like WampServer?
-
Do you need the image galleries on many pages ?
If yes, then you can change the .htacces as Snookerman explains and that way avoid having to change to php extension. If you only need the imagegalleries on one or two pages then just save it as .php instead of html. You don't loose anything that way. You can't see .php pages locally as a default so either you have to upload to a server online or you can install wampserver, as you say, and run it from there.
-
Thank you very much for that. I've successfully converted all my pages to .php by just renaming in Dreamweaver. Had to go through another YouTube tutorial on how to install WampServer and how to define a php site in Dreamweaver. Success again :)
Now I need to try the "include" function and see if I can get it to work.
My brain's overworked......need a holiday soon!!!! :D
-
Hi azoomer,
Just a quick question.
As I said before I converted all my .html to .php in Dreamweaver and the page looks exactly like before. I'm just wondering if I should add a
<?php
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
?>
and just add anywhere I want
include('highslidegallery-1.html'); (keeping in mind that I've added the <?php ?> before and after the <html> </html> tags)
or do I have to add each time
<?php
include('highslidegallery-1.html'); (keeping in mind that I've added the <?php ?> before and after the <html> </html> tags)
?>
where I want to include the file.
Thanks for your help, much appreciated!!!!
-
you should add it with each include and not around the html tags.