i want to be able to create a search form using PHP, the search form can't search a database.
the search form will have dropdown menu's and text fields.
how do you create a search using PHP that doesn't search a database, but still searches information???
this is the page that i am curently working on:
http://www.ehouseforrent.net/cgi-bin/mojoEstate.cgi?type=search

this page is currenly using cgi-scripts, so i guess the information is stored in the cgi-bin and it will be searching the cgi-scripts and/or information in the site.

i can't use a database because of the program and scripts that i am using. i am using a MojoScripts program from http://mojoscripts.com/

if anyone could help me out with this, that would be great.
thanks

    mikewooten wrote:

    how do you create a search using PHP that doesn't search a database, but still searches information???

    this page is currenly using cgi-scripts, so i guess the information is stored in the cgi-bin and it will be searching the cgi-scripts and/or information in the site.

    Now, I'm not trying to "roast a newb" here, but I find that last "guess" to be a tad far-fetched. I also find the phrase "that searches information" in the first quote to be non-specific to a point of near-absurdity.

    First, determine exactly what data you want to "search through", what format/medium it is stored in/on, and where it is located. Then come up with either a couple of lines of code (like "<?php // this is my search engine script", at least?) or an outline of the process you think might do what you want, and then come back and see if someone can help you. 🙂

      Incidentally, when I submit a query to the page at the URI you mention, the results page says, "We're sorry, but it appears that there were no ads in the database that matched your search criteria. Please go back and try again."

      So, um, you're quite sure that there's no database to talk to?

        Searching without a database... sounds like fun... I think I'll go scratch my left ass cheek with my right hand...

        Also, I looked on the mojo site and I'm assuming you're using the real estate script... but from the product description it looks like it DOES use a database... it creates it for you and everything...

        From site:

        MojoEstate

        Run your own free or commercial real estate classifieds service or manage your agency's estate listings on your website. Professional, highly customizable real estate classifieds script on mysql backend.

          Heh, I've just come across an RDBMS written in shell. Clever, that.

          All the tables are text files: tab-separated, one record per line; the first row gives the field names. It would be pretty easy to write something that reads in one of those into a PHP array. Hang on:

          function read_ASCII_table($tablename)
          {
          	// Obviously I'm not going to bother with error recovery or other niceties
          	// I'm not advocating this code for use, either. It's probably broken anyway.
          	$handle = fopen($tablename.'.txt','r');
          	$fieldnames = fgetcsv($handle, 1024, "\t");
          	$table = array():
          	while(!feof($handle))
          	{
          		$table[] = array_combine($fieldnames, fgetcsv($handle, 1024, "\t"));
          	}
          	return $table;
          }
          

          If you don't want to use an existing commercial-grade RDBMS, you're probably going to end up writing one yourself. Easier to adapt whatever the existing code is to use a proper database.

            Write a Reply...