fwrite
היי,
אשמח לעזרה בעניין פעוט [לעומת מה שאתם עוסקים בו]
יש את הקוד הנ"ל:
<form action="" method="get">
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td>Link Name: <input type="text" name="linkName"/></td>
</tr>
<tr>
<td>Link URL: <input type="text" name="linkURL"/></td>
</tr>
<tr>
<td>Link URL: <input type="submit" name="send" value="Send"/></td>
</tr>
</table>
</form>
<?php
function creatFile ($filePath, $fileContant)
{
$file = fopen ($filePath, 'w+');
fwrite($file, $fileContant);
fclose($file);
}
creatFile('c:\wamp\www\links.txt', $_GET['linkName'] . ", " . $_GET['linkURL']);
?>
במידה ובטופס מוזנים שוב שם וקישור, איך יווצר מצב שבו זה לא ימחק את מה שכבר היה כתוב ?
היי,
אשמח לעזרה בעניין פעוט [לעומת מה שאתם עוסקים בו]
יש את הקוד הנ"ל:
<form action="" method="get">
<table cellpadding="2" cellspacing="2" border="0">
<tr>
<td>Link Name: <input type="text" name="linkName"/></td>
</tr>
<tr>
<td>Link URL: <input type="text" name="linkURL"/></td>
</tr>
<tr>
<td>Link URL: <input type="submit" name="send" value="Send"/></td>
</tr>
</table>
</form>
<?php
function creatFile ($filePath, $fileContant)
{
$file = fopen ($filePath, 'w+');
fwrite($file, $fileContant);
fclose($file);
}
creatFile('c:\wamp\www\links.txt', $_GET['linkName'] . ", " . $_GET['linkURL']);
?>
במידה ובטופס מוזנים שוב שם וקישור, איך יווצר מצב שבו זה לא ימחק את מה שכבר היה כתוב ?