Jump to content

[SOLVED] easy peasy if you know PHP


fri3ndly

Recommended Posts

Hi there. I know a little about PHP, and was creating this simple dropdown box selection page and run into some trouble....

 

        <form method="get" name="form" action="">
          <label>
          <select name="select" class="formtext">
            <option value="Please select a manufacturer">Please select a manufacturer</option>
            <option value="Clearview">Clearview</option>
            <option value="Coalbrookdale">Coalbrookdale</option>
            <option value="Dovre">Divre</option>
            <option value="Euroheat">Euroheat</option>
            <option value="Franco Belge">Franco Belge</option>
            <option value="Hunter">Hunter</option>
            <option value="Hwam">Hwam</option>
            <option value="Jotul">Jotul</option>
            <option value="Stovax">Stovax</option>
            <option value="Vermont">Vermont</option>
            <option value="Yeoman">Yeoman</option>
          </select>
          </label>
          <label></label>
          <label>
          <input name="Submit" type="submit" class="formsubmit" value="Submit">
          </label>
      </form><div class="sitetext">
	<?php
         // If submitted, check the value of "select". If its not blank value, get the value and put it into $select.

         $select=$_GET['select'];

	if ('$select'=="Clearview"){
	echo "This is the Clearview page";
	}

	else{
	echo "You selected $select";
	}


	?>

 

If 'Clearview' is selected and then submitted, 'This is the clearview page' is supposed to be displayed, but instead it just shows the answer to $select (Clearview).

 

Any help much appreciated.

 

Thanks ;D

Link to comment
https://forums.phpfreaks.com/topic/55710-solved-easy-peasy-if-you-know-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.