HI,
Well, Here is the code of my new project .. Actually it's just s scrap or it..
I have made 2 files.
the 1st file is test.php with of course creating a new file called testdb.txt.
And the file called admin.php
here is the code.
Code of test.php
[php]
<?php
$db = "testdb.txt ";
$name= $_POST["name"];
$like = $_POST["like"];
$submit = $_POST["submit"];
$full_mess = "<br> MY name is $name.<br>I like to $like.";
$seprate = "<br>.......... ....";
if($submit == submit)
{
$f_handle = fopen($db,'a');
fwrite($f_handl e,$full_mess.$s eprate."\n");
fclose($f_handl e);
"<i>Message sent...";
}
else
{
echo "Message Can't be sent...";
}
?>
<form name="beta_test ing" action="test.ph p" method="post">
<br>
Name ; <input name="name" type="text" size="18">
<br>
Like ; <input name="like" type="test" size="20">
<br>
<input name="submit" type="submit" value="submit">
</form>
<?php
@include($db);
?>
[/php]
and admin.php
[php]
<?php
$db = "testdb.txt ";
$pass = $_POST["pass"];
$line_to_del = $_POST["line"];
$log_in_form = "<form name=\"moderati on_login\" action=\"admin. php\" method=\"post\" >
<br>
Please insert your password to get in...<input name=\"pass\" type=\"text\" size=\"15\">
<input name\"submit\" type=\"submit\" value=\"submit\ ">
</form>";
$lines_del_form = "<form name=\"moderati on\" action=\"admin. php\" method=\"post\" >
<br>
Line Number to delete.. Lines are counted from Down to up...<input name=\"line\" type=\"text\" size=\"15\">
<input name\"submit\" type=\"submit\" value=\"submit\ ">
</form>";
if($pass == 123)
{
@include($db);
$file = file_get_conten ts($dbname);
$array = explode("\n", $file);
array_diff(arra y($array), array($line_to_ del));
echo $lines_del_form ;
}else
{
echo "<b> Please insert correct value into pass field...";
echo $log_in_form;
}
?>
[/php]
Now, When a member/Dude inserts the info that his/her name with Likeness.
It will be submitted, But will be written the info of each dude as 1 line..
Now if suppose five people have inserted and i want to delete the info of 3rd member (3rd line) from testdb.txt..
How can i>..
Help please :)
FAISAL!
Well, Here is the code of my new project .. Actually it's just s scrap or it..
I have made 2 files.
the 1st file is test.php with of course creating a new file called testdb.txt.
And the file called admin.php
here is the code.
Code of test.php
[php]
<?php
$db = "testdb.txt ";
$name= $_POST["name"];
$like = $_POST["like"];
$submit = $_POST["submit"];
$full_mess = "<br> MY name is $name.<br>I like to $like.";
$seprate = "<br>.......... ....";
if($submit == submit)
{
$f_handle = fopen($db,'a');
fwrite($f_handl e,$full_mess.$s eprate."\n");
fclose($f_handl e);
"<i>Message sent...";
}
else
{
echo "Message Can't be sent...";
}
?>
<form name="beta_test ing" action="test.ph p" method="post">
<br>
Name ; <input name="name" type="text" size="18">
<br>
Like ; <input name="like" type="test" size="20">
<br>
<input name="submit" type="submit" value="submit">
</form>
<?php
@include($db);
?>
[/php]
and admin.php
[php]
<?php
$db = "testdb.txt ";
$pass = $_POST["pass"];
$line_to_del = $_POST["line"];
$log_in_form = "<form name=\"moderati on_login\" action=\"admin. php\" method=\"post\" >
<br>
Please insert your password to get in...<input name=\"pass\" type=\"text\" size=\"15\">
<input name\"submit\" type=\"submit\" value=\"submit\ ">
</form>";
$lines_del_form = "<form name=\"moderati on\" action=\"admin. php\" method=\"post\" >
<br>
Line Number to delete.. Lines are counted from Down to up...<input name=\"line\" type=\"text\" size=\"15\">
<input name\"submit\" type=\"submit\" value=\"submit\ ">
</form>";
if($pass == 123)
{
@include($db);
$file = file_get_conten ts($dbname);
$array = explode("\n", $file);
array_diff(arra y($array), array($line_to_ del));
echo $lines_del_form ;
}else
{
echo "<b> Please insert correct value into pass field...";
echo $log_in_form;
}
?>
[/php]
Now, When a member/Dude inserts the info that his/her name with Likeness.
It will be submitted, But will be written the info of each dude as 1 line..
Now if suppose five people have inserted and i want to delete the info of 3rd member (3rd line) from testdb.txt..
How can i>..
Help please :)
FAISAL!
Comment