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 to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    request not inialized error is occured can any body help me please

    THIS IS MY HTML FILE
    can some one help me please
    <?PHP
    extract( $_POST );
    ?>
    <!------------------------------------------------------------------------------------------*
    THE WELCOME PAGE
    *------------------------------------------------------------------------------------------->
    <html>
    <head>
    <title> CLC-City of London College </title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript">
    /*===========================CHANGE THE COLOR OF TEXT ON MOUSE OVER========================*/

    function changefontcolor(ref, fontcolor){
    ref.style.color=fontcolor;
    }
    /*==========================CHANGE THE COLOR OF TEXT ON MOUSE CLICK========================*/
    function changecoloronclick(fontcolor){
    document.fgColor = fontcolor;
    }
    /*=========================================================================================*/
    /////////////////////////////////////////////////////////////////////
    function showStudent()
    {
    xmlHttp=GetXmlHttpObject()
    alert("you are in the show student function")
    if (xmlHttp==null)
    {
    alert ("Browser does not support HTTP Request")
    return
    }
    var a = "122013";
    var url="myprofile.php"
    url=url+"?q="+a
    url=url+"&sid="
    alert("you are near to exit")
    xmlHttp.onreadystatechange=stateChanged()
    xmlHttp.open("GET",url,true)
    xmlHttp.send(null)
    }
    /////////////////////////////////////////////////////////////////////
    function stateChanged()
    {
    alert("you are in the state change function")
    if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
    {
    alert("you are in if condition")
    document.getElementById("txtHint").innerHTML=xmlHttp.responseText

    }
    else if (xmlHttp.readyState == 1 )
    {
    alert("your request has been setup");
    }
    else if (xmlHttp.readyState == 2 )
    {
    alert("your request has been send");
    }
    else if (xmlHttp.readyState == 3 )
    {
    alert("your request is in progress ");
    }
    else if (xmlHttp.readyState == 0 )
    {
    document.getElementById("txtHint").innerHTML=xmlHttp.responseText

    alert("your request has not been initialized");
    }
    }
    /////////////////////////////////////////////////////////////////////
    function GetXmlHttpObject()
    {
    var xmlHttp=null;
    try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
    catch(e)
    {
    //Internet Explorer
    try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    }
    return xmlHttp;
    }
    /////////////////////////////////////////////////////////////////////
    </script>
    </head>
    <body>
    <div id="page">
    <div id = "head">
    <table class = table1>
    <tr>
    <td align = "center">
    <img src="Image/logo.gif" alt="logo"></img>
    </td>
    </tr>
    </table>
    </div>
    <div id = "left">
    <b>
    </br>
    <a onmouseover= "changefontcolor(this, 'blue')" onmouseout="this.style.color='black'" href="javascript:void(0)" onclick="showStudent()" id = dec>
    &nbsp My Profile</a>
    <hr color= #FFFFFF size = 10 width =100% >
    <a onmouseover= "changefontcolor(this, 'blue')" onmouseout="this.style.color='black'" href="javascript:void(0)" id = dec>
    &nbsp Download Past Papers</a>
    <hr color= #FFFFFF size = 10 width = 100% >
    <a onmouseover= "changefontcolor(this, 'blue')" onmouseout="this.style.color='black'" href="javascript:void(0)" id = dec>
    &nbsp Lecture Material</a>
    <hr color= #FFFFFF size = 10 width = 100% >
    </b>
    </div>
    <div id = "middle">
    <p><div id="txtHint"><b>User info will be listed here.</b></div></p>
    </div>
    </div>
    </body>
    </html>


    This is my PHP File

    <?PHP
    echo "You are here";
    $q =$_GET["q"];
    $username="";
    $password="";
    $database="college";
    $con = mysql_connect(localhost,$username,$password);
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
    @mysql_select_db($database, $con);
    $query = "Select * from students";
    $result = mysql_query($query);
    $num = mysql_numrows($result);
    $fname = mysql_result($result,0,"STUDENT_FIRST_NAME");
    echo "$fname";
    mysql_close($con);
    ?>

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    It would help if you actually used colors that people could read. light orange on white is bad. LIme on white is bad. Stick with classic black on white.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

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