Hi There,
I am a noobie to PHP Programming, I had a client request a car inventory database, I managed to find one online for free. I am having some issues with it, it probably comes from not writing the script. On the website I am creating there is a feature to search a price range and a year range, both return no results. The page is lookg for a YF and YT, and PF, anf PT field, I am not sure where it is trying to pull the data from, I think that might be the issue, but it is just a guess. My other issue is when I hit submit the search portion returns to black text, which will not work because the background is black. I have tried changing the font class to grey, and the normally the search results are grey, it is only after the submit they turn black....Below is the code on the search.php and search.html pages. Please please please help...I am getting so frustrated, I don't really know how to debug this code as it is a third party script, and I am now at my wits end.
the website is http://www.ellerbeckmotors.ca/search.php
Here is the code:
Hi There,
I am a major noobie at PHP programming, and I am trying my best to get this car inventory script working properly for me. Here are the issues I am having:
1) When I enter values for the year and the price it keeps coming back to say there are no matches, which is not right
2) The search results are not in the same color as the previous search screen (when you hit submit they revert back to the black text, I need the text in grey)
Any help would be appreciated, I have looked through the PHP, and MYSQL books I have but I am not sure how to integrate what I have read into the exisiting code. Below is the search.html file, the website I am running the search on is http://www.ellerbeckmotors.ca/search.php, try it out you will see what I mean. The search feature for price and year is not working, and I am getting frustrated trying to figure it out
<!--S:Search-->
<script language="JAVAScript" >
function Model(newmodel) {
var models = new Array();
{SCRIPT}
for (var i = document.forms[0].model.options.length ; i >= 0 ; i--)
document.forms[0].model.options = null;
if (newmodel == "" )
return "";
//adding the new values;
for (var i = 1 ; i < models[newmodel].length ; i++)
document.forms[0].model.options[i-1] = models[newmodel];
}
</script>
<style type="text/css">
<!--
.fontcolor {
color: #C0C0C0;
}
body,td,th {
color: #CCC;
}
body {
background-color: #000;
}
.fontcolor {
color: #C0C0C0;
}
-->
</style>
<body bgcolor="#000000" text="#CCCCCC" class="fontcolor"><form action="search.php" method="get">
<table align=center>
<tr>
<td><span class="fontcolor">Make & Model</span></td>
<td><span class="fontcolor">{MAKE} & {MODEL}</span></td>
<tr>
<td><span class="fontcolor">Price range:</span></td>
<td><span class="fontcolor">FROM: $
<input type="text" name="pf" value="{PF}" size="5">
TO: $<input type="text" name="pt" value="{PT}" size="5">
</span></td>
</tr>
<tr>
<td><span class="fontcolor">Year range:</span></td>
<td><span class="fontcolor">FROM:
<input type="text" name="yf" value="{YF}" size="5">
TO: <input type="text" name="yt" value="{YT}" size="5">
</span></td>
</tr>
<tr>
<td align=center colspan=2><span class="fontcolor">
<input type="submit">
</span></td>
</tr>
</table>
</form>
<!--E:Search-->
<!--S:Select-->
<select name="{NAME}" onChange="{ONCHANGE}">
<option value="">[ select ]</option>
{OPTIONS}
</select>
<!--E:Select-->
<!--S:SelectOption-->
<option {SELECTED} value="{VALUE}">{NAME}</option>
<!--E:SelectOption-->
Here is the search.php code:
<?php
require "config.php";
$_PAGE = "index";
$_GET["sub"] = "search";
$site = new CSite("admin/site.xml");
$site->Run();
?>
Help!! Please....PHP script problems
Moderator: General Moderators
-
murphydesigns
- Forum Newbie
- Posts: 7
- Joined: Sun Apr 25, 2010 9:23 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Help!! Please....PHP script problems
Triple post. Locked.