Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z freecrm
ArturRudnicki
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 9.12.2007
Skąd: Radom

Ostrzeżenie: (0%)
-----


Czy ktoś pracował na czymś takim jak freecrm? Mam problem, że użytkownicy mogą edytować nie tylko swoich klientów, ale wszystkich oraz nie pobierają mi się pliki pdf, tylko mam w przeglądarce tekst: pdf i już.

Pozdrawiam
Artur Rudnicki
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
ArturRudnicki
post
Post #2





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 9.12.2007
Skąd: Radom

Ostrzeżenie: (0%)
-----


Problem jest na kilku przeglądarkach. Serwer chodzi na apachu, a kody są następuące:

<?
require("db.php");
function error($fil)
{
return '';
}


///////////////////////////
//read all file as ssi
///////////////////////////
function ssi($fil)
{
clearstatcache();
if(file_exists($fil))
{
$fd=fopen($fil,"r");
if($fd>0){
$contents = fread( $fd, filesize( $fil) );
fclose($fd);
return $contents;
}
else return error($fil);
}
else{//not file
return error($fil);
}


}


function getfile($name){
$path="templates/".$name;
$fd=fopen($path, "r");
$temp="";
while (!feof($fd)) {
$buffer = fgets($fd, 4096);
$temp=$temp.$buffer;
}
fclose($fd);
return $temp;
}

$sSQL="select * from pliki where sciezka='$sciezka'";
$ret=mysql_query($sSQL);
if($obj=mysql_fetch_object($ret))
{
$ext=substr($obj->nazwa,strrpos($obj->nazwa,".")+1);
echo $ext;
$sSQL1="select mim from mime where ext='".$ext."'";
$ret1=mysql_query($sSQL1);
if($obj1=mysql_fetch_object($ret1))
header('Content-Type: '.$obj1->mim);

header('Content-Disposition : attachment; filename='.$obj->nazwa.'');
header('Accept-Ranges: bytes');
$str='Content-Length: '.filesize($UploadFilePath.$obj->sciezka);
header($str);
header('Connection: close');
readfile($UploadFilePath.$obj->sciezka);
}
?>

Pozdrawiam
Artur Rudnicki
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 29.12.2025 - 13:04