problems with php files

Status
Not open for further replies.

ekramy

New Member
Messages
14
Reaction score
0
Points
0
i'm currenlty having a problem with php files on my website
ekramy.exofire.net/faq
every single php file shows the contents of the file instead of running it
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
i'm currenlty having a problem with php files on my website
ekramy.exofire.net/faq
every single php file shows the contents of the file instead of running it
Hi ekramy,

are you sure your included a <?php before your code? if so, could you post the php code here so that we may look into it?

- xav0989
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Why do you have this at the top of your .htaccess?

AddType x-mapp-php5 .php

That is your problem.
 

ekramy

New Member
Messages
14
Reaction score
0
Points
0
yes i do have <?php before my code
this is index.php code
PHP:
<?php
include('inc/config.php');
include('fonctions.php');
include('libs/gaga.class.php');
$tpl = new gagatemplate();

$tpl->assign('design', $theme);
$tpl->assign(array(
    'titre_page' => '',
	'sitename' => $sitename,
	'slogan' => $slogan,
	'siteurl' => $siteurl,
	'motcle' => $motcle,
	'description' => $description,
	'act' => $_GET['act'],
	'id' => $_GET['id']
	));
$sql = 'SELECT count(*) FROM forum_question';


$resultat = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());


$nb_total = mysql_fetch_array($resultat);
// on teste si ce nombre de vaut pas 0
if (($nb_total = $nb_total[0]) == 0) {
echo 'Pas encore de question';
}
else {

if (!isset($_GET['debut'])) $_GET['debut'] = 0;
if (!isset($_GET['act'])) {
$act = '';
} else { 
$act = $_GET['act'];
}
	$nb_affichage_par_page = 10;
	switch($act)
{

	case 'Recent';
$sql='SELECT * FROM forum_question ORDER BY id DESC LIMIT '.$_GET['debut'].','.$nb_affichage_par_page;
break;
case 'populaires';
$sql='SELECT * FROM forum_question ORDER BY view DESC LIMIT '.$_GET['debut'].','.$nb_affichage_par_page;
break;
default:
$sql='SELECT * FROM forum_question ORDER BY id DESC LIMIT '.$_GET['debut'].','.$nb_affichage_par_page;
}
$result=mysql_query($sql)or die('Erreur SQL !'.$sql.'<br>'.mysql_error());

switch($act){
		case 'recent':
			$instyle1 = " style=\"background:#CCCCCC\"";
			break;
		case 'populaires':
			$instyle2 = " style=\"background:#DCDCDC\"";
			break;	
		default:
			$instyle1 = " style=\"background:#DCDCDC\"";
	}
	



while($quest = mysql_fetch_array($result))
{
    $tpl->assign_array('list_quest', array(
        'id' => $quest['id'],
        'topic' => $quest['topic'],
		'name' => $quest['name'],
        'detail' => $quest['detail'],
        'dateheure' => $quest['datetime'],
		'vu' => $quest['view'],
		'reponse' => $quest['reply']));	

}

$tpl ->assign(array(
'nb' => $nb_total,
'nbpage' => $nb_affichage_par_page,
'debut' => $_GET['debut'],
'nbbarre' => 15
));

}
$req = mysql_query('SELECT * FROM forum_categorie ORDER BY cat_nom');
while($data = mysql_fetch_assoc($req))
{
    $tpl->assign_array('list_cat', array(
        'id' => $data['cat_id'],
        'nom' => $data['cat_nom']
        ));
}


$tpl->cache_time = 300; //on met le cache à 5 minutes (300 sec)
$tpl->cache = false; //active la mise en cache
$tpl->parse(''.$theme.'/header.tpl');
$tpl->parse(''.$theme.'/index.tpl');
$tpl->parse(''.$theme.'/footer.tpl');
//$tpl->debug('http://127.0.0.1/template/', 4);
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Why do you have this at the top of your .htaccess?

AddType x-mapp-php5 .php

That is your problem.
I don't believe that this is probably the problem, as I don't have it in mine and my website loads great...

Ekramy, do you have in the three files linked at the top of your index.php a echo command not terminated.

- xav0989
 

ekramy

New Member
Messages
14
Reaction score
0
Points
0
i already have it
this is my htaccess file
Code:
# -FrontPage-
AddType x-mapp-php5 .php
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName ekramy.x10hosting.com
AuthUserFile /home/ekramy/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/ekramy/public_html/_vti_pvt/service.grp
 

ekramy

New Member
Messages
14
Reaction score
0
Points
0
everything is working now after deletion of htaccess file
thnx for your help everyone
 
Status
Not open for further replies.
Top