Saturday 18 February 2012

How to upload results on a blog with javascript


Generally server side programming is used to upload results of institutes because it requires access into the database. Most of the educational institutes have their PHP supported sites on which they upload the results. And yes PHP supported web plans are not available for free you have to purchase it. And even if you find one you must know PHP to upload results.

But now consider that you are running a small institute like tuitions and you don’t have your website and you want to put results of your students online.

To upload results online here I am using JavaScript. This method does not require server side programming. For this you must have a blog because blogging is very easy to use even for those who do not know HTML, JAVASCRIPT, and CSS etc. So here I am using “blogger.com” and my blog is “pandyaelectronics.blogspot.com”. Steps are as follow:

1) Go to blogger.com and create your blog using your Google account. Follow instructions.

2) Now go to new post you will find a screen like this.

 
3) click on “edit HTML”. in this window you can use HTML ,JAVASCRIPT, and CSS.

4) now copy past following JavaScript code .and click on “publish post”. Now you are able to see the results.

Code:

<script type="text/javascript">
function know(n1,n2)
{

var num1=parseFloat(n1);
var num2=parseFloat(n2);
var str= n1;
var last=str.charAt(str.length-1);

if(n2=="" && n1=="")
{
alert("please give either seat number or enrollment number");
return false;
}

else if(n1=="" && n2!="")
{
alert("please try your enrollment number");
return false;
}

else if(last==1)
{
var mark=["AB","BB","AA","BC","BB","BB"];
}

else if(last==2)
{
var mark=["AA","AA","AA","AA","AA","AA"];
}

else if(last==3)
{
var mark=["BB","AA","BB","BB","BC","AB"];
}

else if(last==4)
{
var mark=["BC","BC","BB","AB","AA","AB"];
}

else if(last==5)
{
var mark=["AA","BB","AB","BB","AB","BC"];
}

else if(last==6)
{
var mark=["AB","BC","BC","AA","AB","BB"];
}

else if(last==7)
{
var mark=["BC","AA","AA","AB","BB","BC"];
}

else if(last==8)
{
var mark=["BB","AA","AB","AB","BB","BC"];
}

else if(last==9)
{
var mark=["AA","AB","BB","BB","BB","BC"];
}

else if(last==0)
{
var mark=["BB","AA","AA","BB","BC","BC"];
}


document.write("<center><h2><font color=red>EXAM B.E. SEM-5(DEC-2011)</font></h2></center>")
document.write("</br>")
document.write("<center>")
document.write("<table cellspacing=0 cellpading=0 border=1>")
document.write("<tr bgcolor=>")
document.write("<td><h3 >NAME OF STUDENT      </h3></td>")
document.write("<td ><h3><center>")
document.write("LOADING . . . ")
document.write("</center></h3></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td width=200pt >BRANCH      </td>")
document.write("<td> <center>ELECTRONICS & COMMUNICATION</center></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td >ENROLMENT NO   </td>")
document.write("<td><center>")
document.write(num1)
document.write("</center><td>")
document.write("</tr>")

document.write("</table>")
document.write("</br>")

document.write("<table cellspacing=0 cellpading=0 border=1>")
document.write("<tr bgcolor=#DDDDE6>")
document.write("<td width=100pt><center> SUBJECT CODE   </center>      </td>")
document.write("<td width=400pt><center> SUBJECT </center>             </h3></td>")
document.write("<td wigth=50pt> COURSE<br>CREADIT    </td>")
document.write("<td width=50pt> MARKS            </td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td><h4><center> 151003  </center>      </h4></td>")
document.write("<td><h4><center>Integrated Circuits and Applications   </center>      </h4></td>")
document.write("<td><h4><center>06   </center>      </h4></td>")
document.write("<td><h4><center>")
document.write(mark[0])
document.write("</center></h4></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td><h4><center> 150001 </center>      </h4></td>")
document.write("<td><h4><center>Management-II   </center>      </h4></td>")
document.write("<td><h4><center>02   </center>      </h4></td>")
document.write("<td><h4><center>")
document.write(mark[1])
document.write("</center></h4></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td><h4><center> 151001 </center>      </h4></td>")
document.write("<td><h4><center>Microcontroller and Interfacing </center>      </h4></td>")
document.write("<td><h4><center>05   </center>      </h4></td>")
document.write("<td><h4><center>")
document.write(mark[2])
document.write("</center></h4></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td><h4><center> 151002 </center>      </h4></td>")
document.write("<td><h4><center> Engineering Electromagnetics</center>      </h4></td>")
document.write("<td><h4><center>03   </center>      </h4></td>")
document.write("<td><h4><center>")
document.write(mark[3])
document.write("</center></h4></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td><h4><center> 151004 </center>      </h4></td>")
document.write("<td><h4><center>  Electronic Communication</center>      </h4></td>")
document.write("<td><h4><center>06   </center>      </h4></td>")
document.write("<td><h4><center>")
document.write(mark[4])
document.write("</center></h4></td>")
document.write("</tr>")

document.write("<tr>")
document.write("<td><h4><center>150906  </center>      </h4></td>")
document.write("<td><h4><center>  Electric power utilization & traction</center>      </h4></td>")
document.write("<td><h4><center>06   </center>      </h4></td>")
document.write("<td><h4><center>")
document.write(mark[5])
document.write("</center></h4></td>")
document.write("</tr>")
document.write("</table>")
document.write("<br>")

document.write("<table cellspacing=0 cellpading=0 border=1>")
document.write("<tr>")
document.write("<td width=100pt bgcolor=#DDDDE6><h4><center>SPI  </center></h4></td>")
document.write("<td width=100pt><h4><center> 10</center>      </h4></td>")
document.write("<td width=100pt bgcolor=#DDDDE6><h4><center>CPI</center>      </h4></td>")
document.write("<td width=100pt><h4><center>10</center>      </h4></td>")
document.write("</tr>")
document.write("</table>")

document.write("</center>")

document.write("<center><h1><font color=green>congratulation!! you have passed this exam.</font></h1></center>")

document.write("<br>")

document.write("<font color=red font-size=+2><center><a href=http://www.facebook.com/pages/PandyaElectronics/153508891431816><b>Disclaimer:</b>This is just for enjoyment purpose and have no concern with any university or college.If you like This please join us on facebook</br><h2>Pandya Electronics</h2></a></font> ")

return true

}

</script>


<body BGCOLOR="">
<form name="frm" method="post" >
<br><br><br><br>
<center><h2><font color=green>EXAM B.E. SEM-5(DEC-2011)</font></h2></center><br>
<center><h3><FONT COLOR="BLUE">ENTER YOUR ENROLLMENT NUMBER:</h3></FONT></center><br>
<center><input type="text" name="no1"  size="15" maxlength="12"></center><br>
<center><h3><FONT COLOR="BLUE">OR SEAT NUMBER:</FONT></h3></center><br>
<center><input type="text" name="no2"  size="15" maxlength="9"></center><br>
<center><input type="button" name="go" value="SELECT" onClick="know(no1.value,no2.value)"></center>
<br>
<br>

<center><h3><font color=green>Fill any detail and then click "select"</font></h3></center><br>
</form>
</body>


 5)this will give you a look like this.Enter number and get results.



 

6)By modifing this code you can get code that  fulfill your requirnment.


Test this code here:






No comments:

Post a Comment