doubledee Posted April 2, 2012 Share Posted April 2, 2012 In my forms, at the top, I have PHP that fires if the Form was submitted like this... // ************************************************************* // HANDLE FORM. * // ************************************************************* if ($_SERVER['REQUEST_METHOD']=='POST'){ // Form was Submitted (Post). // Initialize Errors Array. $errors = array(); // Trim all form data. $trimmed = array_map('trim', $_POST); And then at the bottom of the file I have my HTML Form with controls like this... <!-- First Name --> <label for="firstName"><b>*</b>First Name:</label> <input id="firstName" name="firstName" type="text" maxlength="30" value="<?php if(isset($firstName)){echo htmlentities($firstName, ENT_QUOTES);} ?>" /><!-- Sticky Field --> <?php if (!empty($errors['firstName'])){ echo '<span class="error">' . $errors['firstName'] . '</span>'; } ?> Where is this code getting the name "$firstName"... <?php if(isset($firstName)) I guess I am asking what in my Form determines the name of things in the $_POST array?? Hope that makes sense?! Debbie Link to comment https://forums.phpfreaks.com/topic/260163-where-do-_post-components-get-their-names/ Share on other sites More sharing options...
NomadicJosh Posted April 2, 2012 Share Posted April 2, 2012 It's whatever is defined in name="" from your input fields. Link to comment https://forums.phpfreaks.com/topic/260163-where-do-_post-components-get-their-names/#findComment-1333438 Share on other sites More sharing options...
doubledee Posted April 2, 2012 Author Share Posted April 2, 2012 It's whatever is defined in name="" from your input fields. Oh, okay. Thanks!! Debbie Link to comment https://forums.phpfreaks.com/topic/260163-where-do-_post-components-get-their-names/#findComment-1333439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.