I have a set of radio buttons in a group
one returns yes
one returns no
i can read then in to my next for that is no problem but for some reason i am having problems checking to see which one was returned..
$brochure = $_POST['brochure'];
reads in the value
I have tried using an if statement to see if it is yes but noting seems to work
i have tried
$ bro = "yes";
if ($brochure == $bro)
{ etc
and
if ($brochure == 'yes')
{ etc
what is the correct syntax for comparing strings to see is they are the same I acn find syntax for loads of others but this must be too simple for the book!!!!
please help if i bang my head anymore i will have to replaster again....
really easy question but baffling me
Moderator: General Moderators
-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
Code: Select all
<?php
echo '<pre>';
print_r($_POST);
echo '</pre>';
?>-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
- Bill H
- DevNet Resident
- Posts: 1136
- Joined: Sat Jun 01, 2002 10:16 am
- Location: San Diego CA
- Contact:
The first sentence in my post: strcmp();
Code: Select all
$int = strcmp($string1,$string2); // check the manual-
nutstretch
- Forum Contributor
- Posts: 104
- Joined: Sun Jan 11, 2004 11:46 am
- Location: Leicester
Code: Select all
<?php
$value['one'] == 'chicken';
$value['two'] == 'chicken';
$value['three'] == 'turkey';
if($value['one'] == $value['two'])
{
echo "The values are equal to eachother";
}
else
{
echo "The values are not equal.":
}
if($value['one'] == $value['three'])
{
echo "The values are not equal to eachother";
}
else
{
echo "The values are equal to eachother";
}
?>