500 - internal server error
Posted: Sat Jul 12, 2008 3:54 pm
I got this error with a very weird behavior.
There is a break statement, if i commented, the code runs with no problem, but if i use it, i got the following strange message:
500 Internal Server Error
The server has encountered an internal error or misconfiguration and was unable to complete your request.
while(true)
{
$temp = $currentString;
$currentString = strstr($currentString,"<way id=");
if($currentString == false)
{
echo "out";
break;
}
$wayPosition = strpos($currentString,"<way id=",$nextWay);
$nextWay = $wayPosition + 1;
$wayID = substr($currentString, 8,9);
echo $i." way ID = ".$wayID."<br>";
$x= 0;
$nodePosition = 0;
$position = 0;
$next = 0;
$temp = $currentString;
while(true)
{
$position = strpos($temp,"<nd ref=",$next);
$next = $position + 1;
echo "initial pos = ".$position."<BR>";
$nodePosition = $nodePosition + $position;
$nodePosition = (int)$nodePosition;
echo "node pos = ".$nodePosition."<BR>";
$wayPosition = $wayPosition + 0;
echo "way pos = ".$wayPosition."<BR>";
$wayPosition = (int)$wayPosition;
if(((int)$nodePosition) > ((int)$wayPosition))
{
echo "OUT <BR>";
break; => this is the break statment, i meant
}
$currentString = strstr($currentString,"<nd ref=");
$nodeRef[$x] = substr($currentString, 8,11);
$x++;
}
for($y=0;$y<count($nodeRef);$y++)
{
echo " Node Ref = ".$nodeRef[$y]."<br>";
}
$i++;
}
Hope I can find a solution for this
thanks
Sherif attia
There is a break statement, if i commented, the code runs with no problem, but if i use it, i got the following strange message:
500 Internal Server Error
The server has encountered an internal error or misconfiguration and was unable to complete your request.
while(true)
{
$temp = $currentString;
$currentString = strstr($currentString,"<way id=");
if($currentString == false)
{
echo "out";
break;
}
$wayPosition = strpos($currentString,"<way id=",$nextWay);
$nextWay = $wayPosition + 1;
$wayID = substr($currentString, 8,9);
echo $i." way ID = ".$wayID."<br>";
$x= 0;
$nodePosition = 0;
$position = 0;
$next = 0;
$temp = $currentString;
while(true)
{
$position = strpos($temp,"<nd ref=",$next);
$next = $position + 1;
echo "initial pos = ".$position."<BR>";
$nodePosition = $nodePosition + $position;
$nodePosition = (int)$nodePosition;
echo "node pos = ".$nodePosition."<BR>";
$wayPosition = $wayPosition + 0;
echo "way pos = ".$wayPosition."<BR>";
$wayPosition = (int)$wayPosition;
if(((int)$nodePosition) > ((int)$wayPosition))
{
echo "OUT <BR>";
break; => this is the break statment, i meant
}
$currentString = strstr($currentString,"<nd ref=");
$nodeRef[$x] = substr($currentString, 8,11);
$x++;
}
for($y=0;$y<count($nodeRef);$y++)
{
echo " Node Ref = ".$nodeRef[$y]."<br>";
}
$i++;
}
Hope I can find a solution for this
thanks
Sherif attia