Buchstaben umwandeln


68

Wenn ein neuer Kunde bei der Registrierung die Buchstaben anstatt groß, klein schreibt kann dieser Eintrag in die Datenbank automatisch korrigiert werden.

Beispiel:
john doe wird zu John Doe

Finde in: catalog/create_account.php

    $firstname = tep_db_prepare_input($_POST['firstname']);
    $lastname = tep_db_prepare_input($_POST['lastname']);
    if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($_POST['dob']);
    $email_address = tep_db_prepare_input($_POST['email_address']);
    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);
    $street_address = tep_db_prepare_input($_POST['street_address']);
    if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input($_POST['suburb']);
    $postcode = tep_db_prepare_input($_POST['postcode']);
    $city = tep_db_prepare_input($_POST['city']);
    if (ACCOUNT_STATE == 'true') {
      $state = tep_db_prepare_input($_POST['state']);
      if (isset($_POST['zone_id'])) {
        $zone_id = tep_db_prepare_input($_POST['zone_id']);
      } else {
        $zone_id = false;
      }
    }

Ersetze mit:

    $firstname = tep_db_prepare_input(ucwords($_POST['firstname']));
    $lastname = tep_db_prepare_input(ucwords($_POST['lastname']));
    if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($_POST['dob']);
    $email_address = tep_db_prepare_input($_POST['email_address']);
    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input(ucwords($_POST['company']));
    $street_address = tep_db_prepare_input(ucwords($_POST['street_address']));
    if (ACCOUNT_SUBURB == 'true') $suburb = tep_db_prepare_input(ucwords($_POST['suburb']));
    $postcode = tep_db_prepare_input($_POST['postcode']);
    $city = tep_db_prepare_input(ucwords($_POST['city']));
    if (ACCOUNT_STATE == 'true') {
      $state = tep_db_prepare_input(ucwords($_POST['state']));
      if (isset($_POST['zone_id'])) {
        $zone_id = tep_db_prepare_input($_POST['zone_id']);
      } else {
        $zone_id = false;
      }
    }

w3c-Commerce
w3c-Commerce Downloads
  w3c-Commerce Add-ons php8