Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Mały problem z odświeżaniem w php, Funkcja odświeżania w skrypcie
Rafael6666
post
Post #1





Grupa: Zarejestrowani
Postów: 95
Pomógł: 0
Dołączył: 20.10.2006

Ostrzeżenie: (10%)
X----


Witam. Mam skrypt wygryzanko, ale mam jeden problem. Chcę, aby po wypełnieniu formularza (Adres strony, Opis) odświeżał się skrypt i, żeby wyświetlały się świeże dane. To chyba mały problem, ale ja nigdy nie bawiłem się z takim czymś. Jak ktoś wie jak to zrobić, to bardzo proszę o pomoc.

A tu daję kod:

Kod
<LINK REL=stylesheet HREF="style.css" TYPE="text/css">
<center><?php
$file="wpis.txt";
$fd = fopen ("$file", "r");
$dane = fread ($fd, filesize ("$file"));
$tmp=explode("|",$dane);
echo "<a href='$tmp[0]'>$tmp[1]</a>";
echo "
<form method='post' action=''>
<fieldset style='border:0px;'>
<input type='hidden' name='wygr' value='tak'>
<input type='text' name='link' style='width: 100px' value='http://'>
<input type='text' name='opis' style='width: 100px' maxlength='50' value='Opis'>
<input type='submit' name='submit' value='OK'>
</fieldset>
</form>";
if ($wygr == 'tak') {
if ($opis != 'Opis') {
if ($opis != '') {
$file="wpis.txt";
$fp = fopen($file, "w");
flock($fp, 2);
$k = '|';
fwrite($fp, "$link $k $opis $k");
flock($fp, 3);
fclose($fp);
}
else die();
}
else die();
}
?></center>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
PiratNowegoPokol...
post
Post #2





Grupa: Zarejestrowani
Postów: 132
Pomógł: 0
Dołączył: 12.10.2006

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


Kod
echo "<a href='$tmp[0]'>$tmp[1]</a>";

to wyświetla te dane ?
Kod
<LINK REL=stylesheet HREF="style.css" TYPE="text/css">
<center><?php
if ($wygr == 'tak') {
if ($opis != 'Opis') {
if ($opis != '') {
$file="wpis.txt";
$fp = fopen($file, "w");
flock($fp, 2);
$k = '|';
fwrite($fp, "$link $k $opis $k");
flock($fp, 3);
fclose($fp);
}
else die();
}
else die();
}
$file="wpis.txt";
$fd = fopen ("$file", "r");
$dane = fread ($fd, filesize ("$file"));
$tmp=explode("|",$dane);
echo "<a href='$tmp[0]'>$tmp[1]</a>";
echo "
<form method='post' action=''>
<fieldset style='border:0px;'>
<input type='hidden' name='wygr' value='tak'>
<input type='text' name='link' style='width: 100px' value='http://'>
<input type='text' name='opis' style='width: 100px' maxlength='50' value='Opis'>
<input type='submit' name='submit' value='OK'>
</fieldset>
</form>";
?></center>


tak nie działa ?

PS:
Kod
if ($wygr == 'tak') {
if ($opis != 'Opis') {
if ($opis != '') {

hmmm... zaskakujące (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)

http://www.php.net/manual/pl/language.operators.php
spójrz na to i zastosuj ...


Jeszcze jedno
Kod
$opis = $_POST['opis'];

tak pisz bo z inaczej ustawionym php nie będzie działać
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: 28.12.2025 - 14:17