Jump to content

Recommended Posts

Posted

Boas, como só tenho ideias boas (ou nao)

Decidi criar uma staff list, em que tem que se adicionar manualmente.

Entao fiz pela ideia q o scorch me deu.

staff1.php

 
<center>
<font face="Verdana" font color="grey" font size=4>

STAFF LiST
<br /><br /><br /><br />

</font>

<form action="staff2.php" method="POST">

<font face="Verdana" font color="grey" font size=1> 

Nick:
<input type="text" name="nick"><br /><br /><br />

Avatar: 
<input type="text" name="avatar"><br /><br /><br />

Cargo: 
<input type="text" name="cargo"><br /><br /><br />

<input type="submit" value="Enviar Modificaçoes">


</form>
</font>

staff2.php

<br /><br /><br />
<center>
<font face="Verdana" font color="grey" font size=3>
STAFF LiST @ 2009
<br /><br />
____________________
<br /><br />
<font face="Verdana" font color="grey" font size=2>

<br /><br />
<?php

$file = 'staff.txt';

file_put_contents($file, $_POST['nick']);

$nick = file_get_contents($file);

echo $nick

?>
<br /><br />
_____
<br /><br />
<?php

$file = 'staff.txt';

file_put_contents($file, "<img src=\"".$_POST["avatar"]."\">");

$avatar = file_get_contents($file);

echo $avatar

?>
<br /><br />
_____
<br /><br />
<?php

$file = 'staff.txt';

file_put_contents($file, $_POST['cargo']);

$cargo = file_get_contents($file);

echo $cargo;

?>

mas eu queria que ao voltar a adicionar, aparece-se por baixo ou seja:

blablabla

[avatar]

Cargo

(por baixo)

blablabla

[avatar]

Cargo

como o faço?

á alguam forma de criar um txt para cada user adicionado?

Posted

Tenta assim:

<br /><br /><br />
<center>
<font face="Verdana" font color="grey" font size=3>
STAFF LiST @ 2009
<br /><br />
____________________
<br /><br />
<font face="Verdana" font color="grey" font size=2>

<br /><br />
<?php

$file = 'staff.txt';

$fContents = file_get_contents($file);

$fContents .= "<br /><br />".$_POST['nick']."<br /><br /><img src=\"".$_POST["avatar"]."\"><br /><br />".$_POST['cargo']."<br /><br />____________________";

file_put_contents($file, $_POST['nick']);

echo file_get_contents($file);

?>

PS: Não respondo a perguntas por mensagem que podem ser respondidas no fórum.

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.