Web Analytics Made Easy -
StatCounter page validates in ff but not in ie - CodingForum

Announcement

Collapse
No announcement yet.

page validates in ff but not in ie

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • page validates in ff but not in ie

    http://www.mhanp.org/aandymdb/vol_post.php

    Hi,

    This page validates html and css, works fine in Firefox. In IE tab, it is in quirks mode, and throws this php error:

    Notice: Undefined offset: 2 in /home/unix/web/htdocs/m/h/mhanp.org/www/aandymdb/volgethours.php
    PHP Code:
    <?php        //volgethours.php
    $volnum1 $_POST['volnum'];
    $volnum2 explode(",",$volnum1);
    $volnum $volnum2[2];
    $rs mysql_select_db("<?php",$conn);
    $sql "SELECT * FROM volrecords, hoursworked WHERE `volrecords`.`id` = `hoursworked`.`vol_id` AND `volrecords`.`id` LIKE $volnum ORDER BY `hoursworked`.`id` desc LIMIT 4 ";
    if(!
    $sql){echo "Unable to select" mysql_error();}
    $rs mysql_query($sql,$conn);
    echo 
    '<table width="650" border="1" summary="volunteer record post" cellspacing="1" cellpadding="1">
    <col width="100">
    <col width="75">
    <col width="150">
    <col width="50">
    <col width="150">
    <tr><th>Date</th><th>Hours</th><th>Area</th><th>Peers</th><th>Memo</th></tr>'
    ;
    while(
    $row=mysql_fetch_array($rs)){
        echo(
    "<tr><td>" $row['date'] . "</td><td>" $row['hours'] . "</td><td>" .$row['areaofinterest'] . "</td><td>" $row['peers'] . "</td><td>" $row['memo'] . "</td></tr>");
        }
    echo 
    '</table>';
    mysql_free_result($rs);        
    mysql_close($conn);
    ?>
    table hoursworked:

    Code:
    Array
    (
        [0] => id
        [1] => smallint(6)
        [2] => 
        [3] => PRI
        [4] => 
        [5] => auto_increment
    )
    
    Array
    (
        [0] => vol_id
        [1] => smallint(6)
        [2] => 
        [3] => 
        [4] => 0
        [5] => 
    )
    
    Array
    (
        [0] => date
        [1] => date
        [2] => 
        [3] => 
        [4] => 0000-00-00
        [5] => 
    )
    
    Array
    (
        [0] => hours
        [1] => decimal(5,2)
        [2] => 
        [3] => 
        [4] => 0.00
        [5] => 
    )
    
    Array
    (
        [0] => areaofinterest
        [1] => varchar(50)
        [2] => 
        [3] => 
        [4] => 
        [5] => 
    )
    
    Array
    (
        [0] => peers
        [1] => smallint(6)
        [2] => 
        [3] => 
        [4] => 0
        [5] => 
    )
    
    Array
    (
        [0] => memo
        [1] => varchar(100)
        [2] => 
        [3] => 
        [4] => na
        [5] => 
    )
    table volrecords:

    Code:
    Array
    (
        [0] => id
        [1] => smallint(6)
        [2] => 
        [3] => PRI
        [4] => 
        [5] => auto_increment
    )
    
    Array
    (
        [0] => firstname
        [1] => varchar(50)
        [2] => 
        [3] => 
        [4] => 
        [5] => 
    )
    
    Array
    (
        [0] => lastname
        [1] => varchar(50)
        [2] => 
        [3] => 
        [4] => 
        [5] => 
    )
    
    Array
    (
        [0] => volsource
        [1] => varchar(50)
        [2] => 
        [3] => 
        [4] => 
        [5] => 
    )
    Would appreciate a look.

    Thanks,

    Andy

  • #2
    Don't you have the line number in that actual error message?
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment


    • #3
      I'm going to guess it's this line - $volnum = $volnum2[2];

      Valid html and css has nothing to do with the data that your form produces. It is the programmer's responsibility to insure that the form produces the correct data and that your form processing code validates the data when it reaches the server before you use it. It would take seeing your form, where $_POST['volnum'] is being produced, to be able to help you both with why a different browser sends different data and what would be the best way to validate that data to detect when it is not present.
      Finding out HOW to do something is called research, i.e. keep searching until you find the answer. After you attempt to do something and cannot solve a problem with it yourself, would be when you ask others for help.

      Comment


      • #4
        Thanks for your time. I am working on a shared server and can't change the ini. I am using 'ERROR_REPORTING(E-ALL)' to hopefully, report all errors.

        We presently have 200 volunteers in volrecords table with 21000 log entries into the housworked table. This is in microsoft access and on the local intranet. My project is to adapt this to mysql on the internet web server. I am trying to make the interface resemble the access interface.

        The main page (vol_post) pulls a list of the volunteers into a select drop-down. The fields are 'firstname', 'lastname'. I am concat() them into 'lastname',', ','firstname',', ','id' in the sql query 'volgetname.php' so they appear neatly in the drop-down list.

        I pull this select value into the select query to get the hours, volgethours.php. I need to get the id number from this value for the query. I do this with the explode() function, volgethours.php.

        The posting goes on later and works fine with Firefox but not IE.

        The only two table descriptions are in the first post.

        The main post and process pages are changed to txt and listed here so you can just view them without my posting too much code:

        http://www.mhanp.org/aandymdb/vol_post.php.txt
        http://www.mhanp.org/aandymdb/volgetname.php.txt
        http://www.mhanp.org/aandymdb/volgethours.php.txt

        Yes, this is a lot more than I am accustomed to. If I simply complete the usual html + php pages, the refresh time will be a deal breaker.

        I appreciate your help.

        Comment


        • #5
          What's the empty include for on:
          http://www.mhanp.org/aandymdb/volgetname.php and http://www.mhanp.org/aandymdb/volgethours.php

          Since line 2 is the empty include, delete that line......

          Comment


          • #6
            The include isn't empty, it pulls in my username & password. I just cut those out for this post.

            Comment


            • #7
              Well something's wrong with that include.....

              That include is causing the error.....

              Comment


              • #8
                You may well be right. This is where I get lost,

                http://www.mhanp.org/aandymdb/vol_post.php

                When I visit that url in firefox and follow through to completion, everything works as designed.

                The page validates both css and html. Firefox firebug throws zero errors.

                Now I visit the same url in ie, errors all over the place.

                I can't ignore ie, to many work stations have only ie.

                Phew.

                Comment


                • #9
                  what the hell are you talking about???

                  It looks fine in IE and there is no errors!!!

                  Comment


                  • #10
                    Hi,

                    That it looks ok to you is super. My ie returns:

                    Notice: Undefined offset: 2 in /home/unix/web/htdocs/m/h/mhanp.org/www/aandymdb/volgethours.php on line 10


                    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/unix/web/htdocs/m/h/mhanp.org/www/aandymdb/volgethours.php on line 22
                    I must have something screwed up with my ie options.

                    I have in the past, had web pages working well on my development pc but fail elsewhere. Now this page works well elsewhere and fails at home base.

                    Thanks a lot for your input.

                    Andy

                    Comment


                    • #11
                      Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/unix/web/htdocs/m/h/mhanp.org/www/aandymdb/volgethours.php on line 22
                      Add proper error checks to the query which gives the result set to the above mysql_fetch_array() on line 22
                      Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

                      Comment


                      • #12
                        abduraooft,

                        I did that. Inserted
                        echo '<pre style="text-align: left;">' . print_r($_POST, true) . '</pre>';
                        after this line:
                        $volnum1 = $_POST['volnum'];
                        .
                        Now firefox returns:
                        Array
                        (
                        [volnum] => Moorhead, Katharine, 4
                        )
                        while IE returns:
                        Array
                        (
                        [volnum] =>
                        )
                        I believe this cascades into the error on line 22.

                        This still has me stumped as to why the php returns differently on different browsers even though it runs on the serverside.

                        Comment


                        • #13
                          What I asked is to change your query statements like
                          PHP Code:
                          $something=mysql_query("...some query...") or die(mysql_error()); 
                          Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

                          Comment


                          • #14
                            Inserted:
                            $rs = mysql_query($sql,$conn) or die('mysql_error()');
                            and it now returns:
                            Notice: Undefined offset: 2 in /home/unix/web/htdocs/m/h/mhanp.org/www/aandymdb/volgethours.php on line 10
                            mysql_error()
                            1.
                            PHP Code:
                            <?php                    //volgethours.php
                            2.include("conn.php");
                            3.error_reporting(E_ALL);
                            4.if (!$conn)
                            5.  {
                            6.  die('Could not connect: ' mysql_error());
                            7.  }
                            8.$volnum1 $_POST['volnum'];
                            9.$volnum2 explode(",",$volnum1);
                            10.$volnum $volnum2[2];
                            11.$rs mysql_select_db("client_mhanp",$conn);
                            etc.

                            Comment


                            • #15
                              I think this is an error in my jquery. I will post in that forum.

                              Thanks,

                              Andy

                              Comment

                              Working...
                              X