Wow this is so broken and I have no idea why. What I have is a form with multiple checkboxes, each with their own ID. For each box that's checked, a value of 1 is supposed to be added to one of eight...variables? I'm sorry I don't know the exact word. However even if I check nothing and submit the form all eight have values and I can't figure out what I did wrong.
Here's the form. You can click on names to select them, submit to see the broken results.
I'm still a noob with PHP so I'm sure I did something wrong. Any advice would be awesome!
Here's the php:
Here's the form. You can click on names to select them, submit to see the broken results.
I'm still a noob with PHP so I'm sure I did something wrong. Any advice would be awesome!
Here's the php:
PHP Code:
<?php
$innocent = 0;
if ($_POST['anxious'] == 'yes')
$innocent++;
if ($_POST['trusting'] == 'yes')
$innocent++;
if ($_POST['feels_powerless'] == 'yes')
$innocent++;
if ($_POST['fearful'] == 'yes')
$innocent++;
if ($_POST['indecisive'] == 'yes')
$innocent++;
if ($_POST['financially_dependant'] == 'yes')
$innocent++;
if ($_POST['happy_go_lucky'] == 'yes')
$innocent++;
if ($_POST['seeks_security'] == 'yes')
$innocent++;
if ($_POST['non_confrontational'] == 'yes')
$innocent++;
if ($_POST['represses_feelings_and_beliefs'] == 'yes')
$innocent++;
?>
<?php
$victim = 0;
if ($_POST['prone_to_blame'] == 'yes')
$victim++;
if ($_POST['highly_emotional'] == 'yes')
$victim++;
if ($_POST['lives_in_past'] == 'yes')
$victim++;
if ($_POST['financially_irrisponsible'] == 'yes')
$victim++;
if ($_POST['seeks_rescue'] == 'yes')
$victim++;
if ($_POST['feels_powerless'] == 'yes')
$victim++;
if ($_POST['unforgiving'] == 'yes')
$victim++;
if ($_POST['addictive'] == 'yes')
$victim++;
if ($_POST['self_fulfilling_prophecy'] == 'yes')
$victim++;
if ($_POST['long_suffering'] == 'yes')
$victim++;
if ($_POST['passive_aggressive'] == 'yes')
$victim++;
if ($_POST['resentful'] == 'yes')
$victim++;
if ($_POST['fearful'] == 'yes')
$victim++;
?>
<?php
$warrior = 0;
if ($_POST['powerful'] == 'yes')
$warrior++;
if ($_POST['driven'] == 'yes')
$warrior++;
if ($_POST['disciplined'] == 'yes')
$warrior++;
if ($_POST['goal_oriented'] == 'yes')
$warrior++;
if ($_POST['calculating'] == 'yes')
$warrior++;
if ($_POST['rescuer'] == 'yes')
$warrior++;
if ($_POST['generous'] == 'yes')
$warrior++;
if ($_POST['discerning'] == 'yes')
$warrior++;
if ($_POST['wise'] == 'yes')
$warrior++;
if ($_POST['financially_successful'] == 'yes')
$warrior++;
if ($_POST['competitive'] == 'yes')
$warrior++;
if ($_POST['loyal'] == 'yes')
$warrior++;
if ($_POST['cautious'] == 'yes')
$warrior++;
?>
<?php
$martyr = 0;
if ($_POST['feels_betrayed'] == 'yes')
$martyr++;
if ($_POST['highly_critical'] == 'yes')
$martyr++;
if ($_POST['judgemental'] == 'yes')
$martyr++;
if ($_POST['rescuer'] == 'yes')
$martyr++;
if ($_POST['manipulative'] == 'yes')
$martyr++;
if ($_POST['controlling'] == 'yes')
$martyr++;
if ($_POST['long_suffering'] == 'yes')
$martyr++;
if ($_POST['caretaker'] == 'yes')
$martyr++;
if ($_POST['self_sacrificing'] == 'yes')
$martyr++;
if ($_POST['passive_aggressive'] == 'yes')
$martyr++;
if ($_POST['compassionate'] == 'yes')
$martyr++;
if ($_POST['harbors_resentment'] == 'yes')
$martyr++;
?>
<?php
$fool = 0;
if ($_POST['financially_irrisponsible'] == 'yes')
$fool++;
if ($_POST['lives_for_today'] == 'yes')
$fool++;
if ($_POST['happy_go_lucky'] == 'yes')
$fool++;
if ($_POST['restless'] == 'yes')
$fool++;
if ($_POST['undisciplined'] == 'yes')
$fool++;
if ($_POST['impetuous'] == 'yes')
$fool++;
if ($_POST['optimistic'] == 'yes')
$fool++;
if ($_POST['overly_generous'] == 'yes')
$fool++;
if ($_POST['adventurous'] == 'yes')
$fool++;
if ($_POST['lives_for_the_future'] == 'yes')
$fool++;
?>
<?php
$creator_artist = 0;
if ($_POST['internally_motivated'] == 'yes')
$creator_artist++;
if ($_POST['detatched'] == 'yes')
$creator_artist++;
if ($_POST['loner'] == 'yes')
$creator_artist++;
if ($_POST['seeker'] == 'yes')
$creator_artist++;
if ($_POST['tells_the_truth'] == 'yes')
$creator_artist++;
if ($_POST['non_materialistic'] == 'yes')
$creator_artist++;
if ($_POST['passive'] == 'yes')
$creator_artist++;
if ($_POST['non_confrontational'] == 'yes')
$creator_artist++;
if ($_POST['artistic'] == 'yes')
$creator_artist++;
if ($_POST['spiritual'] == 'yes')
$creator_artist++;
?>
<?php
$tyrant = 0;
if ($_POST['unforgiving'] == 'no')
$tyrant++;
if ($_POST['calculating'] == 'yes')
$tyrant++;
if ($_POST['highly_critical'] == 'yes')
$tyrant++;
if ($_POST['aggressive'] == 'yes')
$tyrant++;
if ($_POST['manipulative'] == 'yes')
$tyrant++;
if ($_POST['controlling'] == 'yes')
$tyrant++;
if ($_POST['financially_successful'] == 'yes')
$tyrant++;
if ($_POST['fearful'] == 'yes')
$tyrant++;
if ($_POST['highly_materialistic'] == 'yes')
$tyrant++;
if ($_POST['secretive'] == 'yes')
$tyrant++;
if ($_POST['obsessive_compulsive'] == 'yes')
$tyrant++;
if ($_POST['rigid'] == 'yes')
$tyrant++;
if ($_POST['oppressive'] == 'yes')
$tyrant++;
if ($_POST['prone_to_rage_or_violence'] == 'yes')
$tyrant++;
?>
<?php
$magician = 0;
if ($_POST['trusting'] == 'yes')
$magician++;
if ($_POST['powerful'] == 'yes')
$magician++;
if ($_POST['confident'] == 'yes')
$magician++;
if ($_POST['generous'] == 'yes')
$magician++;
if ($_POST['loving'] == 'yes')
$magician++;
if ($_POST['conscious'] == 'yes')
$magician++;
if ($_POST['open_to_flow'] == 'yes')
$magician++;
if ($_POST['compassionate'] == 'yes')
$magician++;
if ($_POST['wise'] == 'yes')
$magician++;
if ($_POST['optimistic'] == 'yes')
$magician++;
if ($_POST['lives_in_present'] == 'yes')
$magician++;
if ($_POST['detatched'] == 'yes')
$magician++;
if ($_POST['tells_the_truth'] == 'yes')
$magician++;
if ($_POST['financially_balanced'] == 'yes')
$magician++;
if ($_POST['vibrant'] == 'yes')
$magician++;
if ($_POST['transforms_reality'] == 'yes')
$magician++;
if ($_POST['spiritual'] == 'yes')
$magician++;
?>
<html>
<head>
<title>Your Results</title>
</head>
<body>
<h1>Your Results</h1>
<?php
echo '<b>Innocent ' . $innocent . '</b><br><br>';
echo '<b>Victim ' . $victim . '</b><br><br>';
echo '<b>Warrior ' . $warrior . '</b><br><br>';
echo '<b>Martyr ' . $martyr . '</b><br><br>';
echo '<b>Fool ' . $fool . '</b><br><br>';
echo '<b>Creator/Artist ' . $creator_artist . '</b><br><br>';
echo '<b>Tyrant ' . $tyrant . '</b><br><br>';
echo '<b>Magician ' . $magician . '</b><br><br>';
?>
</body>
</html>
Comment