The following script checks to see if the user answer matches the correct answer.
Form Fields are set up the following way...
user_answer[$i] | value = a
user_answer[$i] | value = b
user_answer[$i] | value = c
all radio fields (above)
orgid[$i] | value = $i
answer[$i] | value = (a or b, c)
all hidden fields (above)
$i = question id/number
Basically when question answer isn't selected an undefined offset error message is generated. Adding if empty or isset messes up the order.
Code: foreach ($_POST['orgid'] as $k =>$v) {
$orgid[$k] = $v;
}
$k = 0;
$m = 0;
while ($k <= 19) {
if ($_POST['user_answer'][$k] == $_POST['answer'][$k]) {
$correct++;
unset ($_POST['user_answer'][$k]);
unset ($orgid[$k]);
} else {
$incorrect++;
}
$k++;
}
Any ideas/suggestions?
Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "diary/cal_show.php";?>which looks like this...But when i hit either arrows to move on
void* and sizeof()
Hi,Using void* and sizeof is it possible to get the value of the object ?I understand that dereferencing a void pointer is not directly possible. Is there a way (like casting) or something else to get
URL Rewrite issue
Im created a series of Rewrites and on page checks to make sure the correct url is being called. But now that i am buying in traffic through Adwords the gclid parameter is being dropped and im unable
Inserting 100x and 100y coordinates in mysql table - easy
Is there a way to insert this data into a mysql table named 'map' with the fields: 'x int 3' , 'y int 3' in an easy way with maybe a for loop or something?I want the data entered to be like this:0x
PHP loop
Okay so I have several "articles" stored in a mysql database and am attempting to echo those onto a PHP page.so on index.php I haveCode: <?php article_layout();?> (yes there is
Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyone can veiw them pages. Is there any way in which i can stop them veiwing the page without
Help with forum quoting?
Hi im working on a forum and I have alomost finished it but i want a user quote system like twitter and facebook with the @ sign to start it off, however even though im good at php coding and have
Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:
Gerenate tabel in Php
I whant to generate a tabel takeing data from database like this one so the results to be display on 2 columns<table width="50%" border="0" cellspacing="0"
Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,Im relativity new to PHP and MySQL and i have come up against a problem. i have 2 tables that are linked via foreign key constraints.Code: ---- Table structure for table