tags:

views:

34

answers:

2

I do apologize for asking this stupid question but I am wondering if you can help me..

i want insert among file $cat1 or $cat2 to in page.php... the code i was create e.g.

<? //config.php
$cat_all = ($cat2 or $cat1);
$cat1 = "cat.php" ;
$cat2 = "../back-up/cat.php"; //default anyway
if(file_exists($cat1)){
    require_once $cat1;
}else{
    require_once $cat2;
}
?>

<? //page.php
require "config.php";
function ShowIndexProd($number){
    $ar = file($cat_all); // <------- input here //
    $sizear = count($ar)-$number;
    $data = explode("#",$ar[$sizear]);
    echo "
    <td class='BoxIndex' width='30%'><a href='prod_show.php?id=$sizear'><IMG SRC='img/$data[5]' width=150 border=0></a> <BR /><BR />
        <B><FONT COLOR='red'> $deti[2] </FONT></B> <BR />
        <B>Price:</B>$rp $data[3] $usd<BR />
        <a href='prodshow.php?id=$sizear'><b><FONT COLOR='#FF6600'> more details... </FONT></b></a>
    </td>";
}

but the result: file $cat1 or $cat2 printed to html page, that i want them as file configuration.. any help would much appreciate and thank you

A: 

Try include'config.php' ?

nickf
Thank my friend for your nice consideration, but unfortunately i didn't see any change
jones
"i want insert among file $cat1 or $cat2 to in page.php" can you try to clarify this - it makes pretty much zero sense to me at least.
nickf
A: 

You need to have <? ?> tags in files @cat1 and @cat2.

Michal Dymel
what on earth are you talking about?
nickf
sorry - I didn't notice that actual tags were removed ;)
Michal Dymel
you'r right Michal Dymel, in @cat1 and @cat2 no tag <? ?>because it as category and before their name like cat.txt, i changed it to make more secure...thank you
jones
but the impact after put tag <? ?> it shown in my category... any idea bos? would be great thank you..
jones
I think we won't be able to help you without you pasting content of these files...
Michal Dymel