arushibafna-
Could you give the specific code of your html form you are using or something similar so people can better answer you question?
For now I can give you this
If you submit a form you have to set a method. POST, or GET. Also please look at this reference on PHP predefined variables
http://www.php.net/manual/en/reserved.variables.php -
<form action="submitmarks.php" method="post" id="postExample">
-
// whatever your form is
-
<input type="hidden" name="var1" value="first variable" />
-
<input type="hidden" name="var2" value="second variable" />
-
</form>
-
-
//alternatively
-
-
<form action="submitmarks.php" method="get" id="postExample">
-
// notice that the method is now get
-
<input type="hidden" name="var1" value="first variable" />
-
<input type="hidden" name="var2" value="second variable" />
-
</form>
-
Now depending on the method the data extraction process in your submitmarks.php will be slightly different.
I am not including data and data error processing in this example, but it is HIGHLY recommended that you do so.
-
<?php
-
//Now in PHP you have to process the $_GET or $_POST array
-
foreach ($_GET as $key => $value) {
-
// in the example above the $keys would be "var1" and "var2"
-
echo $key." = ".$value; //just prints key a value pair to the screen
-
}
-
-
// OR if you used the POST method then
-
foreach ($_POST as $key => $value) {
-
// in the example above the $keys would be "var1" and "var2"
-
echo $key." = ".$value; //just prints key a value pair to the screen
-
}
-
-
?>
-
As far as inserting data into your database that is another story. You have not posted what database you are using. Since you are using PHP though a lot of PHP goes with the MySQL RDBMS. SQL is another subject on its own but here is a link to the mysqli and pdo database-access abstraction layers to get you started.
http://ca3.php.net/manual/en/book.mysqli.php http://ca3.php.net/manual/en/book.pdo.php