[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

2 submit buttons on same form that do different tasks

Asked by egeiyioglu in PHP Scripting Language

I have this site:
http://www.fireplaceindustry.co.uk/search.htm

it is a page with frames..
the upper frame is named up.php and here's the source:
it uses the data.php file to print search results.
I want to make it so that when there's a name entered in the Company box, the other fields should be ignored..
and if the other fields are chosen, than the name box should be ignored..
is it possible to do this with 2 submit buttons or do I need 2 separate forms for that?
<html>

<head>
<meta http-equiv="Content-type" content="text/html; charset=windows-1254">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-9">
<title>FirePlaceIndustry.co.uk</title>
<base target="main">
</head>

<body leftmargin="0">
<div align="center"><center>
</center></div><div align="center"><center>

<table border="0" width="757" height="27" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" height="27" align="left"><form method="GET" target="main"

action="data.php">
      <table border="0" width="587" height="1" cellspacing="0" cellpadding="0">
        <tr>
          <td width="83" height="15"><font face="Verdana" size="1"><strong>Company

</strong></font></td>
          <td width="41"><font face="Verdana" size="1"></font></td>
          <td width="42"><font face="Verdana" size="1"><strong>Product</strong></font></td>
          <td width="165" height="15"><font face="Verdana" size="1"><strong>Category
            <?php
  $dbcnx = @mysql_connect(
              "localhost", "fireplac", "ongIboSAH");
  mysql_select_db("fireplac");
  $categories = mysql_query(
                "SELECT ID, category from category order by ID ASC");
?>            
            <?php
  $dbcnx = @mysql_connect(
              "localhost", "fireplac", "ongIboSAH");
  mysql_select_db("fireplac");
  $counties = mysql_query(
                "SELECT ID, county from county order by county ASC");
?>
            <input name="page2" type="hidden" value=0>
</strong></font></td>
          <td width="117" height="15"><font face="Verdana"

size="1"><strong>County</strong></font></td>
          <td width="46" height="15"></td>
          <td width="88" height="15"></td>
          <td width="5" height="15"></td>
        </tr>
        <tr>
          <td width="83" height="1" valign="middle"><input name="name" type="text"

id="name"
          style="font-family: verdana; width: 145px; font-size: 10px" size="17"></td>
          <td width="41" height="1" valign="middle"><input name="Search2" type="submit"

id="Search23"
          style="background-color: rgb(0,48,156); color: rgb(156,207,254); font-family:

Verdana; font-size: 10px; font-weight: bold; border: 1 solid" value="Search"></td>
          <td width="42" height="1" valign="middle"><select name="product"
          size="1" id="select12"
          style="font-size: 10px; width: 145px; font-family: verdana; color: rgb(0,0,0);

border: 1 solid rgb(0,0,0)" width="10">
            <option selected>Select A Product</option>
            <option>--------</option>
            <option value="electric">Electric Fires</option>
            <option value="gas">Gas Fires</option>
            <option value="fireplaces">Fireplaces</option>
            <option value="stoves">Stoves</option>
            <option value="nochimney">No Chimney Products</option>
            <option value="solid">SoliFuel</option>
            <option value="lpg">LPG Appliances</option>
            <option value="chimney">Chimney Products</option>
            <option value="cast">Cast Products</option>
            <option value="marble">Natural Marble</option>
            <option value="stone">Stone Products</option>
            <option value="accessories">Accessories</option>
                    </select></td>
          <td width="165" height="1" valign="middle"><select name="CATID"
          size="1" id="CATID"
          style="font-size: 10px; width: 145px; font-family: verdana; color: rgb(0,0,0);

border: 1 solid rgb(0,0,0)" width="10">
            <OPTION SELECTED VALUE="">Select a Category
                    <OPTION VALUE="">---------
                          <?php
          while ($category = mysql_fetch_array($categories)) {
              $CATID = $category["ID"];
              $categoryname = $category["category"];
          echo("<OPTION VALUE=$CATID>$categoryname\n");
    }
  ?>
                                  </select></td>
          <td width="117" height="1" valign="middle"><select name="COTID"
          size="1" id="COTID"
          style="font-size: 10px; width: 145px; font-family: verdana; color: rgb(0,0,0);

border: 1 solid rgb(0,0,0)" width="10">
            <OPTION SELECTED VALUE="">Select a County
                    <OPTION VALUE="">---------
                        <?php
          while ($county = mysql_fetch_array($counties)) {
              $COTID = $county["ID"];
              $countyname = $county["county"];
          echo("<OPTION VALUE=$COTID>$countyname\n");
    }
  ?>
                                </select></td>
          <td width="46" height="1" align="center" valign="middle"><input name="Search"

type="submit" id="Search3"
          style="background-color: rgb(0,48,156); color: rgb(156,207,254); font-family:

Verdana; font-size: 10px; font-weight: bold; border: 1 solid" value="Search"></td>
          <td width="88" height="1"><div align="right">
            <p align="center"><font size="1" face="Verdana, Arial, Helvetica,

sans-serif"><?php echo ( date("d.m.Y")); ?>
            </font><font color="#FFFFFF">            </font></td>
          <td width="5" height="1"></td>
        </tr>
      </table>
    </form>    </td>
  </tr>
</table>
</center></div>
</body>
</html>




[+][-]11/20/05 07:00 AM, ID: 15329233Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP Scripting Language
Sign Up Now!
Solution Provided By: Grins
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091118-EE-VQP-93