I am trying to obtain and transfer information from a HTML web form (through input text field), then store that info into another file within a PHP variable. As you can see below, I have created a string to search ($str_to_find) and manually used ‘script’ for the string, but what I want to do is fill this area dynamically with information from a web form in another file.
I know this may be a general question, but I have not clue where to start.
function check_files($this_file) {
$str_to_find='script'; // the string(code/text) to search for
//I want to fill the 'string' above with info from another file's web form, if possible.
It sounds like you just want to use GET or POST data. Here is basic sample. A person will fill in the form on form.html and click submit. You will then collect the POST data from this form by the attribute names. In this case the process.php script just prints out “
Hello <firstname> <lastname>” but alternatively you can display it as you wish.form.html
process.php
If you want this to display information on the same page, you can use AJAX. Refer to http://api.jquery.com/jQuery.ajax/ for examples. I have included one below:
form.html
process.php
Same as above