Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/11/2002, 21:54
Avatar de temaqueja
temaqueja
 
Fecha de Ingreso: agosto-2002
Ubicación: /dev/null/
Mensajes: 399
Antigüedad: 21 años, 8 meses
Puntos: 4
Sencillo script para llenar un archivo ascii

Script en mensaje.php
Código PHP:
<?
  
if(isset($enviar)) {
    
$body="";
    for(
$t=1;$t<=sizeof($cel);$t++){
      
$body.= trim($cel[$t]). " ";
    }

    if(
trim($body)<>"") {
      if(
1==1){
        
$param"?res=ok";
        if(
$fp = @fopen('/tmp/mensajes.txt','a')) {
          
fputs($fp,$body.' -('.$REMOTE_ADDR.')'.chr(10));   //.chr(13)
          
fclose($fp);
        }
      } else {
        
$param"?res=no";
      }
    } else {
      
$param "?res=va";
    }
    
$param.= "#mensaje";
    
  } else {
    
$param "";
  }
  
header("Location: mensaje.html".$param);
?>

Script en mensaje.html
es posible que salga mal los htmls
Código PHP:
<HTML><HEAD><TITLE>Mensajes</TITLE></HEAD>
<BODY>
<TABLE border=0>
  <TR>
    <TD colspan="2"> 
          
      <?
              
if($res=="ok") { echo "<b>Listo, me acabas de enviar un mensaje!!</b>"; }
              if(
$res=="va") { echo "<font color=#ff0000>Primero escribe algo!!</font>"; }
              if(
$res=="no") { echo "<font color=#ff0000>FALLO EL ENVIO!!!, (no se ha enviado).</font>"; }
          
?>
    </TD>
  </TR>
  <TR> 
    <TD colspan="2"><b>M</b>anda un mensaje a mi teléfono celular:<br>
      <form name="frmcel" method="post" action="mensaje.php">
        <input type="text" name="cel[1]" value="" size="50" maxlength="50">
        <br>
        <input type="text" name="cel[2]" value="" size="50" maxlength="50">
        <br>
        <input type="text" name="cel[3]" value="" size="50" maxlength="50">
        <br>
        <input type="submit" name="enviar" value="Enviar">
        <br>
      </form>
    </TD>
  </TR>
  <TR>
    <TD colspan="2"><font face="Arial" size="2">No olvides dar tu nombre para saber quien eres!</font></TD>
  </TR>
  <TR>
    <TD colspan="2"><font face="Arial" size="2">La hora en Lima-Per&uacute;: <?=date('h:m a');?></font></TD>
  </TR>
</TABLE>
</BODY></HTML>
__________________
_________________________
La computadora nació para resolver problemas que antes no existían