PHP.exe chrashes on WIN95 / WIN98SE
| From: | Rainer Gross | Date: | Fri, 20 Apr 2001 22:39:17 +0000 |
| Subject: | PHP.exe chrashes on WIN95 / WIN98SE | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-6938@lists.php.net to get a copy of this message | ||
Hi all the following code crahes on Win95 and Win98SE using the CGI inteface
with personal webserver.
The code now is full of stupid things to find an inexistent error since the
code works fine on a Linux PHP.
So do anyone have an idea about what is going on?
<?php
class xml
{
var $parser;
var $values;
function xml()
{
$this->parser = xml_parser_create();
$this->values[]='';
xml_set_object($this->parser,$this);
xml_set_element_handler($this->parser,"tag_open","tag_close");
xml_set_character_data_handler($this->parser,"cdata");
}
function parse($data)
{
print("parse");
xml_parse($this->parser,$data);
}
function tag_open($parser,$tag,$attributes)
{
print("tag_open");
echo "\n<$tag";
while (list ($key, $val) = each ($attributes))
{
echo " $key = \"$val\"";
if ($key == 'NAME')
{
if (in_array($key, array_keys($this->values)))
{
$buf = "jj";
$bufa = $val;
var_dump($this);
$buf = $this->values["$bufa"];
echo " value = \"$buf\" ";
}
}
}
echo ">";
}
function cdata($parser,$cdata)
{
print("cdata");
$buf = trim($cdata);
echo "$buf";
}
function tag_close($parser,$tag)
{
print("tag_close");
echo "</$tag>";
}
function mi_set_value($k, $v)
{
print("set_value");
$key2 = func_get_arg(0);
$value2 = func_get_arg(1);
var_dump($this);
$this->values[$key2] = "fdss";
var_dump($this->values[$key]);
}
} // end of class xml
$xml_parser = new xml();
$fcontents = join (' ', file ('user.html'));
#var_dump($fcontents);
var_dump($xml_parser);
$xml_parser->mi_set_value('name', 'kjfdlkd');
var_dump($xml_parser);
print ("hier");
$xml_parser->parse($fcontents);
echo xml_error_string(xml_get_error_code($xml_parser->parser));
?>
The user.html read is:
<HTML><HEAD><TITLE></TITLE>
</HEAD>
<BODY>
<P>
<TABLE >
<TBODY>
<TR>
<TD>Aqui va el menú</TD>
<TD>
<TABLE >
<TBODY>
<TR>
<TD>
<TABLE >
<TBODY>
<TR>
<TD>Nombre:</TD>
<TD><INPUT id="text1" name="text1"
/></TD></TR>
<TR>
<TD>Apellido:</TD>
<TD><INPUT id="text2" name="text2"
/></TD></TR>
<TR>
<TD>Rut:</TD>
<TD><INPUT id="text3" name="text3"
/></TD></TR>
<TR>
<TD>Patron:</TD>
<TD><INPUT id="text4"
name="text4"/></TD></TR></TBODY></TABLE>
<P><INPUT id="submit1" name="submit1"
type="submit"
value="Buscar"></P></TD></TR>
<TR>
<TD>
<P> </P>
<P><STRONG><FONT size=4>Resultado de la
Busqueda</FONT></STRONG>
</P>
<TABLE >
<TBODY>
<TR>
<TD>Nombre</TD>
<TD>Rut</TD>
<TD>Apellido</TD>
<TD>Editar</TD>
<TD>Ver</TD>
<TD>Eliminar</TD></TR>
<TR>
<TD align="middle"><FONT
color="crimson">Data</FONT></TD>
<TD align="middle">Data</TD>
<TD align="middle">Data</TD>
<TD align="middle"><A
href="http://www.sonda.com/">Data</A></TD>
<TD align="middle"><A
href="http://www.sonda.com/">Data</A></TD>
<TD align="middle"><A
href="http://www.sonda.com/">Data</A></TD></TR></TBODY></TABLE></TD></TR></T
BODY></TABLE></TD></TR></TBODY></TABLE></P></BODY></HTML>