Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/11/2010, 19:45
Avatar de Tecktonikrazy
Tecktonikrazy
 
Fecha de Ingreso: enero-2010
Mensajes: 224
Antigüedad: 14 años, 4 meses
Puntos: 3
Respuesta: Ayuda con class al enviar formulario

No te entiendo, podrias ser un poquito mas especifico con la segunda idea porfa? o de que modo puedo modificar mi codigo php para que me deje postear html y aplicarlo? este es mi php:

Código PHP:
Ver original
  1. <?php
  2. $file_name = "events.txt";
  3. $post_sep = "<###>";
  4.  
  5. class writePosts {
  6. function inputPost($inputCodeContainer) {
  7. global $file_name, $post_sep;
  8. $date = time();
  9. $self = $_SERVER['PHP_SELF'];
  10. $inputCodeContainer = $inputCodeContainer;
  11. $fh = fopen($file_name, "r+");
  12.  
  13. fread($fh, filesize($file_name));
  14. fwrite($fh, $inputCodeContainer.$post_sep);
  15. fclose($fh);
  16.  
  17. echo "<script>window.location = '$self'; </script>";
  18. }
  19. function getPost(){
  20. if (isset ($_POST['inputCodeContainer'])) {
  21. $this->inputPost($_POST[inputCodeContainer]);
  22. }
  23. }
  24. }
  25.  
  26. class readPosts{
  27. function readAll(){
  28. global $file_name, $post_sep;
  29. $fh = fopen($file_name, "r");
  30. $all = fread($fh, filesize($file_name));
  31. fclose($fh);
  32. $each = explode($post_sep, $all);
  33.  
  34. $i = 0;
  35. $counteach = count($each);
  36.  
  37. while($i < $counteach - 1){
  38. $post_info = explode($post_sep, $each[$i]);
  39. $this->outPost($post_info[0], $post_info[1], $post_info[2]);
  40. $i++;
  41. }
  42. }
  43. function outPost($inputCodeContainer){
  44. $inputCodeContainer = $inputCodeContainer;
  45. echo "$inputCodeContainer";
  46. }
  47. }
  48.  
  49. $write = new writePosts;
  50. $read = new readPosts;
  51. $write->getPost();
  52. ?>
__________________
I LOVE HTML (How To Make Love)