View previous topic :: View next topic |
Author |
Message |
thephoneguy Grandmaster Cheater
Reputation: 1
Joined: 17 Mar 2007 Posts: 873
|
Posted: Sat May 24, 2008 11:49 pm Post subject: YAY I GOT IT WORKING |
|
|
ok got it all working credits to wicaaan if anyone need this for there site heres the code
Code: |
<?php
$qid = "Quiz ID-00";
?>
<html>
<head>
<title><? echo "cheatengine hehe $qid"; ?></title>
<style type="text/css">
.style2
{
width: 275px;
}
.style3
{
width: 485px;
}
.style8
{
width: 176px;
}
</style>
</head>
<body>
<h3><? echo "cheatengine fuh :p $qid"; ?></h3>
<form action="results.php" method="post">
<p>
Rate on a Scale of 1-5 how each of these questions make you feel.</p>
<p>
Your Name: <input type="text" name="name"></p>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Questions or little tidbit of words here</td>
<td>
1 2
3 4
5
</td>
</tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="01" name="Q1" type="radio" value="1" />
<input id="02" name="Q1" type="radio" value="2" />
<input id="03" name="Q1" type="radio" value="3" />
<input id="04" name="Q1" type="radio" value="4" />
<input id="05" name="Q1" type="radio" value="5" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Question</td>
<td>
<input id="1" name="Q2" type="radio" value="1" />
<input id="2" name="Q2" type="radio" value="2" />
<input id="3" name="Q2" type="radio" value="3" />
<input id="4" name="Q2" type="radio" value="4" />
<input id="5" name="Q2" type="radio" value="5" />
</td>
</tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="6" name="Q3" type="radio" value="1" />
<input id="7" name="Q3" type="radio" value="2" />
<input id="8" name="Q3" type="radio" value="3" />
<input id="9" name="Q3" type="radio" value="4" />
<input id="10" name="Q3" type="radio" value="5" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio11" name="Q4" type="radio" value="1" />
<input id="Radio12" name="Q4" type="radio" value="2" />
<input id="Radio13" name="Q4" type="radio" value="3" />
<input id="Radio14" name="Q4" type="radio" value="4" />
<input id="Radio15" name="Q4" type="radio" value="5" />
</td> </tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio16" name="Q5" type="radio" value="1" />
<input id="Radio17" name="Q5" type="radio" value="2" />
<input id="Radio18" name="Q5" type="radio" value="3" />
<input id="Radio19" name="Q5" type="radio" value="4" />
<input id="Radio20" name="Q5" type="radio" value="5" />
</td>
</tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio21" name="Q6" type="radio" value="1" />
<input id="Radio22" name="Q6" type="radio" value="2" />
<input id="Radio23" name="Q6" type="radio" value="3" />
<input id="Radio24" name="Q6" type="radio" value="4" />
<input id="Radio25" name="Q6" type="radio" value="5" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio26" name="Q7" type="radio" value="1" />
<input id="Radio27" name="Q7" type="radio" value="2" />
<input id="Radio28" name="Q7" type="radio" value="3" />
<input id="Radio29" name="Q7" type="radio" value="4" />
<input id="Radio30" name="Q7" type="radio" value="5" />
</td> </tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio31" name="Q8" type="radio" value="1" />
<input id="Radio32" name="Q8" type="radio" value="2" />
<input id="Radio33" name="Q8" type="radio" value="3" />
<input id="Radio34" name="Q8" type="radio" value="4" />
<input id="Radio35" name="Q8" type="radio" value="5" />
</td>
</tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio36" name="Q9" type="radio" value="1" />
<input id="Radio37" name="Q9" type="radio" value="2" />
<input id="Radio38" name="Q9" type="radio" value="3" />
<input id="Radio39" name="Q9" type="radio" value="4" />
<input id="Radio40" name="Q9" type="radio" value="5" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio41" name="Q10" type="radio" value="1" />
<input id="Radio42" name="Q10" type="radio" value="2" />
<input id="Radio43" name="Q10" type="radio" value="3" />
<input id="Radio44" name="Q10" type="radio" value="4" />
<input id="Radio45" name="Q10" type="radio" value="5" />
</td> </tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio46" name="Q11" type="radio" value="1" />
<input id="Radio47" name="Q11" type="radio" value="2" />
<input id="Radio48" name="Q11" type="radio" value="3" />
<input id="Radio49" name="Q11" type="radio" value="4" />
<input id="Radio50" name="Q11" type="radio" value="5" />
</td>
</tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio51" name="Q12" type="radio" value="1" />
<input id="Radio52" name="Q12" type="radio" value="2" />
<input id="Radio53" name="Q12" type="radio" value="3" />
<input id="Radio54" name="Q12" type="radio" value="4" />
<input id="Radio55" name="Q12" type="radio" value="5" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio56" name="Q13" type="radio" value="1" />
<input id="Radio57" name="Q13" type="radio" value="2" />
<input id="Radio58" name="Q13" type="radio" value="3" />
<input id="Radio59" name="Q13" type="radio" value="4" />
<input id="Radio60" name="Q13" type="radio" value="5" />
</td> </tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio61" name="Q14" type="radio" value="1" />
<input id="Radio62" name="Q14" type="radio" value="2" />
<input id="Radio63" name="Q14" type="radio" value="3" />
<input id="Radio64" name="Q14" type="radio" value="4" />
<input id="Radio65" name="Q14" type="radio" value="5" />
</td>
</tr>
<tr>
<td class="style8">
Question</td>
<td>
<input id="Radio66" name="Q15" type="radio" value="1" />
<input id="Radio67" name="Q15" type="radio" value="2" />
<input id="Radio68" name="Q15" type="radio" value="3" />
<input id="Radio69" name="Q15" type="radio" value="4" />
<input id="Radio70" name="Q15" type="radio" value="5" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" class="style3">
<tr>
<td class="style8">
Question</td>
<td class="style2">
<input id="Radio71" name="Q16" type="radio" value="1" />
<input id="Radio72" name="Q16" type="radio" value="2" />
<input id="Radio73" name="Q16" type="radio" value="3" />
<input id="Radio74" name="Q16" type="radio" value="4" />
<input id="Radio75" name="Q16" type="radio" value="5" />
</td> </tr>
<tr>
<td class="style8">
Question</td>
<td class="style2">
<input id="Radio76" name="Q17" type="radio" value="1" />
<input id="Radio77" name="Q17" type="radio" value="2" />
<input id="Radio78" name="Q17" type="radio" value="3" />
<input id="Radio79" name="Q17" type="radio" value="4" />
<input id="Radio80" name="Q17" type="radio" value="5" />
</td>
<td>
</td>
</tr>
</tr>
<tr>
<td class="style8">
Question</td>
<td class="style2">
<input id="Radio81" name="Q18" type="radio" value="1" />
<input id="Radio82" name="Q18" type="radio" value="2" />
<input id="Radio83" name="Q18" type="radio" value="3" />
<input id="Radio84" name="Q18" type="radio" value="4" />
<input id="Radio85" name="Q18" type="radio" value="5" />
</td>
<td>
</td>
</tr>
</tr>
<tr>
<td class="style8">
Question</td>
<td class="style2">
<input id="Radio86" name="Q19" type="radio" value="1" />
<input id="Radio87" name="Q19" type="radio" value="2" />
<input id="Radio88" name="Q19" type="radio" value="3" />
<input id="Radio89" name="Q19" type="radio" value="4" />
<input id="Radio90" name="Q19" type="radio" value="5" />
</td>
<td>
</td>
</tr>
</tr>
<tr>
<td class="style8">
Question</td>
<td class="style2">
<input id="Radio91" name="Q20" type="radio" value="1" />
<input id="Radio92" name="Q20" type="radio" value="2" />
<input id="Radio93" name="Q20" type="radio" value="3" />
<input id="Radio94" name="Q20" type="radio" value="4" />
<input id="Radio95" name="Q20" type="radio" value="5" />
</td>
<td>
</td>
</tr>
</table>
<p><input type="submit" name="submit" value="Submit Quiz"></p>
<input type="hidden" name="qp" value="quiz00.php">
</form>
</body>
</html>
|
and the php side that keeps bitching at me for no real reason that i can see i havent even started to put in the operators yet. this is just a simple eot( echo on crack )
and it keeps giving me blank page HELP PLZ
im sure its something dumb
Code: | <?php
function DisplayQuizResults()
{
// Determine That The User Has Come To This Page From
// A Proper Quiz Page
if( !isset( $_POST[ 'submit' ] ) )
{
// Invalid Access
die( "Sorry, direct access to this file is not permitted.\n" );
}
// Obtain Username
if( isset( $_POST[ 'name' ] ) && $_POST[ 'name' ] != "" )
{
$name = $_POST[ 'name' ];
}
else
{
die( "You forgot to fill in your name.\n" );
}
// Obtain Quiz Answers
$q = array();
$total = 0;
for( $x = 1; $x<20; $x++ )
{
if( isset( $_POST[ 'Q'.$x ] ) )
{
$q[$x] = $_POST[ 'Q'.$x ];
$total += $q[$x];
}
else
{
die( "You forgot to fill in answer: ". $x . "\n" );
}
}
// Display Results
echo( "<p>Hello: " . $name . "<br><br><br>\n" );
if( $total < 21)
{
echo ('im a little teapot'."<br><br><br><br><br>");
}
else if($total < 41)
{
echo ('im a medium teapot'."<br><br><br><br><br>");
}
else if($total < 61)
{
echo ('im a large teapot'."<br><br><br><br><br>");
}
else if($total <= 80 )
{
echo ('im a fat teapot'."<br><br><br><br><br>");
}
else
{
echo ('im a jenny craig teapot'."<br><br><br><br>");
}
}
?>
<HTML>
<HEAD>
<TITLE> Quiz Results </TITLE>
</HEAD>
<BODY>
<? DisplayQuizResults(); ?>
</BODY>
</HTML> |
Please dont flame i know its shit but its my first crack at php so give me a break  _________________
If you see me posting referring to an earlier conversation 9/10 times it was in the chatbox at baby .

Last edited by thephoneguy on Mon May 26, 2008 1:41 am; edited 1 time in total |
|
Back to top |
|
 |
STN I post too much
Reputation: 43
Joined: 09 Nov 2005 Posts: 2676
|
Posted: Sun May 25, 2008 3:35 am Post subject: |
|
|
err...nvm. Wicc posted a better solution. _________________
Last edited by STN on Sun May 25, 2008 6:06 am; edited 2 times in total |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun May 25, 2008 3:35 am Post subject: |
|
|
Instead of typing out all that stuff to check things, you can use an array and for loops instead to make things easier. I rewrote the backend part (Results.php) using them for an example here:
Code: | <?php
function DisplayQuizResults()
{
// Determine That The User Has Come To This Page From
// A Proper Quiz Page
if( !isset( $_POST[ 'submit' ] ) )
{
// Invalid Access
die( "Sorry, direct access to this file is not permitted.\n" );
}
// Obtain Username
if( isset( $_POST[ 'name' ] ) && $_POST[ 'name' ] != "" )
{
$name = $_POST[ 'name' ];
}
else
{
die( "You forgot to fill in your name.\n" );
}
// Obtain Quiz Answers
$q = array();
for( $x = 1; $x<21; $x++ )
{
if( isset( $_POST[ 'Q'.$x ] ) )
{
$q[$x] = $_POST[ 'Q'.$x ];
}
else
{
die( "You forgot to fill in answer: ". $x . "\n" );
}
}
// Display Results
echo( "<p>Results: " . $name . "<br><br>\n" );
for( $x=1; $x<21; $x++ )
{
echo( $x . ".) " . $q[$x] . "<br>\n" );
}
echo( "</p>\n" );
}
?>
<HTML>
<HEAD>
<TITLE> Quiz Results </TITLE>
</HEAD>
<BODY>
<? DisplayQuizResults(); ?>
</BODY>
</HTML> |
Hope it helps.
EDIT: Whoops had a little mistake in there, fixed. _________________
- Retired. |
|
Back to top |
|
 |
thephoneguy Grandmaster Cheater
Reputation: 1
Joined: 17 Mar 2007 Posts: 873
|
Posted: Sun May 25, 2008 5:37 am Post subject: |
|
|
Wow thanks both of you guys i had actually been rewriting the whole thing again lol guess now i dont have to . o well i need some practice.
Edit:
code works great..... now i just have to figure out how to do this
Code: |
if ($q1+$q2+$q3 == (>= 0) && (<= 20))
echo('you are here');
if ($q1+$q2+$q3 == (>= 21) && (<= 40))
echo ('here it is ahahahahahahaha');
if ($q1+$q2+$q3 == (>= 41) && (<= 60))
echo ('you are there');
if ($q1+$q2+$q3 == (>= 61) && (<= 80))
echo ('now ive got it');
if ($q1+$q2+$q3 == (>= 81) && (<= 100))
echo ('hehe');
else
echo ('Please Try Again') |
But obviously all the questions
that is my formula i just cant seem to get it right but i will
btw echoing out what choices you picked was just to make sure code was working properly now i get to have fun with the hard part .
basically i need it to grab the values ie. integers and just add them up. _________________
If you see me posting referring to an earlier conversation 9/10 times it was in the chatbox at baby .
 |
|
Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Sun May 25, 2008 7:21 am Post subject: |
|
|
You are complicated. =]
Just use this!
Code: |
if ($q1+$q2+$q3 >= 0 && $q1+$q2+$q3 <= 20)
echo('you are here');
if ($q1+$q2+$q3 >= 21 && $q1+$q2+$q3 <= 40)
echo ('here it is ahahahahahahaha');
if ($q1+$q2+$q3 >= 41 && $q1+$q2+$q3 <= 60)
echo ('you are there');
if ($q1+$q2+$q3 =>61 && $q1+$q2+$q3<= 80)
echo ('now ive got it');
if ($q1+$q2+$q3 =>= 81 && $q1+$q2+$q3<= 100)
echo ('hehe');
else
echo ('Please Try Again')
|
You cant just do
Code: |
if($q1+$q2+$q3 =>21 && <= 30)...
|
You need to define the && <=30 by doing
Code: |
if($q1+$q2+$q3 =>21 && $q1+$q2+$q3<= 30)
|
Or whatever your number may be.
Also, there is no need to use
Just use
Code: |
>= (Greater than or equal to)
<= (Less than or equal to)
|
_________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
Back to top |
|
 |
thephoneguy Grandmaster Cheater
Reputation: 1
Joined: 17 Mar 2007 Posts: 873
|
Posted: Mon May 26, 2008 12:51 am Post subject: |
|
|
Code: | <?php
function DisplayQuizResults()
{
// Determine That The User Has Come To This Page From
// A Proper Quiz Page
if( !isset( $_POST[ 'submit' ] ) )
{
// Invalid Access
die( "Sorry, direct access to this file is not permitted.\n" );
}
// Obtain Username
if( isset( $_POST[ 'name' ] ) && $_POST[ 'name' ] != "" )
{
$name = $_POST[ 'name' ];
}
else
{
die( "You forgot to fill in your name.\n" );
}
// Obtain Quiz Answers
$q = array();
for( $x = 1; $x<20; $x++ )
{
if( isset( $_POST[ 'Q'.$x ] ) )
{
$q[$x] = $_POST[ 'Q'.$x ];
}
else
{
die( "You forgot to fill in answer: ". $x . "\n" );
}
}
// Display Results
echo( "<p>Hello: " . $name . "<br><br><br>\n" );
if( ($q[$x=1] + $q[$x]<21) >= 0 && ($q[$x=1] + $q[$x]<21) <= 20 );
{
echo ('im a little teapot'."<br><br><br><br><br>");
}
if( ($q[$x=1] + $q[$x]<21) >= 21 && ($q[$x=1] + $q[$x]<21) <= 40 );
{
echo ('im a medium teapot'."<br><br><br><br><br>");
}
if( ($q[$x=1] + $q[$x]<21) >= 41 && ($q[$x=1] + $q[$x]<21) <= 60 );
{
echo ('im a large teapot'."<br><br><br><br><br>");
}
if( ($q[$x=1] + $q[$x]<21) >= 61 && ($q[$x=1] + $q[$x]<21) <= 80 );
{
echo ('im a fat teapot'."<br><br><br><br><br>");
}
if( ($q[$x=1] + $q[$x]<21) >= 81 && ($q[$x=1] + $q[$x]<21) <= 100 );
{
echo ('im a jenny craig teapot'."<br><br><br><br>");
}
}
?>
<HTML>
<HEAD>
<TITLE> Quiz Results </TITLE>
</HEAD>
<BODY>
<? DisplayQuizResults(); ?>
</BODY>
</HTML> |
ok now this is spitting out all my answers where do i keep goin wrong? it isnt calculating the values i think why not? _________________
If you see me posting referring to an earlier conversation 9/10 times it was in the chatbox at baby .
 |
|
Back to top |
|
 |
|