Hi,
I need to loop through all the records in an XML file and check if a specific record (user_id) exist in the form submitted. The form field names match the user_id from the XML file.
I assume it's a stupid error but when I execute the script, I get an "Illegal offset" error.
Code:
$users = simplexml_load_file("users.xml");
foreach ($users->user as $user) {
// Define User ID from XML file
$user_id = $users->id;
if (isset($_POST[$user_id)) {
echo "User exists";
}
}