30/07/2010, 05:06
|
| | Fecha de Ingreso: julio-2010
Mensajes: 30
Antigüedad: 14 años, 4 meses Puntos: 0 | |
<?php
$ID1= $_GET['id'];
$ID_DOC1= $_GET ['id_cod'];
$NAME1= $_GET ['name'];
$ID_COMPANNIA1= $_GET['id_compannia'];
$ID_RAMO1= $_GET['id_ramo'];
$ANNO1= $_GET['anno'];
$ID_EXPEDIENTE1= $_GET['id_expediente'];
$IDINTERVINIENTE1= $_GET['idinterviniente'];
$INFO1= $_GET['info'];
/*
$query1="SELECT * FROM `servi`.`recepcion` WHERE(ID='" .$ID1."'AND ID_DOC='".$ID_DOC1. ")";*/
/*$resultID =mysql_query ($query1,$conexion) or die("Data not found.");*/
$doc = new DOMDocument ( '1.0' );
// we want a nice output
$doc -> formatOutput = true ;
$root = $doc -> createElement ( 'MENSAJE' );
$root = $doc -> appendChild ( $root );
$title = $doc -> createElement ( 'TIPO' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( 'envio' );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'ID' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $ID1 );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'NAME' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( 'EnvioInfo' );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'ID_COMPANNIA' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $ID_COMPANNIA1 );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'ID_RAMO' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $ID_RAMO1 );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'ANNO' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $ANNO1 );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'ID_EXPEDIENTE' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $ID_EXPEDIENTE1 );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'ID_INTERVINIENTE' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $IDINTERVINIENTE1 );
$text = $title -> appendChild ( $text );
$title = $doc -> createElement ( 'INFO' );
$title = $root -> appendChild ( $title );
$text = $doc -> createTextNode ( $INFO1 );
$text = $title -> appendChild ( $text );
echo 'Wrote: ' . $doc -> save ( "ENVIOINFO.xml" ) . ' bytes' ; // Wrote: 72 bytes
echo "<script language='javascript'> location.href='xmlenviocaser.PHP;</script>";
ECHO "HOLA";
/*Escaping illegal characters
$row['text'] = str_replace("&", "&", $row['text']);
$row['text'] = str_replace("<", "<", $row['text']);
$row['text'] = str_replace(">", ">", $row['text']);
$row['text'] = str_replace("\"", """, $row['text']);
$xml_output .= "\t\t<text>" . $row['text'] . "</text>\n";
$xml_output .= "\t</alumnos>\n";*/
?>
DE ESTA MANERA LO PUEDES HACER Y SOLOS TIENES QUE CAMBIAR U POCO EL CODIGO
ESTA MANERA ES MAS FACIL
*/
$ID1= $_GET['id'];
$ID_DOC1= $_GET ['id_cod'];
$NAME1= $_GET ['name'];
$ID_COMPANNIA1= $_GET['id_compannia'];
$ID_RAMO1= $_GET['id_ramo'];
$ANNO1= $_GET['anno'];
$ID_EXPEDIENTE1= $_GET['id_expediente'];
$idi= $_GET['idinterviniente'];
$INFO1= $_GET['info'];
$IDDOC2=$_GET['id_cod1'];
$TIPODOC2=$_GET['tipo_doc'];
/*
$query1="SELECT * FROM `servi`.`recepcion` WHERE(ID='" .$ID1."'AND ID_DOC='".$ID_DOC1. ")";*/
/*$resultID =mysql_query ($query1,$conexion) or die("Data not found.");*/
/*$doc->loadXML(' <MENSAJE>
<TIPO>'.$ID_DOC1.'</TIPO>
<VERSION>1.0</VERSION>
<ID>'.$ID1.'</ID>
<NAME>EnvioDoc</NAME>
<ID_COMPANNIA>'.$ID_COMPANNIA1.'</ID_COMPANNIA>
<ID_RAMO>'.$ID_RAMO1.'</ID_RAMO>
<ANNO>'$ANNO1'</ANNO>
<ID_EXPEDIENTE>'$ID_EXPEDIENTE1'</ID_EXPEDIENTE>
<ID_INTERVINIENTE>'.$IDINTERVINIENTE1.'</ID_INTERVINIENTE>
<COD>
<ID_DOC>'.$IDDOC2.'</ID_DOC>
<TIPO_DOC>'.$TIPODOC2.'</TIPO_DOC>
</COD>
<INFO>'.$INFO1.'</INFO>
</MENSAJE>');*/
$doc = new DOMDocument();
$doc->loadXML('
<MENSAJE>
<TIPO>'.$ID_DOC1.'</TIPO>
<VERSION>1.0</VERSION>
<ID>'.$ID1.'</ID>
<NAME>EnvioDoc</NAME>
<ID_COMPANNIA>0001</ID_COMPANNIA>
<ID_RAMO>30</ID_RAMO>
<ANNO>'.$ANNO1.'</ANNO>
<ID_EXPEDIENTE>'.$ID_EXPEDIENTE1.'</ID_EXPEDIENTE>
<ID_INTERVINIENTE>'.$idi.'</ID_INTERVINIENTE>
<COD>
<ID_DOC>'.$IDDOC2.'</ID_DOC>
<TIPO_DOC>'.$TIPODOC2.'</TIPO_DOC>
</COD>
<INFO>'.$INFO1.'</INFO>
</MENSAJE>');
echo $doc->save("XML/ENVIOINFO.xml");
//LEUGO EN VEZ DE SALBARLO LO MUESTRA EN PANTALLA //.
Y POR ULTIMO OTRA FORMA DE HACERLO ES
*/
$ID1= $_GET['id'];
$ID_DOC1= $_GET ['id_cod'];
$NAME1= $_GET ['name'];
$ID_COMPANNIA1= $_GET['id_compannia'];
$ID_RAMO1= $_GET['id_ramo'];
$ANNO1= $_GET['anno'];
$ID_EXPEDIENTE1= $_GET['id_expediente'];
$IDINTERVINIENTE1= $_GET['idinterviniente'];
$INFO1= $_GET['info'];
/*
$query1="SELECT * FROM `servi`.`recepcion` WHERE(ID='" .$ID1."'AND ID_DOC='".$ID_DOC1. ")";*/
/*$resultID =mysql_query ($query1,$conexion) or die("Data not found.");*/
$xml_output = "<xml version=\"1.0\" encoding=\"ISO-8859-1\">\n";
$xml_output .= "<MENSAJE TIPO=\".$ID_DOC1. \" VERSION=\"1.0\" ID=\".$ID1.\" NAME= \".$NAME1.\">\n";
$xml_output .="\t<ID_COMPANNIA>".$ID_COMPANNIA1."</ID_COMPANNIA>\n";
$xml_output .="\t<ID_RAMO>".$ID_RAMO1."</ID_RAMO>\n";
$xml_output .="\t<ANNO>".$ANNO1."</ANNO>";
$xml_output .="\t<ID_EXPEDIENTE>".$ID_EXPEDIENTE1."</ID_EXPEDIENTE>\n";
$xml_output .="\t<ID_INTERVINIENTE>".$IDINTERVINIENTE1."</ID_INTERVINIENTE>\n";
$xml_output .="\t<INFO>".$INFO1."</INFO>\n";
$xml_output .="</MENSAJE>";
$xml_output .="</xml>";
echo $xml_output;
/*Escaping illegal characters
$row['text'] = str_replace("&", "&", $row['text']);
$row['text'] = str_replace("<", "<", $row['text']);
$row['text'] = str_replace(">", ">", $row['text']);
$row['text'] = str_replace("\"", """, $row['text']);
$xml_output .= "\t\t<text>" . $row['text'] . "</text>\n";
$xml_output .= "\t</alumnos>\n";*/
$_COOKIE= $xml_output;
?>
ESPERO QUE CON ESTOS TRES EJEMPLILLOS TE QUEDE CLARO
SALUDOS
Última edición por GatorV; 30/07/2010 a las 08:43 |