Jump to content
php.lv forumi

News skripts


hackerman

Recommended Posts

tagad atradu vēlvienu, stipri labāku :) Izmēģināšu to, ja neies palikšu pie šitā un centīšos uzlabot :)

 

eniivei, paldies, jums :)

 

 

 

Edited: OK es te nespamošu ar vēlvienu tādu topiku :D

 

Palīdzat man ar otru skriptu ^^

 

Pamācība: TE

<?php

if (!isset($_POST['news'])) {

?>

<h1>Pievienot Rakstu</h1>
<table>
<FORM action="add.php" method="POST">
<tr>
<td align=right>Virsraksts:</td>
<td><INPUT TYPE="TEXT" name="title"></td>
</tr>
<tr>
<td align=right valign=top>Raksts:</td>
<td><TEXTAREA WRAP=VIRTUAL NAME="news" COLS=50 ROWS=15></TEXTAREA></td>
</tr>
<tr>
<td></td>
<td><INPUT TYPE="SUBMIT" name="submit" value="Submit"></td>
</tr>
</FORM>
</table>


<?php

} else {

$title = $_POST['title'];
$news = $_POST['news'];

$da = getdate();
$date="$da[weekday] $da[mday] $da[month] $da[year]";
$news = ("$title\r\n$date\r\n$news\n");

$file = fopen("news.php", "a");
$read = fread($file, filesize("news.php"));
fclose($file);
$newsfile = fopen("news.php", "w");
$news=stripslashes($news);
fwrite($newsfile, "$news$read");
fclose ($newsfile);


echo "Raksts Pievienots!";

}

?>

 

 

Palīdzat plz ielikt tabulā katru rakstu =]

Edited by hackerman
Link to comment
Share on other sites

×
×
  • Create New...