We help IT Professionals succeed at work.

How can I keep my search parameters after clicking on a result from a list of search results

Adam
Adam asked
on
567 Views
Last Modified: 2013-12-13
My search values don't carry on, after a row has been selected from the list of results. So how can I keep these seacrh parameters in place, after rows/reults from the list have been selected?

I have previously managed to get this to work for a previous site, but for this site, using the same code (I think), it seems not to work. I really don't understand it. The code I'm using to try to retain the parameters are:

RESULTS PAGE 0 (clicking on a row links to Results page 1):
<a href="NewMemberTeacherProfile0.php?language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?></font></a>

RESULTS PAGE 1
<a href="NewMemberTeacherProfile0.php?language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?></font></a>
Comment
Watch Question

I'm not sure I understand the problem...

You need 1 page to display a list of results and when you click on it, you want to show details of that record? and preserve the queries across pages to re-populate search results later?

If that is the case, you need to store the search variables somewhere - either in hidden form fields + links throughout your poage or (possibly more simply) in some cookies?

If you can explain in detail what you WANT to happen, we can help you do it :)
Khanh DoanSenior Developer

Commented:
I think you can create a new table (search), with some field:
id : search id
query : ur sql query
result : ur total rows of ur search

when user do a search, first, you check it had in database. If yes, don't insert the info into table search; else insert the search query into ur table.
Then at the link, you have some thing like : index.php?do=search&searchid=123&page=2

In your code, check you have variable searchid from $_GET or not. If yes, get the search query from you search table and do a search like SELECT * FROM table WHERE field LIKE '%ur seach text%' LIMIT 20, 20
else check the search text from $_POST then do a search.

Sorry 4 my bad english.
Goodluck.
Bonmat86.
AdamTrying to learn php

Author

Commented:
Hi - Sorry for the poor explanation. Basically, for example, there is a search box on the homepage of the website

www.orangutanjapan.com

It's in Japanese, and the search parameteres are currently set to 'all / show all' for both boxes, but if you, for example, were to select the 3rd option (which is 'South Korean') on the upper drop down menu and press the search button below the second drop down menu you would be presented with a list of teachers from South Korea.

This is good, as from the search box I've selected a search on all teachers from South Korea. However, if we click on one of these results (teachers), the details of that teacher are displayed - which is what is desired, but the list refreshes and the parameter 'South Korea' is lost and instead all teachers are shown.

I have actually got this working before - using the code I've listed above, but here, I can't seem to get it working....

Many thanks

Adam
Sorry for the delay, had a phonecall...

<?php

$search=isset($_REQUEST['search'])?$_REQUEST['search']:"%";      //Default to "Everything" - We'll limit the result set size so this won't be an issue

$query="
      SELECT       id,
                  field1,
                  field2
      FROM      table
      WHERE      field LIKE '%" . mysql_escape_string($search . "%'
      LIMIT      20, 20";

//Store search for later use:
setcookie("search", $search);


$result = mysql_query($query);


//Display output:
print "<TABLE>";
while ($row = mysql_fetch_assoc($result)) {
    print "<TR><TD><a href="details.php?id={$row['id']}">{$row['id']}</A></TD><TD>{$row['field1']}</TD><TD>{$row['field2']}</TD></TR>";
}
print "</TABLE>";


?>

What this will mean is that anyone going BACK to the search page will see their old search results (You can store page number the same way), and there is a unique ID on each row to link from. Is this what you are after?
Sorry, just read the detailed explanation. I suggest a similar approach but just have something to preserve the drop-down box...

<?php
$area = isset($_REQUEST['area'])?$_REQUEST['area']:""; //Default to no area, but retrieve from previous page if possible.
?>
<SELECT name="whatever">
    <OPTION VALUE="northkorea" <?if($area=="northkorea"){print " SELECTED";}?>>North Korea</OPTION>
    <OPTION VALUE="southkorea" <?if($area=="southkorea"){print " SELECTED";}?>>South Korea</OPTION>
</SELECT>

which will preserve the contents of the drop-down. There are more elegant ways to do this - eg putting all the locations/vakues in an array and looping through them, printing <OPTION> statements, which will save redundancy or even better, pulling the list of locaitons from the database.

Most likely the issue here is the way SELECT boxes work ie needing the SELECTED instead of just setting a value.


There are a number of considerations: 1) The variable must be preserved - either it has to be added to evry link to immitate a GET, or it must be submitted in every form to cover POST or you can set it as a cookie - which will be great unless someone has 2 copies of the site open at once...
CERTIFIED EXPERT

Commented:
I would suggest that the info that needs to be carried over from page to page is kept in $_SESSION rather than in $_COOKIE

Pro SESSION: Cookies should be kept as small as possible, eg for carrying some info like session ID or language. Larger chunks of data (eg previous search, or previous search results, or even search history) would better fit in session data. This also limits the information that will remain on the user's station and will be more resistant to direct data manipulation in the cookie.

Pro COOKIE: you can access its content directly with $_REQUEST which browses one after the other and in that order $_GET, $_POST and $_COOKIE. Otherwise, if you put your data in $_SESSION, you would have first to look at $_REQUEST then $_SESSION.

Personally I prefer using SESSION which give me a better security control.
AdamTrying to learn php

Author

Commented:
thanks for the feedback so far everyone.

Basic Life - the advice you gave me above, does this code go in the search page? In particular, where would I put this line of code you gave me:

<?php
$area = isset($_REQUEST['area'])?$_REQUEST['area']:""; //Default to no area, but retrieve from previous page if possible.
?>

Thanks

The line listed would go anywhere before the search form. All it is doing is checking whether or not a search has already been made - if so, set $area to the are searched, otherwise set $area to ""

This bit:
<SELECT name="whatever">
    <OPTION VALUE="northkorea" <?if($area=="northkorea"){print " SELECTED";}?>>North Korea</OPTION>
    <OPTION VALUE="southkorea" <?if($area=="southkorea"){print " SELECTED";}?>>South Korea</OPTION>
</SELECT>

is how you can display the drop-down list (on the search page) which will automatically select the previous area if it matches.
AdamTrying to learn php

Author

Commented:
Hi basiclife,

I've tried what you suggested adding the following where my previous drop down list was (see below) but I still am not getting the parameters to preserve.  

I'm pretty confused because I've managed this before on another site - using just the following in the results screen:

<a href="NewMemberTeacherProfile0.php?language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?></font></a>

Anyway - your help is very much appreciated. Thanks - I'll keep at it!


<select name="language" class="style28" id="language">
    <option value="" selected>hýžg </option>
    <option value="English" <?if($area=="English"){print " SELECTED";}?>>ñž</OPTION>
    <option value="korean" <?if($area=="korean"){print " SELECTED";}?>>Óýž</OPTION>
    <option value="Chinese" <?if($area=="Chinese"){print " SELECTED";}?>>-ýž</OPTION>
    <option value="Vietnamese" <?if($area=="Vietnamese"){print " SELECTED";}?>>ÙÈÊàž</OPTION>
    <option value="Azerbaijani" <?if($area=="Azerbaijani"){print " SELECTED";}?>>¢¼ëФ¸ãóž</OPTION>
    <option value="Arabic" <?if($area=="Arabic"){print " SELECTED";}?>>¢éÓ¢ž</OPTION>
    <option value="Italian" <?if($area=="Italian"){print " SELECTED";}?>>¤¿ê¢ž</OPTION>
    <option value="Indonesia" <?if($area=="Indonesia"){print " SELECTED";}?>>¤óÉÍ·¢ž</OPTION>
    <option value="Holland" <?if($area=="Holland"){print " SELECTED";}?>>ªéóÀž</OPTION>
    <option value="Estonia" <?if($area=="Estonia"){print " SELECTED";}?>>¨¹ÈË¢ž</OPTION>
    <option value="Cambodia" <?if($area=="Cambodia"){print " SELECTED";}?>>«óܸ¢ž</OPTION>
    <option value="Spanish" <?if($area=="Spanish"){print " SELECTED";}?>>¹Ú¤óž</OPTION>
    <option value="Zulu" <?if($area=="Zulu"){print " SELECTED";}?>>ºüëüž</OPTION>
    <option value="Thai" <?if($area=="Thai"){print " SELECTED";}?>>¿¤ž</OPTION>
    <option value="Tagalog" <?if($area=="Tagalog"){print " SELECTED";}?>>¿¬í°ž</OPTION>
    <option value="Tamil" <?if($area=="Tamil"){print " SELECTED";}?>>¿ßëž</OPTION>
    <option value="Danish" <?if($area=="Danish"){print " SELECTED";}?>>ÇóÞü¯ž</OPTION>
    <option value="Turkish" <?if($area=="Turkish"){print " SELECTED";}?>>È볞</OPTION>
    <option value="German" <?if($area=="German"){print " SELECTED";}?>>ɤĞ</OPTION>
    <option value="Nepalese" <?if($area=="Nepalese"){print " SELECTED";}?>>ÍÐüëž</OPTION>
    <option value="Hindu" <?if($area=="Hindu"){print " SELECTED";}?>>Òóºüž</OPTION>
    <option value="French" <?if($area=="French"){print " SELECTED";}?>>Õéó¹ž</OPTION>
    <option value="Bulgarian" <?if($area=="Bulgarian"){print " SELECTED";}?>>Öë¬ê¢ž</OPTION>
    <option value="Bengali" <?if($area=="Bengali"){print " SELECTED";}?>>Ùó¬ëž</OPTION>
    <option value="Portuguese" <?if($area=="Portuguese"){print " SELECTED";}?>>ÝëȬëž</OPTION>
    <option value="Polish" <?if($area=="Polish"){print " SELECTED";}?>>ÝüéóÉž</OPTION>
    <option value="Myanmar" <?if($area=="Myanmar"){print " SELECTED";}?>>ßãóÞüž</OPTION>
    <option value="Romanian" <?if($area=="Romanian"){print " SELECTED";}?>>ëüÞË¢ž</OPTION>
    <option value="Russian" <?if($area=="Russian"){print " SELECTED";}?>>í·¢ž</OPTION>
    </select>
   <option value="" selected>hýžg </option>

This line is SELECTing the first row of your drop-down box no matter what. have a look at the source code it is generating
AdamTrying to learn php

Author

Commented:
Hi basiclife. Thanks for the respones.

 The first line ( <option value="" selected>hýžg </option>) is basically there so that if the user doesn't want to specify any parametes s/he just selects  <option value="" selected>hýžg </option> (which is the default selected option from the list) and all rows (teachers) are displayed. I don't want to lose this functionality.


If no SELECTED is present, the first item in the list will be chosen by default (as you want). If someone HAS chosen an option, however, that item will have a SELCTED, so will be chosen

You could always put it in logic if you are unhappy withr elying on a browser defaulting...

    <option value="" <?if($area==""){print " SELECTED";}?>>hýžg </option>
    <option value="English" <?if($area=="English"){print " SELECTED";}?>>ñž</OPTION>
...
etc.
AdamTrying to learn php

Author

Commented:
Hi,

The same problem continues. I've typed in...

    <select name="language" class="style28" id="language">
                                     
     <option value="" <?if($area==""){print " SELECTED";}?>>hýžg </option>
    <option value="English" <?if($area=="English"){print " SELECTED";}?>>ñž</OPTION>
    <option value="korean" <?if($area=="korean"){print " SELECTED";}?>>Óýž</OPTION>
etc...

...but still the parameters don't carry on after they have been displayed once.  

Thanks
CERTIFIED EXPERT

Commented:
>> the parameters don't carry on after they have been displayed once

Hmmm... what do you do to carry $area from one display to the other?
You should have something like
<?php
session_start();
$area=trim( ' ' . @REQUEST['language'];
....

Can you paste here the equivalent lines you currently have?
AdamTrying to learn php

Author

Commented:
Okay, the entire results page code is as follows. I'm sorry I've pasted it here. I'm not really a programmer and wasn't sure what was relevent and what wasn't.

<?php require_once('../Connections/connectiona.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];

$maxRows_m = 30;
$pageNum_m = 0;
if (isset($_GET['pageNum_m'])) {
  $pageNum_m = $_GET['pageNum_m'];
}
$startRow_m = $pageNum_m * $maxRows_m;

mysql_select_db($database_connectiona, $connectiona);
$query_m = "SELECT TestTable.autonumber, TestTable.sex, TestTable.firstname, TestTable.nationality, TestTable.private_price FROM TestTable WHERE TestTable.language LIKE '%" . $_REQUEST["language"] . "%' AND TestTable.prefecture LIKE '%" . $_REQUEST["prefecture"] . "%'";
$query_limit_m = sprintf("%s LIMIT %d, %d", $query_m, $startRow_m, $maxRows_m);
$m = mysql_query($query_limit_m, $connectiona) or die(mysql_error());
$row_m = mysql_fetch_assoc($m);

if (isset($_GET['totalRows_m'])) {
  $totalRows_m = $_GET['totalRows_m'];
} else {
  $all_m = mysql_query($query_m);
  $totalRows_m = mysql_num_rows($all_m);
}
$totalPages_m = ceil($totalRows_m/$maxRows_m)-1;

$colname_d = "-1";
if (isset($_GET['recordID'])) {
  $colname_d = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
}
mysql_select_db($database_connectiona, $connectiona);
$query_d = "SELECT date_format(date, '%d %M %Y') as date, autonumber, photo, imagelocation, imagelocation2, video, vid, sex, firstname, fullname, age, nationality, `language`, OthLanguage, teachingexperience, LangSchls, LangQual, qualifications, otherexper, TMethd, jap_ability, likes, dislikes, fav_movie, areas, prefecture, mm, ma, me, tm, ta, te, wm, wa, we, thm, tha, the, fm, fa, fe, sm, sa, se, `sum`, sua, sue, private_price, group_price, firstlesson, message, contactmail, contactnum FROM TestTable WHERE autonumber = {$colname_d}";
$d = mysql_query($query_d, $connectiona) or die(mysql_error());
$row_d = mysql_fetch_assoc($d);
$totalRows_d = mysql_num_rows($d);

$queryString_m = "";
if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_m") == false && 
        stristr($param, "totalRows_m") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_m = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_m = sprintf("&totalRows_m=%d%s", $totalRows_m, $queryString_m);
?>
<!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>Private Lesson - Teacher Profile</title>
<style type="text/css" media="screen">
#container
{
width: 761px;
margin: 0px auto;
background-color: #fff;
color: #333;
border: 1px solid orange;
line-height: 130%;

}
#top
{
background-color: #ddd;

}

#top h1
{
padding: 0;
margin: 0;
}

#rightnav
{
float: right;
width: 265px;
margin: 0;
padding: 1em;

}

#content
{
width: 445px;

border-right: 1px solid orange;


}

#footer
{
clear: both;
margin: 0;

color: #333;
background-color: ##FBE775;
border-top: 1px solid orange;
}

#rightnav p { margin: 0 0 1em 0; }
#content h2 { margin: 0 0 .5em 0; }
.style33 {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
}
body {
      background-color: #FFAD77;
      margin-left: 0px;
      margin-top: 0px;
}
.style38 {font-size: 12px}
.style57 {font-size: 10px; color: #FF6600; font-family: Arial, Helvetica, sans-serif; }
.style71 {color: #FFFFFF}
.style70 {color: #0000FF}
.lefttile {
      background-image: url(graphics/Words/find%20a%20teacher/Japanese%20Homepage/New%20Folder2/images/Newprofile_r5_c1.gif);
}
.righttile {
      background-image: url(graphics/Words/find%20a%20teacher/Japanese%20Homepage/New%20Folder2/images/Newprofile_r5_c7.gif);
}
.upperrighttile {
      background-image: url(graphics/Words/find%20a%20teacher/Japanese%20Homepage/New%20Folder2/images/Newprofile_r3_c7.gif);
}
.style73 {font-size: 14}
.style78 {font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; }
</style>
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
 
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  }
}
//-->
</script>
</head>

<body onLoad=";MM_CheckFlashVersion('8,0,0,0','Content on this page requires a newer version of Macromedia Flash Player. Do you want to download it now?')">
<div id="container">
  <div id="top">
    <table border="0" cellpadding="0" cellspacing="0" width="761">
      <!--DWLayoutTable-->
  <!-- fwtable fwsrc="inputtitle.png" fwbase="title.gif" fwstyle="Dreamweaver" fwdocid = "301477140" fwnested="1" -->
  <tr>
    <td width="761" height="51" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="761">
      <!--DWLayoutTable-->
      <!-- fwtable fwsrc="membersprofile.png" fwbase="profile3.gif" fwstyle="Dreamweaver" fwdocid = "301477140" fwnested="1" -->
      <tr>
        <td width="761" height="51" valign="top" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0" width="760">
          <!-- fwtable fwsrc="title_studentheader.png" fwbase="profiletitle.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
          <tr>
            <td><img name="profiletitle_r1_c1" src="images/profiletitle_r1_c1.jpg" width="706" height="95" border="0" alt=""></td>
            <td><table align="left" border="0" cellpadding="0" cellspacing="0" width="54">
                <tr>
                  <td><img name="profiletitle_r1_c2" src="images/profiletitle_r1_c2.jpg" width="54" height="68" border="0" alt=""></td>
                </tr>
                <tr>
                  <td><a href="index.php"><img name="profiletitle_r2_c2" src="images/profiletitle_r2_c2.jpg" width="54" height="27" border="0" alt=""></a></td>
                </tr>
            </table></td>
          </tr>
        </table></td>
        </tr>
    </table></td>
  </tr>
</table>
</div>
<div id="rightnav"><img src="graphics/Words/find%20a%20teacher/Japanese%20Homepage/teachers.jpg" width="267" height="110">
  <table border="0">
    <tr>
      <td width="36"><div align="center"><span class="style57">sex</span></div></td>
      <td width="64"><div align="center"><span class="style57">firstname</span></div></td>
      <td width="71"><div align="center"><span class="style57">nationality</span></div></td>
      <td width="82"><div align="center"><span class="style57">private_price</span></div></td>
    </tr>
    <?php do { ?>
    <tr>
      <td><div align="center"><span class="style57"><?php echo $row_m['sex']; ?></span></div></td>
      <td><div align="center"><span class="style57"><a href="NewMemberTeacherProfile0.php?language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?></font></a></span></div></td>
      <td><div align="center"><span class="style57"><?php echo $row_m['nationality']; ?></span></div></td>
      <td><div align="center"><span class="style57"><?php echo $row_m['private_price']; ?></span></div></td>
    </tr>
    <?php } while ($row_m = mysql_fetch_assoc($m)); ?>
  </table>
  <br>
  <table border="0" width="50%" align="center">
    <tr>
      <td width="23%" align="center"><?php if ($pageNum_m > 0) { // Show if not first page ?>
          <a href="<?php printf("%s?pageNum_m=%d%s", $currentPage, 0, $queryString_m); ?>"><img src="graphics/Words/find a teacher/logosandbanners/arrows/OFirst.gif" width="18" height="13" border=0></a>
          <?php } // Show if not first page ?>
      </td>
      <td width="31%" align="center"><?php if ($pageNum_m > 0) { // Show if not first page ?>
          <a href="<?php printf("%s?pageNum_m=%d%s", $currentPage, max(0, $pageNum_m - 1), $queryString_m); ?>"><img src="graphics/Words/find a teacher/logosandbanners/arrows/OPrevious.gif" width="14" height="13" border=0></a>
          <?php } // Show if not first page ?>
      </td>
      <td width="23%" align="center"><?php if ($pageNum_m < $totalPages_m) { // Show if not last page ?>
          <a href="<?php printf("%s?pageNum_m=%d%s", $currentPage, min($totalPages_m, $pageNum_m + 1), $queryString_m); ?>"><img src="graphics/Words/find%20a%20teacher/logosandbanners/arrows/ONext.gif" width="14" height="13" border=0></a>
          <?php } // Show if not last page ?>
      </td>
      <td width="23%" align="center"><?php if ($pageNum_m < $totalPages_m) { // Show if not last page ?>
          <a href="<?php printf("%s?pageNum_m=%d%s", $currentPage, $totalPages_m, $queryString_m); ?>"><img src="graphics/Words/find%20a%20teacher/logosandbanners/arrows/OLast.gif" width="18" height="13" border=0></a>
          <?php } // Show if not last page ?>
      </td>
    </tr>
  </table>
  <br>
  </div>
<div id="content">
  <table border="0" cellpadding="0" cellspacing="0" width="445">
    <!--DWLayoutTable-->
    <!-- fwtable fwsrc="profileOrangutan.png" fwbase="profile.gif" fwstyle="Dreamweaver" fwdocid = "2007693981" fwnested="1" -->
    <tr>
      <td width="445" height="1345" valign="top"><table width="445" height="1379" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <!-- fwtable fwsrc="TEST2newprofileOrangutan.png" fwbase="Newprofile.gif" fwstyle="Dreamweaver" fwdocid = "2007693981" fwnested="1" -->
        <tr>
          <td width="445" height="35" valign="top"><div align="center"><span class="style11 style33 style38"><font color="#FF6600" face="Arial, Helvetica, sans-serif">&#12371;&#12398;&#12503;&#12525;&#12501;&#12451;&#12540;&#12523;&#12399;</font> <span class="style70"><?php echo $row_d['date']; ?></span> <font color="#FF6600" face="Arial, Helvetica, sans-serif"> &#12395;&#36861;&#21152;&#12414;&#12383;&#12399;&#26356;&#26032;&#12373;&#12428;&#12414;&#12375;&#12383; </font></span></div></td>
        </tr>
        <tr>
          <td height="43"><img name="Newprofile_r2_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r2_c1.gif" width="445" height="43" border="0" alt=""></td>
        </tr>
        <tr>
          <td height="166"><table width="445" height="166" border="0" align="left" cellpadding="0" cellspacing="0">
            <!--DWLayoutTable-->
              <tr>
                <td width="24" height="166"><img name="Newprofile_r3_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r3_c1.gif" width="24" height="166" border="0" alt=""></td>
                <td width="144"><table width="144" height="166" border="0" align="left" cellpadding="0" cellspacing="0">
                  <!--DWLayoutTable-->
                    <tr>
                      <td width="144" height="116" valign="top"><img name="Newprofile_r4_c3" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r4_c3.gif" width="144" height="50" border="0" alt=""><img src="<?php echo $row_d['imagelocation']; ?>" alt="" width="136" height="116"></td>
                    </tr>
                    <tr>
                      <td height="50"><!--DWLayoutEmptyCell-->&nbsp;</td>
                    </tr>
                </table></td>
                <td width="19"><img name="Newprofile_r3_c4" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r3_c4.gif" width="19" height="166" border="0" alt=""></td>
                <td width="236" valign="top"><span class="style38"><span class="style38 style33">&nbsp;&#27663;&#21517;</span> <span class="style38 style33"><span class="style70"><?php echo $row_d['fullname']; ?></span><br>
                      <br>
&nbsp;&#22269;&#31821;</span> <span class="style38 style33"><span class="style70"><?php echo $row_d['nationality']; ?></span><br>
<br>
&nbsp;&#27597;&#22269;&#35486;</span> <span class="style33"><span class="style70"><?php echo $row_d['language']; ?></span><br>
<br>
&nbsp;&#24180;&#40802;<font color="#0000FF"> </font><font color="#0000FF"><?php echo $row_d['age']; ?></font></span></span></td>
                <td width="22" valign="top" class="upperrighttile"><img src="graphics/Words/find%20a%20teacher/Japanese%20Homepage/New%20Folder2/images/Newprofile_r3_c7.gif" width="22" height="166"></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height="572"><table width="445" height="572" border="0" align="left" cellpadding="0" cellspacing="0">
            <!--DWLayoutTable-->
              <tr>
                <td width="18" height="572" valign="top" class="lefttile"><img src="graphics/Words/find%20a%20teacher/Japanese%20Homepage/New%20Folder2/images/Newprofile_r5_c1.gif" width="18" height="572"></td>
                <td width="405" valign="top"><P><span class="style33"><span class="style73">&nbsp;&#25945;&#24107;&#32076;&#39443;</span><span class="style70"><?php echo $row_d['teachingexperience']; ?></span>&nbsp;&#24180;<BR>
&nbsp;<br>
&nbsp;&#33521;&#20250;&#35441;&#12473;&#12463;&#12540;&#12523; <span class="style70"><?php echo $row_d['LangSchls']; ?></span><BR>
&nbsp;<br>
&nbsp;&#25945;&#21729;&#36039;&#26684;<span class="style70"><?php echo $row_d['LangQual']; ?></span><BR>
&nbsp;<br>
&nbsp;&#12381;&#12398;&#20182;&#36039;&#26684; ( &#22823;&#23398;&#12539;&#30701;&#22823;)<FONT
color=#0000ff>&nbsp;<?php echo $row_d['qualifications']; ?><br>
  </FONT>&nbsp;<br>
                </span><span class="style33">&nbsp;&#12381;&#12398;&#20182;&#32076;&#39443;<span class="style70"><?php echo $row_d['otherexper']; ?></span><br>
    <br>
    &nbsp;&#12381;&#12398;&#20182;&#24471;&#24847;&#12394;&#35328;&#35486;<span class="style70"><?php echo $row_d['OthLanguage']; ?></span><BR>
                  <br>
                  &nbsp;&#26085;&#26412;&#35486;&#12524;&#12505;&#12523;<span class="style70"><?php echo $row_d['jap_ability']; ?></span><BR>
                  <br>
&nbsp;&#22909;&#12365;&#12394;&#12418;&#12398;<FONT color=#0000ff>&nbsp;</FONT><span class="style70"><?php echo $row_d['likes']; ?></span><BR>
&nbsp;&#12365;&#12425;&#12356;&#12394;&#12418;&#12398;&nbsp;<span class="style70"><?php echo $row_d['dislikes']; ?></span><BR>
&nbsp;&#22909;&#12365;&#12394;&#26144;&#30011;&nbsp;<span class="style70"><?php echo $row_d['fav_movie']; ?></span></span></P>
                  <p align="left" class="style33">&nbsp;&#25152;&#22312;&#22320;&nbsp;<span class="style70"><?php echo $row_d['prefecture']; ?></span><BR>
&nbsp;&#20986;&#24373;&#21487;&#33021;&#12394;&#22320;&#22495;&nbsp;<FONT size=2><font color="#0000FF"><span class="style70"><?php echo $row_d['areas']; ?><br>
  <br>
  </span></font></FONT>&nbsp;&#12503;&#12521;&#12452;&#12505;&#12540;&#12488;&#12524;&#12483;&#12473;&#12531;&#26009;&#65288; 1 &#26178;&#38291;&#24403;&#12383;&#12426;&#65289; &nbsp;&nbsp;<span class="style70"><?php echo $row_d['private_price']; ?></span><BR>
&nbsp;&#12464;&#12523;&#12540;&#12503;&#12524;&#12483;&#12473;&#12531;&#26009;&#65288; 1 &#26178;&#38291;&#24403;&#12383;&#12426;&#65289;<span class="style70"><?php echo $row_d['group_price']; ?></span><BR>
&nbsp;&#21021;&#22238;&#25480;&#26989;&#26009;<span class="style70"><?php echo $row_d['firstlesson']; ?></span><BR>
  <br>
  &nbsp;&#12513;&#12483;&#12475;&#12540;&#12472;<br>
&nbsp;  <span class="style70"><?php echo $row_d['message']; ?></span><br>
  <span class="style70">&nbsp;&nbsp;</span><BR>
&nbsp;&#38651;&#35441;&#30058;&#21495; &nbsp;&nbsp;<span class="style38"><font color="#FF0000">&#12513;&#12531;&#12496;&#12540;&#29992;</font></span><STRONG>&nbsp;</STRONG><BR>
&nbsp;E &#12513;&#12540;&#12523;&#12450;&#12489;&#12524;&#12473;&nbsp;<span class="style38"><font color="#FF0000">&#12513;&#12531;&#12496;&#12540;&#29992;</font></span></p></td>
                <td width="22" valign="top" class="righttile"><img src="graphics/Words/find%20a%20teacher/Japanese%20Homepage/New%20Folder2/images/Newprofile_r5_c7.gif" width="22" height="572"></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height="62"><img name="Newprofile_r6_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r6_c1.gif" width="445" height="62" border="0" alt=""></td>
        </tr>
        <tr>
          <td height="254"><table width="445" height="254" border="0" align="left" cellpadding="0" cellspacing="0">
            <!--DWLayoutTable-->
              <tr>
                <td width="24" height="254"><img name="Newprofile_r7_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r7_c1.gif" width="24" height="254" border="0" alt=""></td>
                <td width="399" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <!--DWLayoutTable-->
                  <tr>
                    <td width="399" height="254" valign="top" bgcolor="#FF6600"><table width="399" border="0">
                      <tr>
                        <td>&nbsp;</td>
                        <td><div align="center" class="style71"><span class="style43">&#21320;&#21069;</span></div></td>
                        <td><div align="center" class="style71"><span class="style43">&#21320;&#24460;</span></div></td>
                        <td><div align="center" class="style71"><span class="style43">&#22812;&#38291;</span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#26376;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['mm']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['ma']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['me']; ?></span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#28779;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['tm']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['ta']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['te']; ?></span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#27700;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['wm']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['wa']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['we']; ?></span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#26408;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['thm']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['tha']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['the']; ?></span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#37329;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['fm']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['fa']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['fe']; ?></span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#22303;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['sm']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['sa']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['se']; ?></span></div></td>
                      </tr>
                      <tr>
                        <td><div align="right" class="style71">
                          <div align="center"><span class="style43">&#26085;&#26332;&#26085;</span></div>
                        </div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['sum']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['sua']; ?></span></div></td>
                        <td><div align="center" class="style78"><span class="style38"><?php echo $row_d['sue']; ?></span></div></td>
                      </tr>
                    </table></td>
                  </tr>
                </table>                </td>
                <td width="22"><img name="Newprofile_r7_c7" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r7_c7.gif" width="22" height="254" border="0" alt=""></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height="62"><img name="Newprofile_r8_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r8_c1.gif" width="445" height="62" border="0" alt=""></td>
        </tr>
        <tr>
          <td height="140"><table width="445" height="140" border="0" align="left" cellpadding="0" cellspacing="0">
            <!--DWLayoutTable-->
              <tr>
                <td width="24" height="140"><img name="Newprofile_r9_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r9_c1.gif" width="24" height="140" border="0" alt=""></td>
                <td width="394" valign="top" bgcolor="#000000"><div align="center">
                  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="180" height="135" id="FLVPlayer">
                    <param name="movie" value="FLVPlayer_Progressive.swf" />
                    <param name="salign" value="lt" />
                    <param name="quality" value="high" />
                    <param name="scale" value="noscale" />
                    <param name="FlashVars" value="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=<?php echo $row_d['video']; ?>&autoPlay=false&autoRewind=false" />
                    <embed src="FLVPlayer_Progressive.swf" flashvars="&MM_ComponentVersion=1&skinName=Clear_Skin_1&streamName=<?php echo $row_d['video']; ?>&autoPlay=false&autoRewind=false" quality="high" scale="noscale" width="180" height="135" name="FLVPlayer" salign="LT" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />                  
</object>
                </div></td>
                <td width="27"><img name="Newprofile_r9_c6" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r9_c6.gif" width="27" height="140" border="0" alt=""></td>
              </tr>
          </table></td>
        </tr>
        <tr>
          <td height="45"><img name="Newprofile_r10_c1" src="graphics/Words/find a teacher/Japanese Homepage/New Folder2/images/Newprofile_r10_c1.gif" width="445" height="45" border="0" alt=""></td>
        </tr>
      </table></td>
    </tr>
  </table>
</div>
<div id="footer"><img src="lowerbanner761.jpg" width="761" height="20"></div>
</div>


</body>
</html>
<?php
mysql_free_result($m);

mysql_free_result($d);
?>


AdamTrying to learn php

Author

Commented:
The code of the page (the home page) featuring the search box is as follows (again sorry if I've pasted too much - I'm concerned that I may miss out something relevant):

<?php require_once('../Connections/connectiona.php'); ?>
<?php
mysql_select_db($database_connectiona, $connectiona);
$query_a = "SELECT autonumber, imagelocation, imagelocation2, firstname, nationality, prefecture, private_price FROM TestTable";
$a = mysql_query($query_a, $connectiona) or die(mysql_error());
$row_a = mysql_fetch_assoc($a);
$totalRows_a = mysql_num_rows($a);
?>
<?php
// *** Validate request to login to this site.
session_start();

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
  $GLOBALS['PrevUrl'] = $accesscheck;
  session_register('PrevUrl');
}

if (isset($_POST['compemail'])) {
  $loginUsername=$_POST['compemail'];
  $password=$_POST['password'];
  $MM_fldUserAuthorization = "";
  $MM_redirectLoginSuccess = "MemberProfiles/Members Lounge.php";
  $MM_redirectLoginFailed = "Jsorry.htm";
  $MM_redirecttoReferrer = false;
  mysql_select_db($database_connectiona, $connectiona);
 
  $LoginRS__query=sprintf("SELECT compemail, password FROM students WHERE compemail='%s' AND password='%s'",
    get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
   
  $LoginRS = mysql_query($LoginRS__query, $connectiona) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";
   
    //declare two session variables and assign them
    $GLOBALS['MM_Username'] = $loginUsername;
    $GLOBALS['MM_UserGroup'] = $loginStrGroup;           

    //register the session variables
    session_register("MM_Username");
    session_register("MM_UserGroup");

    if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];      
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}
?>
<?php
$area = isset($_REQUEST['area'])?$_REQUEST['area']:""; //Default to no area, but retrieve from previous page if possible.
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>ñqìùó - ͤƣÖHh×é¤ÙüÈìùó.ÞóÄüÞóûýžY+h×é¤ÙüÈìùó</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
<meta name="description" content="×é¤ÙüÈñqìùó,Y+’¢WfD~YK.ýžnY+’¢WfD‹ºn_nµ¨ÈgY" />
<meta name="keywords" content="Orangutan Japan ñž,ñq,×é¤ÙüÈìùó,×é¤ÙüÈñqìùó,ñq+,ÞóÄüÞó,ìùó,ýž,žf,×é¤ÙüÈìùó,H,ñž f!, º,×é¤ÙüÈ, ºìùó,ñqY¤,¢Y,-ýž,žfY+’¢Y,žf,ÞóÄüÞó,q¬,å,¬ý,äK,^HÝ,'*,ü‰,CI,¡q,Y+’¢WfD~YK,Õéó¹ž,ɤĞ,¹Ñ¤óž" />
<meta name="robots" content="all" />
<META NAME="copyright" CONTENT="Copyright c 2005 OrangutanEnglish, OrangutanJapan"><style type="text/css">
<!--
body {
      background-color: #FFAD77;
      margin-left: 0px;
      margin-top: 0px;
      margin-right: 0px;
}
a:link {
      color: #FF6600;
      text-decoration: none;
}
a:visited {
      text-decoration: none;
      color: #FF6600;
}
a:hover {
      text-decoration: underline;
      color: #FF6600;
}
a:active {
      text-decoration: none;
      color: #FF6600;
}
.style17 {
      color: #FF6600;
      font-size: 12px;
}
.style19 {color: #FF0000}
.style20 {color: #000000}
.style22 {font-size: 9px}
.style28 {font-size: 12px}
.style55 {color: #000000; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.style58 {
      font-size: 16px;
      font-family: Arial, Helvetica, sans-serif;
      color: #FF6600;
}
.style61 {color: #FFFFFF}
.style62 {font-size: 12px; font-weight: bold; font-family: Arial, Helvetica, sans-serif;}
.style67 {color: #FF6600; font-size: 14px; }
.style71 {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 12px;
}
.style72 {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 10px;
      color: #FFFFFF;
}
.style74 {
      font-size: 10px;
      font-family: Arial, Helvetica, sans-serif;
}
.style75 {font-size: 14px}
.style76 {font-weight: bold; color: #FF3300;}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('newfront/images/newfrontpage_r2_c2_f2.jpg','newfront/images/newfrontpage_r3_c8_f3.jpg','newfront/images/newfrontpage_r2_c3_f2.jpg','newfront/images/newfrontpage_r3_c8_f4.jpg','newfront/images/newfrontpage_r2_c4_f2.jpg','newfront/images/newfrontpage_r3_c8_f5.jpg','newfront/images/newfrontpage_r2_c5_f2.jpg','newfront/images/newfrontpage_r3_c8_f6.jpg','newfront/images/newfrontpage_r2_c6_f2.jpg','newfront/images/newfrontpage_r3_c8_f7.jpg','newquicksearchbottom1.jpg','images/whatweoffer_r2_c2_f2.gif','images/whatweofferimagedelete_r2_c2_f2.gif')">
<Div Align="Center">
<table width="761" border="0" cellpadding="0" cellspacing="1" bgcolor="#FF6600">
  <!--DWLayoutTable-->
  <tr>
    <td width="760" height="779" valign="top"><table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <!--DWLayoutTable-->
          <tr>
            <td height="95" colspan="3" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="760">
              <!-- fwtable fwsrc="newjapanesepagetitle.png" fwbase="newjapanesepagetitle.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
              <tr>
                <td><img name="newjapanesepagetitle_r1_c1" src="images/newjapanesepagetitle_r1_c1.jpg" width="523" height="95" border="0" alt="ñqìùó nH"></td>
                <td><table width="237" height="95" border="0" align="left" cellpadding="0" cellspacing="0">
                  <!--DWLayoutTable-->
                    <tr>
                      <td width="237" height="44"><img name="newjapanesepagetitle_r1_c2" src="images/newjapanesepagetitle_r1_c2.jpg" width="237" height="44" border="0" alt="OrangutanÞóÄüÞóû×é¤ÙüÈñqìùó"></td>
                    </tr>
                    <tr>
                      <td height="51" valign="top" bgcolor="#FFFFCD"><form name="form1" method="POST" action="<?php echo $loginFormAction; ?>">
                        <div align="left"><span class="style22">
                          <input name="password" type="password" class="style22" id="password" size="6">
                          </span> <span class="style22">
                          &nbsp;&nbsp;
                          <input name="compemail" type="text" id="compemail" size="10">
                          </span>
                          <input type=IMAGE
                                                                        src="submitbutton1.gif" name="submit">
                        </div>
                      </form></td>
                    </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="297" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                <!--DWLayoutTable-->
                <tr>
                  <td width="760" height="3"></td>
                </tr>
                <tr>
                  <td height="291" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="760">
                    <!-- fwtable fwsrc="newfrontpage1.png" fwbase="newfrontpage.jpg" fwstyle="Dreamweaver" fwdocid = "1101099143" fwnested="1" -->
                    <tr>
                      <td><img name="newfrontpage_r1_c1" src="newfront/images/newfrontpage_r1_c1.jpg" width="1" height="294" border="0" alt=""></td>
                      <td><table align="left" border="0" cellpadding="0" cellspacing="0" width="759">
                          <tr>
                            <td><img name="newfrontpage_r1_c2" src="newfront/images/newfrontpage_r1_c2.jpg" width="759" height="4" border="0" alt=""></td>
                          </tr>
                          <tr>
                            <td><table align="left" border="0" cellpadding="0" cellspacing="0" width="759">
                                <tr>
                                  <td><a href="http://www.orangutanjapan.com/NewMemberTeacherProfile-1.php?language=&prefecture=&Submit=T?û" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newfrontpage_r2_c2','','newfront/images/newfrontpage_r2_c2_f2.jpg','newfrontpage_r3_c8','','newfront/images/newfrontpage_r3_c8_f3.jpg',1)"><img name="newfrontpage_r2_c2" src="newfront/images/newfrontpage_r2_c2.jpg" width="94" height="39" border="0" alt="ýžY+h×é¤ÙüÈìùó"></a></td>
                                  <td><a href="What is OrangutanFindateacherNEW.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newfrontpage_r2_c3','','newfront/images/newfrontpage_r2_c3_f2.jpg','newfrontpage_r3_c8','','newfront/images/newfrontpage_r3_c8_f4.jpg',1)"><img name="newfrontpage_r2_c3" src="newfront/images/newfrontpage_r2_c3.jpg" width="93" height="39" border="0" alt="ýžY+’¢WfD~Y"></a></td>
                                  <td><a href="FAQNEW.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newfrontpage_r2_c4','','newfront/images/newfrontpage_r2_c4_f2.jpg','newfrontpage_r3_c8','','newfront/images/newfrontpage_r3_c8_f5.jpg',1)"><img name="newfrontpage_r2_c4" src="newfront/images/newfrontpage_r2_c4.jpg" width="95" height="39" border="0" alt=" ºh×é¤ÙüÈìùó"></a></td>
                                  <td><a href="signup.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newfrontpage_r2_c5','','newfront/images/newfrontpage_r2_c5_f2.jpg','newfrontpage_r3_c8','','newfront/images/newfrontpage_r3_c8_f6.jpg',1)"><img name="newfrontpage_r2_c5" src="newfront/images/newfrontpage_r2_c5.jpg" width="94" height="39" border="0" alt="×é¤ÙüÈñqìùó"></a></td>
                                  <td><a href="OrangutanJapan_TeacherGuide.htm" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newfrontpage_r2_c6','','newfront/images/newfrontpage_r2_c6_f2.jpg','newfrontpage_r3_c8','','newfront/images/newfrontpage_r3_c8_f7.jpg',1)"><img name="newfrontpage_r2_c6" src="newfront/images/newfrontpage_r2_c6.jpg" width="94" height="39" border="0" alt="ͤƣÖ+h×é¤ÙüÈìùó"></a></td>
                                  <td><img name="newfrontpage_r2_c7" src="newfront/images/newfrontpage_r2_c7.jpg" width="35" height="39" border="0" alt=" ºh×é¤ÙüÈìùó"></td>
                                  <td><a href="http://www.orangutanenglish.com"><img name="newfrontpage_r2_c9" src="newfront/images/newfrontpage_r2_c9.jpg" width="116" height="39" border="0" alt="ýžY+’¢WfD~Y"></a></td>
                                  <td><img name="newfrontpage_r2_c10" src="newfront/images/newfrontpage_r2_c10.jpg" width="56" height="39" border="0" alt=" ºh×é¤ÙüÈìùó"></td>
                                  <td><a href="JgetPassword.htm"><img name="newfrontpage_r2_c11" src="newfront/images/newfrontpage_r2_c11.jpg" width="82" height="39" border="0" alt="ýžY+’¢WfD~Y"></a></td>
                                </tr>
                            </table></td>
                          </tr>
                          <tr>
                            <td><table align="left" border="0" cellpadding="0" cellspacing="0" width="759">
                                <tr>
                                  <td><img name="newfrontpage_r3_c2" src="newfront/images/newfrontpage_r3_c2.jpg" width="498" height="251" border="0" alt="ñqìùó nH"></td>
                                  <td><img name="newfrontpage_r3_c8" src="newfront/images/newfrontpage_r3_c8.jpg" width="261" height="251" border="0" alt="ͤƣÖHh×é¤ÙüÈñqìùó"></td>
                                </tr>
                            </table></td>
                          </tr>
                      </table></td>
                    </tr>
                  </table></td>
                </tr>
               
               
            </table></td>
          </tr>
          <tr>
            <td height="148" colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <!--DWLayoutTable-->
              <tr>
                <td width="9" height="148">&nbsp;</td>
                  <td width="489" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF9900">
                      <!--DWLayoutTable-->
                      <tr>
                        <td width="340" height="148" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                          <!--DWLayoutTable-->
                          <tr>
                            <td width="340" height="148" valign="top" bgcolor="#FF9900"><div align="left"><span class="style58"><span class="style67"><span class="style17">&nbsp;<span class="style76">Orangutan</span></span></span><span class="style61"> <span class="style75">o, Hh’’9ËY‹µ- Ó¹gY</span><br>
                                <span class="style62"><span class="style20">&nbsp;&nbsp;<br>
                                  &nbsp;&nbsp;Looking for a teacher? - <span class="style19">Get started now</span></span><br>
                                  </span></span><span class="style55">&nbsp;&nbsp;~Zo×íÕ£üë’‹fBj_kc_H’¢W~W‡F<br>
                                  &nbsp;&nbsp;ÊYP×íÕ£üë’¯êïWf UD<br>
                                  &nbsp;&nbsp;HTLBj_’…cfD~Y</span></span><br>
                              <br>
                              <span sabprocessed="1" sabchildelements="1"><span sabprocessed="1" sabchildelements="10"><span sabprocessed="1" sabchildelements="1">&nbsp;<span class="style71">Contact as many teachers as you like for just 2000yen</span></span></span></span></div></td>
                            </tr>
                         
                         
                        </table></td>
                        <td width="3">&nbsp;</td>
                        <td width="148" valign="top"><img src="face1.jpg" alt="ñqìùónH" width="148" height="148"></td>
                      </tr>
                     
                     
                     
                     
                     
                     
                     
                  </table></td>
                  <td width="10">&nbsp;</td>
                  <td width="245" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FF6600">
                      <!--DWLayoutTable-->
                      <tr>
                        <td width="243" height="146" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                          <!--DWLayoutTable-->
                          <tr>
                            <td width="243" height="44" valign="top"><img src="newquicksearch1.jpg" alt="×é¤ÙüÈñqìùó" width="243" height="44"></td>
                          </tr>
                          <tr>
                            <td height="74" valign="top"><form name="form2" method="post" action="NewMemberTeacherProfile-1.php">
                              <table width="237" border="0">
                                <tr>
                                  <td width="80"><div align="left"><img src="language.jpg" alt="ñqìùónH" width="60" height="20"></div></td>
                                  <td width="147"><div align="left">
                                          <select name="language" class="style28" id="language">
                                                             
      <option value="" <?if($area==""){print " SELECTED";}?>>hýžg </option>
    <option value="English" <?if($area=="English"){print " SELECTED";}?>>ñž</OPTION>
    <option value="korean" <?if($area=="korean"){print " SELECTED";}?>>Óýž</OPTION>
    <option value="Chinese" <?if($area=="Chinese"){print " SELECTED";}?>>-ýž</OPTION>
    <option value="Vietnamese" <?if($area=="Vietnamese"){print " SELECTED";}?>>ÙÈÊàž</OPTION>
    <option value="Azerbaijani" <?if($area=="Azerbaijani"){print " SELECTED";}?>>¢¼ëФ¸ãóž</OPTION>
    <option value="Arabic" <?if($area=="Arabic"){print " SELECTED";}?>>¢éÓ¢ž</OPTION>
    <option value="Italian" <?if($area=="Italian"){print " SELECTED";}?>>¤¿ê¢ž</OPTION>
    <option value="Indonesia" <?if($area=="Indonesia"){print " SELECTED";}?>>¤óÉÍ·¢ž</OPTION>
    <option value="Holland" <?if($area=="Holland"){print " SELECTED";}?>>ªéóÀž</OPTION>
    <option value="Estonia" <?if($area=="Estonia"){print " SELECTED";}?>>¨¹ÈË¢ž</OPTION>
    <option value="Cambodia" <?if($area=="Cambodia"){print " SELECTED";}?>>«óܸ¢ž</OPTION>
    <option value="Spanish" <?if($area=="Spanish"){print " SELECTED";}?>>¹Ú¤óž</OPTION>
    <option value="Zulu" <?if($area=="Zulu"){print " SELECTED";}?>>ºüëüž</OPTION>
    <option value="Thai" <?if($area=="Thai"){print " SELECTED";}?>>¿¤ž</OPTION>
    <option value="Tagalog" <?if($area=="Tagalog"){print " SELECTED";}?>>¿¬í°ž</OPTION>
    <option value="Tamil" <?if($area=="Tamil"){print " SELECTED";}?>>¿ßëž</OPTION>
    <option value="Danish" <?if($area=="Danish"){print " SELECTED";}?>>ÇóÞü¯ž</OPTION>
    <option value="Turkish" <?if($area=="Turkish"){print " SELECTED";}?>>È볞</OPTION>
    <option value="German" <?if($area=="German"){print " SELECTED";}?>>ɤĞ</OPTION>
    <option value="Nepalese" <?if($area=="Nepalese"){print " SELECTED";}?>>ÍÐüëž</OPTION>
    <option value="Hindu" <?if($area=="Hindu"){print " SELECTED";}?>>Òóºüž</OPTION>
    <option value="French" <?if($area=="French"){print " SELECTED";}?>>Õéó¹ž</OPTION>
    <option value="Bulgarian" <?if($area=="Bulgarian"){print " SELECTED";}?>>Öë¬ê¢ž</OPTION>
    <option value="Bengali" <?if($area=="Bengali"){print " SELECTED";}?>>Ùó¬ëž</OPTION>
    <option value="Portuguese" <?if($area=="Portuguese"){print " SELECTED";}?>>ÝëȬëž</OPTION>
    <option value="Polish" <?if($area=="Polish"){print " SELECTED";}?>>ÝüéóÉž</OPTION>
    <option value="Myanmar" <?if($area=="Myanmar"){print " SELECTED";}?>>ßãóÞüž</OPTION>
    <option value="Romanian" <?if($area=="Romanian"){print " SELECTED";}?>>ëüÞË¢ž</OPTION>
    <option value="Russian" <?if($area=="Russian"){print " SELECTED";}?>>í·¢ž</OPTION>
    </select>

                                  </div></td>
                                </tr>
                                <tr>
your problem is this line:

$area = isset($_REQUEST['area'])?$_REQUEST['area']:""; //Default to no area, but retrieve from previous page if possible.

if the box is called location, it should be:

$area = isset($_REQUEST[location'])?$_REQUEST['location]:""; //Default to no area, but retrieve from previous page if possible.
AdamTrying to learn php

Author

Commented:
Sorry,  I understand now.

The two boxes corresponding to database fields, which a quick search would be made by, are called 'language' and 'prefecture'.

How should I modify your line of code to incorporate the two fields (language and prefecture)? The line of code for 1 field (language) is below...

<?php
$area = isset($_REQUEST['language'])?$_REQUEST['language']:""; //Default to no language, but retrieve from previous page if possible.
?>
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
AdamTrying to learn php

Author

Commented:
Hi, I've discovered the problem. On my search form I had the following:

<form name="form2" method="post" action="NewMemberTeacherProfile-1.php">

and on my results page I had:

<a href="NewMemberTeacherProfile0.php?language=<?php echo $_GET['language'] ?>&prefecture=<?php echo $_GET['prefecture'] ?>&recordID=<?php echo $row_m['autonumber']; ?>" class="style45"><font size="1" face="Arial, Helvetica, sans-serif"><?php echo $row_m['firstname']; ?></font></a>

I changed 'post' to 'get' and problem solved. Many thanks fibo and basiclife for all your help! Very much appreciated. Thank you for very much.

Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.