Hi guys! My problem is with the file upload.php. For it to work, you have to give it the $_GET value content_type. So you have to go to upload.php?content_type=game.(or video or song) I have some code that should display the correct logo. However, all it does is display the music logo (even when $_GET['content_type'] should = game or video instead of song). Here is the code: <?php //return logo if ($_GET["content_type"]="song") { // code to display music logo } elseif ($_GET["content_type"]="game") { // code to display games logo } else { //code to display videos logo }?> PHP: Can someone tell me how to make this work?
You need == otherwise you are asigning the value to the variable. <?php //return logo if ($_GET["content_type"]=="song") { // code to display music logo } elseif ($_GET["content_type"]=="game") { // code to display games logo } else { //code to display videos logo }?> PHP:
If you are going to be processing several different options, why not use the switch statement? I find that for my efforts, when the code for each option is small and very similar this is a better way to go. It seems, to me anyway, easier to add/remove items to the list. switch ($_GET['content_type']) { case 'song': $_logo = 'song_logo.png'; break; case 'game': $_logo = 'game_logo.png'; break; case '...': $_logo = '..._logo.png'; break; default: $_logo = 'default_logo.png'; } // display $_logo Code (markup): Just an option, of course