Jump to content

display total links from database


Jack.C

Recommended Posts

Umm, looking at the source code of your site. The PHP code is visible.

 

Which means,

 

1. Your webhost/hosting account does not support PHP. Check this with your webhost. Or,

2. The file you have placed your PHP code in does not end in an .php extension, eg  you have added the code to index.html rather than index.php. PHP code will only be parsed within .php files.

Link to comment
Share on other sites

Umm, looking at the source code of your site. The PHP code is visible.

 

Which means,

 

1. Your webhost/hosting account does not support PHP. Check this with your webhost. Or,

2. The file you have placed your PHP code in does not end in an .php extension, eg  you have added the code to index.html rather than index.php. PHP code will only be parsed within .php files.

 

It's a tpl file, that's what this whole discussion has been about. How do you include php in tpl files, I did what you said, and thus got that result.

 

So:

 

1. PHP is allowed on my webhost, infact everything there IS php.

2. It does not end in .php because I did exactly as you said above.

 

Point blank, I asked how to include php files  using

 

<?php include("file.php");?>

 

Inside of a tpl file.

Link to comment
Share on other sites

You cannot place PHP code within .tpl files as by default PHP code is only parsed within .php files. If you want to parse PHP code within any other file you'll have to modify the servers configuration.

 

The easiest way is to do this using an .htaccess file. First create a new file called .htaccess in your sites root directory (where you upload your site files to). And add the following configuration.

AddType application/x-httpd-php .php .tpl

If your hosts allows this change to me made your site should load without any errors appearing. If an Error 500 is displayed then you are unable to modify the servers configuration. In which case you'll have no other option but to modify your script so it uses .php files rather than .tpl files

 

Link to comment
Share on other sites

You cannot place PHP code within .tpl files as by default PHP code is only parsed within .php files. If you want to parse PHP code within any other file you'll have to modify the servers configuration.

 

The easiest way is to do this using an .htaccess file. First create a new file called .htaccess in your sites root directory (where you upload your site files to). And add the following configuration.

AddType application/x-httpd-php .php .tpl

If your hosts allows this change to me made your site should load without any errors appearing. If an Error 500 is displayed then you are unable to modify the servers configuration. In which case you'll have no other option but to modify your script so it uses .php files rather than .tpl files

 

 

The servers configuration is already configured as above. as I've said, I've gotten PHP code to work properly inside of a .tpl file. And all I'm trying to accomplish here is find a simple and easy way to make it so I don't have to create several files with the same exact code.

 

I did not do this script, therefore I don't have a clue.

 

What is the simple way to include a header in several .tpl files without having to add it to each and every .tpl file?

 

For instance, here is a .tpl file with PHP code inside of it working: http://watch.thetvstop.com/templates/stats.tpl

 

The problem is, when I use <?php include ("/file.tpl or /file.php");?> it won't display anything.

Link to comment
Share on other sites

Looks like you site is using some form of PHP template script (earlier identified as ITX which is a PHP Pear package). PHP code is not being parsed within your .tpl files, tags such as {content}, {Movies} etc is not anything to do with PHP.

 

I think we need to first understand how your site is setup before we suggest anything, as currently we're going round in circles. Can you post the contents of index.php here.

Link to comment
Share on other sites

<?php
session_start();
DEFINE('movies', 'access');
DEFINE('witAdmin', '1');
require_once('witadmin/conf/config_u.php');
require_once('classes/common.php');
$p = new output();

require_once('classes/movies.php');
$m = new movies();

if(isset($_GET['handle_ajax']))
{
if(isset($_GET['view_links'], $_GET['category_id']))
{
	$m->show_links($_GET['category_id']);
}
elseif(isset($_GET['add_link'], $_GET['category_id'], $_GET['title'], $_GET['link']))
{
	$m->add_link($_GET['category_id'], $_GET['link'], $_GET['title']);
}
else
	die('No result');
}
else
{
if(isset($_GET['movie_id']))
	$m->show_movie();
else
	$m->movie_list();
}
if(isset($m) && is_object($m)) 
{
$p->output = $m->output;
}
$p->show_overall();
?>

Link to comment
Share on other sites

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.