Question about passing vars to a form
Posted: Fri Feb 10, 2006 4:59 pm
I have made a form,that i would like to pass 4 vars to another form that will take the values and input them into a database. I had done this once sometime after reading a tutorial,but now it does not seem to be working.i hav also checked to make sure that the action page is getting the correct names from the forms.
in the form,i hav 4 variables,if u need me to post this,i can.
name,id,course,grade
this is my php page so far:
can any1 tell me what i am doin wrong?
in the form,i hav 4 variables,if u need me to post this,i can.
name,id,course,grade
this is my php page so far:
Code: Select all
//gets all the vars to us
$name = $_REQUEST['name'];
$id = $_REQUEST['id'];
$course = $_REQUEST['course'];
$grade = $_REQUEST['grade'];
$sql = 'INSERT INTO `teacher` (`Name`, `Course_id`, `Course_name`, `Grade`) VALUES ('$name', '$id', '$course', '$grade')';
include "../include/teachers.inc";//includes my db connections
//puts everything into the DB
$result = mysql_query ($sql) or die('Query failed: ' . mysql_error());
$affect = mysql_affected_rows();*/
//when i tried to echo the vars,nothing came up,this is wat i tried
print "$name";
echo ($id);
echo ($course);
echo ($grade);