how we can match the ans with database ans in online test and score wil be increment if the ans is correct

Recommended Answers

All 4 Replies

You can get the user submitted value by $_POST['value']. Here value refers to the name of the form element. Then compare it with the corresponding database element. If a match is found then increment the count by one.
for ex:
<?php

$value=$_POST['value'];

$query="SELECT answer FROM table_name";//select appropriates filed names in the database
$result=mysql_query($query);
while(mysql_fetch_row($result))
{
if($row['answer']==$value)
{
$count++;
}
}
?>

if you have any knowledge about cyrptography then please use md5 hashing to improve security

Member Avatar for diafol

how we can match the ans with database ans in online test and score wil be increment if the ans is correct

Show your code so far, otherwise we'd just be guessing and spend precious time offering suggestions that do not match your needs.

I have done a similar sort of project. If you need more info please let me know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.