My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
Thursday, 28 June 2018
Unlink and Append in PHP
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Write</title>
</head>
<body>
<form method="post">
<table>
<tr> <td>Text </td> <td> <input type="text" name="txt"/> </td> </tr>
<tr> <td colspan="2"> <button name="btn">Post</button> </td> </tr>
<tr> <td colspan="2"> <button name="del">Delete</button> </td> </tr>
</table>
</form>
<?php
if(isset($_POST['btn']))
{
$filename="Resources/salman.txt";
$handle=fopen($filename,'a');
fwrite($handle," ".$_POST['txt']);
fclose($handle);
echo "Data successfully Inserted.....";
}
if(isset($_POST['del']))
{
$status=unlink("Resources/salman.txt");
if($status==true)
{
echo "Deleted.....";
}
else
{
echo "Not Deleted.....";
}
}
?>
</body>
</html>
File Write Operation in PHP
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Write</title>
</head>
<body>
<form method="post">
<table>
<tr> <td>Text </td> <td> <input type="text" name="txt"/> </td> </tr>
<tr> <td colspan="2"> <button name="btn">Post</button> </td> </tr>
</table>
</form>
<?php
if(isset($_POST['btn']))
{
$filename="Resources/salman.txt";
$handle=fopen($filename,'w');
fwrite($handle,$_POST['txt']);
fclose($handle);
echo "Data successfully Inserted.....";
}
?>
</body>
</html>
File Read Operation in PHP
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Read Operation</title>
</head>
<body>
<?php
$fiepath="Resources/salman.txt";
$handle=fopen($fiepath,"r");
$content=fread($handle,filesize($fiepath));
echo "<h1>".$content." </h1>";
fclose($handle);
?>
</body>
</html>
Subscribe to:
Posts (Atom)
Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...