Jump to content

brunobliss

New Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

brunobliss's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have tried this in every way i can think of, there's a multidimensional array with 3 sets of data, each set has both a question and the corresponding awswer, i want to validate the user's answer to each question. The problem is, when i press the submit button, the user is actually submiting the answer to the next question, which cannot be shown until the submit is pressed! This can be verified by entering an expected value like "2" and wait for the next question to be 1+1= <?php $question = array( 0 => array( 'question' => "1+1=", 'answer' => 2 ), 1 => array( 'question' => "2+1=", 'answer' => 3 ), 2 => array( 'question' => "4+1=", 'answer' => 5 ) ); $arrayIndex = array_rand($question); $q = $question[$arrayIndex]['question']; $a = $question[$arrayIndex]['answer']; if (isset($_POST['submit'])) { if($_POST['answer'] == $a) { echo "correct"; } else { echo "incorrect"; } } else { echo "Answer this:"; } print $a; print (" <form method='post'><br/> <input type='text name='". $a ."' value='". $q ."'> <input type='text' name='answer'><br/> <input type='submit' name='submit'><br/> </form> "); ?>
  2. i didn't quite get this last part, what do you mean? that page is a bunch of php's put together, included in each other
  3. thank you guys for the replies i'm definitely going to try your suggestions. I got my site up and running yesterday, the search feature is not a priority since a simple CTRL+F would solve any major problems, but still, for those who didn't understand what i need, just take a look: http://recordsbay.pt.vu It would be cool to have a search engine that would display the results of words written in the *_contents.php files, let me explain the way i done this, when you click A-B-C link on the menu it directs you to abc.php which includes abc_contents.php which is a list of things i'm selling therefore updating constantly, thus the need of a search engine that will search the *_contents.php for keywords. I'm aware that a shopping cart wold be easier and that also the way i built this may not work properly with a search engine, but this comes totally out of personal interest and wanting to learn a little bit more on the language and syntax.
  4. Hey guys, i'm developing a basic website which consists in a 9 button menu, each button calls a php which will include the menu on top, this is the code: <html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <p align="center"> <img border="0" src="recordsbaylogo_lo.png" width="258" height="87"></p> <table border="0" align="center" width="80%"> <tr> <td align="center"><font face="Calibri"><a href="abc.php">A-B-C</a></font></td> <td align="center"><font face="Calibri"><a href="def.php">D-E-F</a></font></td> <td align="center"><font face="Calibri"><a href="ghi.php">G-H-I</a></font></td> <td align="center"><font face="Calibri"><a href="jkl.php">J-K-L</a></font></td> <td align="center"><font face="Calibri"><a href="mno.php">M-N-O</a></font></td> <td align="center"><font face="Calibri"><a href="pqr.php">P-Q-R</a></font></td> <td align="center"><font face="Calibri"><a href="stu.php">S-T-U</a></font></td> <td align="center"><font face="Calibri"><a href="vwx.php">V-W-X</a></font></td> <td align="center"><font face="Calibri"><a href="yz0.php">Y-Z-0</a></font></td> </tr> </table> </body> </html> what i need now is some search engine that will browse keywords through the alphabetic php's. Should be easy no?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.