开发者

webpage response using PHP [closed]

开发者 https://www.devze.com 2023-04-09 09:44 出处:网络
It's difficult to tell what is being asked here. This q开发者_Python百科uestion is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current for
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

精彩评论

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