[Resolved] PHP If Statement Help
Hello, and thank you for such a wonderful plugin!
I have successfully used some if statements to pull information and display an image depending on the users selection, but need help with the last one.
First, this is one of the examples of a field I am pulling..
<?php $platform = xprofile_get_field_data( 'What platform do you play on the most?', $member_id ); if ( $platform == 'Playstation 3' ) echo '<img src="ps3-icon.png">' ?>
Where “What platform do you play on the most?” is the name of my selection box. The one above works fine for a drop down selection box.
I am trying to do the same if statement, but with a checkbox setup and it doesn’t seem to use the same code.
I’ve tried a few variations of code like below, but have been unsuccessful on getting it to display.
<?php xprofile_get_field_data( 'What Games Are You Frequently Playing?', $member_id ); if ( $games == (isset($_POST['Call Of Duty: Ghosts'])) && $_POST["Call Of Duty: Ghosts"] == 1 ) echo '<img src="codghosts.png">' ?>
Any help would be wonderful, thanks! Also if you notice anything I am doing wrong, please let me know I am still learning!
- The topic ‘[Resolved] PHP If Statement Help’ is closed to new replies.