开发者

webpage response using PHP [closed]

It's difficult to tell what is being asked here. This q开发者_Python百科uestion is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I have a form structure webpage written in PHP. When information is submitted it gives a unique ID.

Now I want this unique ID to be used in a file. For Example:

$input = "man.id: ".$id;

where $id is the response from the webpage.

$input is present in the same PHP file.


Here's an example of how to write (append) text to a file with PHP:

$id = GetID(); // GetID can return a value stored on disk that gets incremented
$input = "man.id: " . $id;

$logfile = "mypage.log";
$file = fopen($logfile, 'a'); // Try to open the file in Append mode
if($file) // If the file was opened successfully, i.e. if $file is a valid file pointer
{
  flock($file, LOCK_EX); // Exclusive lock
  fwrite($file, $input);
  fclose($file);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜