online xam sytem

Discussion in 'PHP' started by gorabhat, Feb 21, 2010.

  1. #1
    hii
    i want 2 create a online xam sytem using php & mysql
    the question r stored in xcel file & by using php & Ajax the question r displayed
    each buttons denotes a question & the value of the button is the question number
    there are 2 forms
    1 for diplaying the questions & another for answering the questions

    <html>
    <head>		
    
    <script type="text/javascript">
    function sendRequest(f1) //displaying the question
    {
    	
    	var url = "test.php?ch="+f1;
    	qtn =  new XMLHttpRequest();
    	qtn.open("GET",url,false);	
    	qtn.send(null);
    	document.getElementById('show').innerHTML= qtn.responseText;
    }
    
    function store(f2) //storing the answer in database
    {
    	
    	var url = "db.php";
    	qtn1 =  new XMLHttpRequest();
    	qtn1.open("GET",url,false);	
    	qtn1.send(null);
    	
    	
    }
    
    
    
    </script>
    </head>
    
    <body>
    
    <form name="frm" method="get">
    <table border=2 allign="left">
    
    <tr>
    <td><input type="button" value="1" name="ch" onClick="sendRequest(this.value)" ></td>
    <td><input type="button" value="2" name="ch" onClick="sendRequest(this.value)"></td>
    </tr>
    <tr>
    <td><input type="button" value="3" name="ch" onClick="sendRequest(this.value)" ></td>
    <td><input type="button" value="4" name="ch" onClick="sendRequest(this.value)" ></td>
    </tr>
    </table>
    </form>
    
    <form name="frm2" method="get">
    <span id="show"></span>
    <input type="submit" value="Submit" onClick="store(this.value)" >
    <input type="reset" value="Reset">
    <input type="submit" value="Skip">
    </form>
    </body>
    </html>
    Code (markup):
    now the basic problem is i cant get the qstn number from 2nd form bcoz the qstn number is in another form

    i know i cant xpress the whole thing
    but i am waiting for some help
    thnks in advance
     
    gorabhat, Feb 21, 2010 IP