Jump to content

pioneerx01

Members
  • Posts

    162
  • Joined

  • Last visited

Everything posted by pioneerx01

  1. Ok, Do you see how I define a string as: $first_name = fromuser ($_POST['first_name']); I will do that a lot in the form and the name of the string and the name of the variable are always the same. $first_name = fromuser ($_POST['first_name']); $last_name = fromuser ($_POST['last_name']); $company_name = fromuser ($_POST['company_name']); $city = fromuser ($_POST['city']); If there a way I can call for a function in this manner: fromuser (first_name) instead of: $first_name = fromuser ($_POST['first_name']); in such manner that the function will return processed variable already in string format of: $first_name = $variable;
  2. I am using this code and it work well: function fromuser ($variable) { $variable = trim(htmlentities($variable, ENT_QUOTES, 'UTF-8')); return $variable; } $first_name = fromuser ($_POST['first_name']); echo "<div class='text_field_description' $first_name_error>First Name: </div> <input name='first_name' type='text' class='text_field' value='$first_name' autocomplete='off'>"; echo "<br/>"; Every time I use $_POST['first_name'] i will also define $first_name. So names will always be the same. So, basically is there a way I can just do this: fromuser (first_name); and function will return processed variable as: $first_name = $variable; I hope I explained myself well. Thanks for input.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.