1. This website uses cookies. By continuing to use this website you are giving consent to cookies being used.
    For information on cookies and how you can disable them visit our Cookie Usage page.
    Dismiss Notice

PHP Help Please

Discussion in 'Web Development' started by onekoolman, Jul 14, 2005.

  1. onekoolman

    onekoolman New Member

    I need to create a one question trivia that will fit in a specific amount of (width) space, the hieght is automatically resized, view what I mean here

    http://www.victoryinhim.com

    its on the right hand side. I need to create the trivia more interactive then I just being a popup, I want it to be with a real submit button that changes the text and says in that box if you are correct or incorrect, is there a way to do this?, and if there is how do I do it? I can use php and cgi...

    I cannot use asp, asp.NET, coldfusion, or any others, because I am

    unix/liniux

    hosted.
     
  2. Mimoun

    Mimoun Administrator Staff Member Director Verified Member

  3. onekoolman

    onekoolman New Member

    Thanks that help a lot but there is still a problem... I cant use it right because I only want 1 question and Javascript is hard for me to understand, but php isnt...

    It says (Incorrect!) three times if you get the question wrong here is the code below, do you have any idea how to fix it?

     
  4. Mimoun

    Mimoun Administrator Staff Member Director Verified Member

    You get the message 3 times because you have 3 if's for an incorrect answer.
    Remove 2 if's like this:
    Code:
    			 				<!--START HERE-->
     <form>
     <b>1. Which of the following is not a biblical nationality?</b><BR>
     
      <INPUT TYPE="radio" NAME="question1" VALUE="" onClick="oneX()">
     Canaanite<BR>
      <INPUT TYPE="radio" NAME="question1" VALUE="" onClick="oneX()">
     Perizzite<BR>
      <INPUT TYPE="radio" NAME="question1" VALUE="" onClick="oneX()">
     Jebusite<BR>
      <INPUT TYPE="radio" NAME="question1" VALUE="" onClick="one()">
     Woolite<BR>
     
     <BR>
     
     
      
     <p> 
             <input type="button" name="Submit" value="Submit" onclick="compute(form)">
             <input type="reset" name="clear"  value="Reset" ></form>
             <SCRIPT LANGUAGE="JavaScript">
     
     var a = 0
     var b = 0
     var c = 0
     var d = 0
     var e = 0
     tot = 0
     
     function one()  { 
     	a=1
     	}
     
     function two()  {
     	b=1
     	}
     
     function three()  { 
     	c=1
     	}
     
     function four()  { 
     	d=1
     	}
     
     function five()  { 
     	e=1
     	}
     
     function oneX() {
     	a=0
     	}
     
     function twoX() {
     	b=0
     	}
     
     function threeX() {
     	c=0
     	}
     
     function fourX() {
     	d=0
     	}
     
     function fiveX() {
     	e=0
     	}
     
     
     function compute(form) {
     	tot = (a + b + c + d + e )
     
     	if (tot == 0)
     	{alert("Incorrect!")}
     
     	 if (tot == 1)
     	{alert("Correct!")}
     }
     
     //-->
     </script>
    
     
  5. onekoolman

    onekoolman New Member

    Thanks for your help you have great service.