Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Iam getting an error un defined function load()

    Hi, I am getting an error when i uploading the Xml document.

    Iam getting an error is that "Fatal error: Call to undefined function: load() "

    The following is the code:

    <?
    ob_start();

    $id=$_REQUEST['teamid'];
    echo $id;
    ?>
    <?php
    $data = array();

    function add_person( $teamname,$points)
    {
    global $data;
    $con=mysql_connect("host name","root","pass");
    mysql_select_db("database name");
    //echo $first;
    //echo $middle;



    $sql=mysql_query("insert into teamodi(teamname,points) values('$teamname','$points')") or die(mysql_error());
    //$sql=mysql_query("insert into names(first,middle,last,email) values('$first','$midddle','$last','$email)") or die(mysql_error());
    $data []= array(
    'teamname' => $teamname,
    'points' => $points,
    );
    }

    if ( $_FILES['file']['tmp_name'] )
    {
    //$dom = new DOMDocument();
    //$dom->load($_FILES['file']['tmp_name']);
    $dom = DOMDocument::load( $_FILES['file']['tmp_name'] );
    $rows = $dom->getElementsByTagName( 'Row' );
    $first_row = true;
    foreach ($rows as $row)
    {
    if ( !$first_row )
    {
    $teamname = "";
    $points = "";


    $index = 1;
    $cells = $row->getElementsByTagName( 'Cell' );
    foreach( $cells as $cell )
    {
    $ind = $cell->getAttribute( 'Index' );
    if ( $ind != null ) $index = $ind;

    if ( $index == 1 )$teamname = $cell->nodeValue;
    if ( $index == 2 ) $points = $cell->nodeValue;


    $index += 1;
    }
    add_person($teamname,$points);
    }
    $first_row = false;
    }
    }
    ?>



    <?
    $type=$_REQUEST['type'];

    if($type==1)
    {?>
    <tr><td><table>
    <tr>
    <th>Team Name</th>
    <th>Points</th>

    <?
    $con=mysql_connect("host","root","pass");
    mysql_select_db("dbname");
    $sql1=mysql_query("select * from teamodi");
    while($result=mysql_fetch_array($sql1))
    {
    ?>

    <tr>
    <td><?php echo $result['teamname']; ?></td>
    <td><?php echo $result['points']; ?></td>

    </tr>
    <?php }header("location:home.php"); ?>
    </table></td></tr>
    <? }

    else
    {
    header("location:home.php");
    }
    ob_end_flush();
    ?>


    The code is working correctly in the local server,
    But it is not working in the remote server.
    It is giving error that undefined function load.

    Please help me to correct this error.How to debug this error..

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •