note 112331 deleted from language.operators by danbrown
| From: | danbrown@php.net | Date: | Wed, 05 Jun 2013 17:38:08 +0000 |
| Subject: | note 112331 deleted from language.operators by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-195055@lists.php.net to get a copy of this message | ||
Note Submitter: rizbo at gmal dot com
----
$a1=$_POST['subject'];
$a2=$_POST['comment'];
if(file_exists("base.txt")){echo 'input';}
@ $f=fopen("base.txt", "r");
if (!$f){echo 'failed!!';}
else
{
while(!feof($f))
$one_r=fgets($f, 999);
$br++;
}
fclose($f);
$dat=date("d.m.y");
$line=$br."\t".$a1."\t".$a2."\t".$dat."\n";
echo $line;
$f2=fopen("base.txt", "a");
flock($f2, LOCK_EX);
fwrite($f2, $line, strlen($line));
flock($f2, LOCK_UN);
fclose($f2);
if (file_exists("base.txt")){echo '<br> lets go ';}
@$f2=fopen("base.txt", "r");
if (!$f2) {echo 'failed ';}
else {
while(!feof($f2))
{
$oneline=fgets($f2, 999);
$arej=explode("\t", $oneline);
echo '<a
href="s3c.php?n='.$arej[1].'&k='.$arej[2].'">'.$arej[1].'</a><br>';
}
}
fclose($f2);
*****************searching
$question=$_POST['kod'];
$liines=file("price.txt");
$dat1="price.txt";
$f=@fopen($dat1,"r");
if(!$f){
echo 'no file <br> bye bye';
exit;
}
echo 'File '.$dat1.' exists <br>';
echo '<table border=1>';
$sum = 0;
for ($i=0; $i<=count($liines); $i++){
$kk=explode("\t", $liines[$i]);
//echo $kk[5]."<br />";
//echo $question."<br />";
if (trim($kk[6]) == $question){
$sum = $sum + intval($kk[5]);
echo '<tr>';
foreach ($kk as $df){
echo '<td>'.$df.'</td>';
}
echo '</tr>';
}
}
// chmod 777 dddd.txt
echo '</table>';
echo "<h1>".$sum."</h1>";
********************writing
$up=$_POST['upis'];
$liines=file("price.txt");
$fileforenter="mystuff.txt";
$dat="price.txt";
@$f=fopen($fileforenter, "w");
if(!$f){echo 'Ne mogu otvoriti fajl....';
exit;
}
$striing="";
for ($i=1; $i<=count($liines); $i++){
$liner=explode("\t", $liines[$i]);
if(trim($liner[6])==$up){
foreach ($liner as $v){
$striing.=$v."\t";
}
}
}
fwrite($f, $striing);
fclose($f);
echo '<br> text written <br />';
?>
<a href="mystuff.txt"> watch now </a>
*****************************************************tbl
$x=$_POST['x'];
$y=$_POST['y'];
$o=$_POST['oper'];
if ($o=="+"){
echo '<table border=1>';
for ($i=0; $i<=$x; $i++){
echo '<tr>';
for ($j=0; $j<=$y; $j++){
$num=$j+$i;
echo '<td>'.$num.'</td>';
}
echo '</tr>';
}
echo '</table>';
}
else {
echo '<table border=1>';
for ($i=1; $i<=$x; $i++){
echo '<tr>';
for ($j=1; $j<=$y; $j++){
$num=$j*$i;
echo '<td>'.$num.'</td>';
}
echo '</tr>';
}
echo '</table>';
}
******************************************************