I have the following code on a php page:
<form action="" method="get">
First Name:
<input type="text" name="first"/><br />
Last Name:
<input type="text" name="last"/>
<input type="submit" value="Add">
</form>
It is a form to add a new user to a sqlite database. In another file I have this php function:
function addUser($firstName, $lastName) {
$sql = "INSERT INTO USERS
(FIRST, LAST)
VALUES ('$firstName', '$lastName')";
return execSQL($sql);
}
So what I want to do is pass the text that a user enters in the text fields to the function (which has been placed in the global scope, but is in a different document). How can I do this?