SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Compatability in firefox..

    For some reason my file isnt working in firefox. Can you help?

    Code:
    <?php
    
    if ($_POST["proptype"]) //this first checks to see if the form has been submitted
    {
    		$property = $_POST['select']; //gets the value from the drop down menu
    if ($property==NULL)
    	{ 	
    		echo "Please Select a Property Type";
    	}
    
    else if ($property=='apartment')
    	{ 
    		echo "Apartment Selected";
    		
    	}
    else if ($property=='residential')
    	{
    		?> <form action="/test/select/residentialcheck.php" method="post">
    			<p>House Type: 
    			<select name="house_type">
    			  <option name = trailer>Trailer</option>
    			  <option name = multifamily_home>Multi-family Home</option>
    			  <option name = single_family_home>Single Family Home</option>
    			  </select>
    			</p>
    			<p>State: 
    			  <label>
    			  <input type="text" name="state" />
    			  </label>
    			</p>
    			<p>
    			  <label>City:
    			  <input type="text" name="city" />
    			  </label>
    			</p>
    			<p>
    			  <label>Zip Code:
    			  <input type="text" name="zipcode" />
    			  </label>
    			</p>
    			<p>
    			  <label>Bedrooms:
    			  <input type="text" name="rooms" />
    			  </label>
    			</p>
    			<p>
    			  <label>Bathrooms:
    			  <input name="bathrooms" type="text" />
    			  </label>
    			</p>
    			<p>Size: 
    			  <label>
    			  <input name="textarea2" type="size"/>
    			  </label>
    			</p>
    			<p>Price: 
    			  <label>
    			  <input type="text" name="price" />
    			  </label>
    			</p>
    			<p>Description:</p>
    			<p>
    			  <label>
    			  <textarea name="description" rows="5"></textarea>
    			  </label>
    			</p>
    			<p>Other Features:</p>
    			<p>
    			  <label>
    			  <textarea name="others" rows="5"></textarea>
    			  </label>
    			</p>
    			<input type="submit">
    			</form>
    		<?php
    	}
    else if ($property=='office_space')
    	{
    	
    	}
    else if ($property=='retail')
    	{
    	
    	}
    else if ($property=='land')
    	{
    	
    	}
    else if ($property=='industrial')
    	{
    	
    	}
    
    }
    
    ?>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    </head>
    
    <body>
    
    <form action="<?php echo ''.basename($PHP_SELF).''?>" method="post">
      <p>Property Type: 
        <select name="select">
          <option value="">Select Please</option>
          <option value="apartment">Apartment</option>
          <option value="residential">Residential</option>
          <option value="office_space">Office Space</option>
          <option value="retail">Retail</option>
          <option value="land">Land</option>
          <option value="industrial">Industrial</option>
        </select>
      </p>
      <p>
        <input type="submit" name="proptype" />
    </p>
    </form>
    </body>
    </html>
    Thank you very much.

    -The n00blet

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You should never use the name of the submit button as a test if a form has been submitted. As you've now learned, it's unreliable, often not sent at all. Check a field that will always be sent with your form, such as your select list or add a hidden field.

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman
    You should never use the name of the submit button as a test if a form has been submitted. As you've now learned, it's unreliable, often not sent at all. Check a field that will always be sent with your form, such as your select list or add a hidden field.
    Which form is being submitted as test?

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm talking about this:

    PHP Code:
    if ($_POST["proptype"]) //this first checks to see if the form has been submitted 

  5. #5
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Regina, SK
    Posts
    318
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's not working in firefox with your file? Is there an error?
    Reduce or eliminate spam on your sites without CAPTHCAs
    - maybe it is possible: http://formantispam.thekerrs.ca/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •