Hi, thanks for replying.
I am familiar with the and $_POST, the problem is if i put a form, as soon as i hit submit it loads the other .php page that contains all the coding to display the results and this search engine is running that page in the back and updates “live” thru a javascript… so i just need to store this values somewhere that can be detected by the process.php, i dont want to load it… i just want it to grab those values
Here is my coding:
HEAD of the searching page:
[code]
[/code]
BODY
<!-- begin form -->
<div id="form">
<table width="100%" height="50" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle" scope="col"><span class="fontregisteryet"> <input type="text" class="blackfontverdana" id="terms" onfocus="if ( this.value == this.defaultValue ) this.value = ''" onblur="if ( this.value == '' ) this.value = this.defaultValue" onkeyup="getScriptPage('show_results','terms','1')" value="type your search here" size="45" />
</span></td>
</tr>
</table>
</div>
</p>
</div>
<p>
<!-- end form -->
Now the process.php has this:
[php]<?php
// file for database connection
include(‘inc/db.inc.php’);
include(‘inc/sort.php’);
// configuration file
include(‘inc/config.inc.php’);
if(isset($_GET[‘p’])) {
$page_number = $_GET[‘p’];
$arraySearch = $_GET[‘terms’];
$show_count = $_GET[‘count’];
settype($page_number, ‘integer’);
}
$nospaces = substr($_GET[‘terms’],0,4);
$offset = ($page_number - 1) * $records_number;
// check for an empty string and display a message.
if ($_GET[‘terms’] == “”) {
echo ‘
e.g. Type ´Denver´ or ´Blonde´ or ´21´ or ´120´ without quotes.
’;
// minim 3 characters condition
} else if(strlen($_GET[‘terms’]) < $limitchar) {
echo ‘
’. $limitchar .’ characters minimum
’;
// no spaces in first 4 letters
} else if(preg_replace(’/[a-zA-Z0-9]/’, ‘’, $nospaces)) {
echo ‘
Please use letters or numbers in first 4 characters
’;
} else {
// explode search words into an array
$arraySearch = explode(" “, $_GET[‘terms’]);
// table fields to search
$arrayFields = array(0 => $first_field, 1 => $second_field, 2 => $third_field, 3 => $forth_field, 4 => $fifth_field, 5 => $sixth_field, 6 => $seventh_field, 7 => $eigth_field, 8 => $nineth_field, 9 => $tenth_field);
$countSearch = count($arraySearch);
$a = 0;
$b = 0;
$query = “SELECT * FROM $table_name WHERE (”;
$countFields = count($arrayFields);
while ($a < $countFields)
{
while ($b < $countSearch)
{
$query = $query.”$arrayFields[$a] LIKE ‘%$arraySearch[$b]%’ AND verified=‘yes’";
$b++;
if ($b < $countSearch)
{
$query = $query." AND “;
}
}
$b = 0;
$a++;
if ($a < $countFields)
{
$query = $query.”) OR (";
}
}
$query = $query.") ORDER BY $table $sortby LIMIT $offset, $records_number;";
$search = mysql_query($query);[/php]… ETC, ETC ETC… but that is where i put $table and $sortby and thats where the values would go to…