0

I'm creating a car dealership website and I want to display a banner on each result page, but the banner should relate to the search the user made.

If the user searches for an Audi A4 the url is:
http://......../searchlisting.php?search=1&makems=38&models=25&price=-1&seller=&year=&x=35&y=8
If the user searches for an Audi A6 the url is:
http://......../searchlisting.php?search=1&makems=38&models=26&print=-1&seller=&year=&x=35&y=8

Regardless of the model searched, makems will always be =38 from Audi.
I'd like an Audi banner displayed on all the Audi results, a BMW banner on all the BMW results, etc.

So, is there any way to get makems=38 from the url and use it to display the appropriate banner?

I don't want to start creating database tables etc.

Thanks.

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by HazardTW
0

Well, without a database you will have to hardcode every condition as an if statement, but if that is really what you want to do then...

$makems = $_GET['makems'];
if ($makems==83){
  // place the audi banner
}
0

How about naming your banner images accordingly:
searchbanner38.jpg, searchbanner43.jpg, etc. and in your search result choose the source of the banner image like this:

echo "<img src='path/to/images/searchbanner" . $_GET['makems'] . ".jpg'/>";

definitely a few ways to skin this cat...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.