Jump to content

hsanabria

Members
  • Posts

    9
  • Joined

  • Last visited

About hsanabria

  • Birthday 05/13/1966

Profile Information

  • Gender
    Male

hsanabria's Achievements

Newbie

Newbie (2/6)

1

Reputation

1

Community Answers

  1. I used the utf8_encode function and now the data is written correctly. This is the modified test code, if is useful for someone. <?php header('Content-Type: text/html; charset=UTF-8'); $p = new Page(); $p->setOutputFormatting(false); $p->template = 'cita'; // $p->parent = wire('pages')->get('/agenda/'); $p->name = $sanitizer->name("Solicitud de cita 20150629082201"); $p->title = $sanitizer->text(utf8_encode("Solicitud de cita de Pedro Pérez")); $p->cita_nombre = $sanitizer->text(utf8_encode("Pedro Pérez")); $p->cita_edad = 45; $p->cita_telefono = "22334455"; $p->cita_correo = "pedro_perez@hotmail.com"; $p->cita_tipo = $sanitizer->text(utf8_encode("Nueva cita")); $p->cita_otros_detalles = $sanitizer->textarea(utf8_encode("Presión alta")); $p->cita_dia_hora1 = $sanitizer->text(utf8_encode("Lunes 4:00 p.m.")); $p->cita_dia_hora2 = $sanitizer->text(utf8_encode("Miércoles 5:00 p.m.")); $p->save(); echo "La página {$p->id} fue creada!<br>"; ?> Thanks
  2. Hi Wanze: Thanks for your time. This is my PHP test code, where I think I applied your suggestion, but I get the same results. <?php header('Content-Type: text/html; charset=UTF-8'); $p = new Page(); $p->setOutputFormatting(false); $p->template = 'cita'; // $p->parent = wire('pages')->get('/agenda/'); $p->name = $sanitizer->name("Solicitud de cita 20150629082201"); $p->title = $sanitizer->text("Solicitud de cita de Pedro Pérez"); $p->cita_nombre = $sanitizer->text("Pedro Pérez"); $p->cita_edad = 45; $p->cita_telefono = "22334455"; $p->cita_correo = "pedro_perez@hotmail.com"; $p->cita_tipo = $sanitizer->text("Nueva cita"); $p->cita_otros_detalles = $sanitizer->textarea("Presión alta"); $p->cita_dia_hora1 = $sanitizer->text("Lunes 4:00 p.m."); $p->cita_dia_hora2 = $sanitizer->text("Miércoles 5:00 p.m."); $p->save(); echo "La página {$p->id} fue creada!<br>"; ?> All values are cut when find the first special character Thanks in advanced Henry
  3. Something similar happens to me when I search a sentence with special characters. If the field is of type text or text area, the search no returns any coincidence, if I search a sentence with special characters. If the field type is text area and this used CKeditor, they match and return the correct values. Any idea why this functionality behaves like this?
  4. My database uses UTF-8 and to create pages from the administrator with fields with special characters (eg é or ñ) are handled smoothly. But in trying to create pages with the API, the values are cut when find the first special character. For example: $ p-> name = "Pedro Pérez"; // With é or $ p-> name = $ sanitizer-> text ("Peter Pérez"); // With é Are recorded "Pedro P" and the rest are lost Any suggestions to resolve the situation?
  5. Thanks pwFoo by the indication. Actually I don't know how to integrate that code to the login template, for that custom page will behave as the original page. I used another template over a new page and it works well, but if you can tell me how do I get this to work as the original page I'd appreciate.
  6. I created a custom login page as indicated in https://processwire.com/talk/topic/107-custom-login/ I have active the forgot password module and have included a link to ./?forgot=1 at the custom template, but this does not lead me to change password . I should do for achieve the same functionality? Thanks
  7. I am creating a custom search routine. This code of Ryan has been very useful to encompass all fields of the page. foreach($page->fields as $field) {echo "<p>"; echo "Field: {$field->name}<br />"; echo "Type: {$field->type}<br />"; echo "Value: " . $page->get($field->name); echo "</p>"; } But I failed to get the subfields of repeater's field type. It may be something simple, but I have several hours trying with unsuccessfully options. Any suggestions?
  8. I am creating a custom search routine and this code has been very useful to encompass all fields of the site pages. foreach($page->fields as $field) { echo "<p>"; echo "Field: {$field->name}<br />"; echo "Type: {$field->type}<br />"; echo "Value: " . $page->get($field->name); echo "</p>"; } But I failed to get the subfields of repeater's field type Any suggestions?
×
×
  • Create New...