SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error at bottom of browser

    hello i seem to have a error in my code somewhere, because when i click the form submit at the bottom of the browser it says error on page and when i double click that it says:

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; .NET4.0C)
    Timestamp: Thu, 23 Dec 2010 13:29:13 UTC


    Message: Unspecified error.
    Line: 403
    Char: 1
    Code: 0
    URI: http://121chatrooms.net/v4/content.p...tor-Management



    my code is
    Code:
    include "database.php";
    $loggeduser=vB::$vbulletin->userinfo['username'];
    $output .= <<<JS
    <script language="javascript" type="text/javascript">
    <!--
    //Browser Support Code
    function ajaxFunction(){
    var ajaxRequest; // The variable that makes Ajax possible!
    
    try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
    } catch (e){
    // Internet Explorer Browsers
    try{
    ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try{
    ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e){
    // Something went wrong
    alert("Your browser broke!");
    return false;
    }
    }
    }
    // Create a function that will receive data sent from the server
    ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
    var ajaxDisplay = document.getElementById('ajaxDiv');
    ajaxDisplay.innerHTML = ajaxRequest.responseText;
    }
    }
    var username = document.getElementById('username').value;
    var userlevel = document.getElementById('userlevel').value;
    var jloggeduser = '$loggeduser';
    var queryString = "username=" + username + "&userlevel=" + userlevel + "&loggeduser=" + jloggeduser;
    ajaxRequest.open("POST", "test.php" , true);
    ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
    ajaxRequest.send(queryString)
    ajaxRequest.send(null);
    }
    //-->
    </script>
    JS;
    
    $output .= '<form name=myForm method=post>';
    $output .= 'UserName: <input type=text id=username />';
    $output .= 'UserLevel: <select id=userlevel>';
    $output .= '<option value=2>Member</option>';
    $output .= '<option value=7>Moderator</option>';
    $output .= '</select>';
    $output .= '<input type=button onclick=ajaxFunction() value=Update User />';
    $output .= '</form>';
    $output .= '<div id=ajaxDiv>';
    
    $result = mysql_db_query($dbname, "SELECT * FROM member WHERE MemberType = '5' or MemberType = '4' order by username asc ");
    $output .='<b>Administrators:</b><br>';
    if (mysql_num_rows($result)) {
       while ($qry = mysql_fetch_array($result)) {
    
    $query2 = mysql_query("SELECT * FROM member WHERE UserName='$qry[UserName]' ")
    or die("Could not insert data because ".mysql_error());
    $qry2 = mysql_fetch_array( $query2 );
    
    $query4 = mysql_query("SELECT * FROM onlineusers WHERE UserName='$qry[UserName]' ")
    or die("Could not insert data because ".mysql_error());
    $qry4 = mysql_fetch_array( $query4 );
    
    $query3 = mysql_query("SELECT * FROM room WHERE RoomID='$qry4[RoomID]' ")
    or die("Could not insert data because ".mysql_error());
    $qry3 = mysql_fetch_array( $query3 );
    
    if (mysql_num_rows($query4) == 0) {
    $status = "Offline";
    }
    else
    {
    $status = "$qry3[RoomName]";
    }
    $output .="<img src=images/icons/admin.png> $qry[UserName] <a href=member.php?$qry2[MemberID]-$qry2[UserName]>[View Profile]</a> ($status)<br>";
    }
    }
    
    $result = mysql_db_query($dbname, "SELECT * FROM member WHERE MemberType = '3' order by username asc ");
    $output .='<br><b>Senior Moderators:</b><br>';
    if (mysql_num_rows($result)) {
       while ($qry = mysql_fetch_array($result)) {
    
    $query2 = mysql_query("SELECT * FROM member WHERE UserName='$qry[UserName]' ")
    or die("Could not insert data because ".mysql_error());
    $qry2 = mysql_fetch_array( $query2 );
    
    $query4 = mysql_query("SELECT * FROM onlineusers WHERE UserName='$qry[UserName]' ")
    or die("Could not insert data because ".mysql_error());
    $qry4 = mysql_fetch_array( $query4 );
    
    $query3 = mysql_query("SELECT * FROM room WHERE RoomID='$qry4[RoomID]' ")
    or die("Could not insert data because ".mysql_error());
    $qry3 = mysql_fetch_array( $query3 );
    
    if (mysql_num_rows($query4) == 0) {
    $status = "Offline";
    }
    else
    {
    $status = "$qry3[RoomName]";
    }
    $output .="<img src=images/icons/srmod.png> $qry[UserName] <a href=member.php?$qry2[MemberID]-$qry2[UserName]>[View Profile]</a> ($status)<br>";
    }
    }
    
    $result = mysql_db_query($dbname, "SELECT * FROM member WHERE MemberType = '2' order by username asc ");
    $output .='<br><b>Moderators:</b><br>';
    if (mysql_num_rows($result)) {
       while ($qry = mysql_fetch_array($result)) {
    
    $query2 = mysql_query("SELECT * FROM member WHERE UserName='$qry[UserName]' ")
    or die("Could not insert data because ".mysql_error());
    $qry2 = mysql_fetch_array( $query2 );
    
    $query4 = mysql_query("SELECT * FROM onlineusers WHERE UserName='$qry[UserName]' ")
    or die("Could not insert data because ".mysql_error());
    $qry4 = mysql_fetch_array( $query4 );
    
    $query3 = mysql_query("SELECT * FROM room WHERE RoomID='$qry4[RoomID]' ")
    or die("Could not insert data because ".mysql_error());
    $qry3 = mysql_fetch_array( $query3 );
    
    if (mysql_num_rows($query4) == 0) {
    $status = "Offline";
    }
    else
    {
    $status = "$qry3[RoomName]";
    }
    $output .="<img src=images/icons/moderator.png> $qry[UserName] <a href=member.php?$qry2[MemberID]-$qry2[UserName]>[View Profile]</a> ($status)<br>";
    }
    }
    
    $output .= '</div>';
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what's the code in line 403 and 1 line above it and 1 line below it?

  3. #3
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well this is inserted in a cms and my code only goes up to line 114
    Animated Chatrooms - www.121chatrooms.net

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    No error is showing up on any IE testing currently being performed.

    This is on the link that is provided in the original post, where is shown a vBulletin message saying "You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:"

    And that page asks for the login username and password.

    The page does take some time to complete loading in Internet Explorer though. I'll see if I can post some diagnosis that might help you.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by Mike4x4s View Post
    well this is inserted in a cms and my code only goes up to line 114
    Your web browser has no direct access to your cms. The line 403 error that you see relates to the downloaded code for the page that your web browser has loaded at the time.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Your page still does not error for me, but here's the profile that IE shows me for your page, if this helps at all.
    Found at: Tools -> Developer Tools -> Profiler

    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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