qwertyuiop71944
New Member
الو سلام!
آقا من اين كد رو نوشتم كه وقتي توي يه فرم html اي كه دارم url و description وارد بشه اونارو توي يه folder توي خود سايت ذخيره مي كنه. حالا نمي دونم چيكار كنم؟ احتمالاpath ذخيره كردن رو اشتباه وارد مي كنم!
كمك كنين
handleform.php
<?
function WriteToFile ($url, $description) {
/* function writetofile takes two arguments--url and description--which will be written to an external file. */
$the file = "data.txt";
$open = fopen ($thefile, "a");
if ($open) {
fwrite ($open, "$url\ t$description\n");fclose ($open);
$worked = true;
} else {
$worked = false;
}
return $worked;
} // end of writetofile function.
?>
<html>
<head>
<title>using files</title>
<body>
<?php
/*this page receives and handles the data generated by "form.html". */
$pattern = "(http://)?([^[:space:]]+) ([[:alnum:]\.,-_?/&=])";
if (eregi($pattern, $array["url"])) {
$replace = "<a href=\"http://www.4thcongress.com\\2\\3\" target=\"_new\"> \\2\\3</a>";
$array["url"] = eregi_replace($pattern, $replace, $array["url"]);
$callfunction = writetofile ($array["url"], $array["description"];
if ($callfunction) {
print ("etelaa aat e shoma--
$array--successfully received!<br>\n"); ...HTML form contains GETING url and description
آقا من اين كد رو نوشتم كه وقتي توي يه فرم html اي كه دارم url و description وارد بشه اونارو توي يه folder توي خود سايت ذخيره مي كنه. حالا نمي دونم چيكار كنم؟ احتمالاpath ذخيره كردن رو اشتباه وارد مي كنم!
كمك كنين
handleform.php
<?
function WriteToFile ($url, $description) {
/* function writetofile takes two arguments--url and description--which will be written to an external file. */
$the file = "data.txt";
$open = fopen ($thefile, "a");
if ($open) {
fwrite ($open, "$url\ t$description\n");fclose ($open);
$worked = true;
} else {
$worked = false;
}
return $worked;
} // end of writetofile function.
?>
<html>
<head>
<title>using files</title>
<body>
<?php
/*this page receives and handles the data generated by "form.html". */
$pattern = "(http://)?([^[:space:]]+) ([[:alnum:]\.,-_?/&=])";
if (eregi($pattern, $array["url"])) {
$replace = "<a href=\"http://www.4thcongress.com\\2\\3\" target=\"_new\"> \\2\\3</a>";
$array["url"] = eregi_replace($pattern, $replace, $array["url"]);
$callfunction = writetofile ($array["url"], $array["description"];
if ($callfunction) {
print ("etelaa aat e shoma--
$array--successfully received!<br>\n"); ...HTML form contains GETING url and description