mohsenshahab
Active Member
سلام
ببینید من یه صفحه ای دارم به نام input.php که یه فرم ساده هستش حالا من به وسیله یک صفحه که اسمش save.phpهستش میخوام اطلاعات این فرم رو به یک فایل متنی به نام db.txtمنتقل کنم ولی php بد رقم گیر داده به این تابع flie_put_conects
اصلا باگ این برنامه چیه
صفحه input.php
صفحه save.php
ببینید من یه صفحه ای دارم به نام input.php که یه فرم ساده هستش حالا من به وسیله یک صفحه که اسمش save.phpهستش میخوام اطلاعات این فرم رو به یک فایل متنی به نام db.txtمنتقل کنم ولی php بد رقم گیر داده به این تابع flie_put_conects
اصلا باگ این برنامه چیه
صفحه input.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="save.php">
<div align="center">
<table width="240" border="0">
<tr>
<th width="57" scope="row"><p align="right">ID :</p> </th>
<td width="167"><input name="tfid" type="text" id="tfid"></td>
</tr>
<tr>
<th scope="row">Name : </th>
<td><input name="tfname" type="text" id="tfname"></td>
</tr>
<tr>
<th scope="row">Family : </th>
<td><input name="tffamily" type="text" id="tffamily"></td>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="submit" name="Submit" value="save">
<input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
<p> </p>
</div>
</form>
</body>
</html>
صفحه save.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
if(isset($_POST["tfid"]))
{
$i=$_POST["tfid"];
$n=$_POST["tfname"];
$f=$_POST["tffamily"];
file_put_contents("db.txt",$i."%".$n."%".$f.";",FILE_APPEND);
}
print("<script language='javascript'>window.navigate('list.php');</script>");
?>
</body>
</html>