954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Display php data in html div

I have a created template in html..

in this template i have a scrolling DIV

What i want to do is display the myqsl data in this DIV.

I have tried to use this:

<?php @ include ("index_random.php");?>

to display random products from the product listing
But it has no effect!!!.

I need to keep the files as .html becasue the site's existing format is such.

how can i do this?

thanks in advance

duttydea
Newbie Poster
21 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

It's my understanding that if the file type is not .php (or one of it's variations) the php parser doesn't get invoked on the web server so the code gets treated like any other content and is displayed.

GCameron
Newbie Poster
5 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 
It's my understanding that if the file type is not .php (or one of it's variations) the php parser doesn't get invoked on the web server so the code gets treated like any other content and is displayed.

Right. You can edit your .htaccess file to parse html file as a php file. Check this link.

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

Good answer! I went looking and found the hook to accomplish that in H-sphere control panel too.

GCameron
Newbie Poster
5 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

Thanks guys!!
I added the handler to the cpanel

It worked a treat!!

duttydea
Newbie Poster
21 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

sample .htaccess file.

RewriteEngine On

RewriteRule ^\.htaccess$ - [F] 
RewriteRule ^\.jpg$ - [F]
RewriteRule ^\.html$ - [F]
RewriteRule ^\.css$ - [F]


RewriteRule ^([0-9]+),([0-9]+)$ /teknober.com/index.php?Language=$1&Index=$2 [L]
RewriteRule ^([0-9]+),([0-9]+),([0-9]+)$ /teknober.com/index.php?Language=$1&Index=$2&Category=$3 [L]
RewriteRule ^([0-9]+),([0-9]+),([0-9]+),([0-9]+)$ /teknober.com/index.php?Language=$1&Index=$2&Category=$3&State=$4 [L]
RewriteRule ^([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+)$ /teknober.com/index.php?Language=$1&Index=$2&Category=$3&State=$4&Position=$5 [L]
RewriteRule ^([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+),([0-9]+)$ /teknober.com/index.php?Language=$1&Index=$2&Category=$3&State=$4&Position=$5&SubCategory=$6 [L]
fatihpiristine
Posting Whiz in Training
283 posts since Sep 2007
Reputation Points: 6
Solved Threads: 19
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You