Jump to content

Como salvar informações de um backoffice sem ser bases de dados


Recommended Posts

Posted

Boa tarde!

estou a fazer um site, que tem um backoffice para eu não ter de programar o site quando ponho novas fotos. Para salvar o link das novas fotos não quero  utilizar bd, como posso savar os links ??? á outra maneira ?

Posted

  <?php

  $msg = "TESTE |\n ";

  $file = 'config.txt';

  $file = fopen($file , 'a');

  fwrite($file, $msg);

  fclose($file)

  ?>

pq é que qd meto este codigo ele escreve em duplicado ?

Posted

  $filename = 'admin\config.txt';

$handle = @fopen($filename, "r");

$buffer = fgets($handle, 4096);

$getshoutdata = explode ("img:", $buffer);

echo "<img src="$getshoutdata[1]" width="36" height="47"/>";

print($getshoutdata[1]);

fclose($handle);

tava a tentar ir buscar um link ao *.txt e ele diz

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in ...

como posso dar a volta a isto ?

Posted

  $filename = 'admin/config.txt';

$handle = fopen($filename, "r");

$buffer = fgets($handle);

$getshoutdata = explode ("img:", $buffer);

print '<img src="'.$getshoutdata[1].'" width="200" height="100"/>';

print '<br>';

print($getshoutdata[1]);

print '<img src="'.$getshoutdata[0].'" width="200" height="100"/>';

print '<br>';

print($getshoutdata[0]);

fclose($handle);

como é que meto este array a trabalhar bem ?!

tenho 2 linhas que começam com img:linkdafoto e neste caso só trabalha a 1ª linha pq a segunda fica em branco

helpme

Posted

tipo a ideia é adicional linhas no .txt e ele fazer um ciclo pa sacar as linhas, hoje são 3, amanha podem ser 5... assim o array cresce em fução das lnhas, coorecto ?!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.