1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to create something similar to the Google Calculator for a Search Site?

Discussion in 'Programming' started by misohoni, Dec 29, 2005.

  1. #1
    misohoni, Dec 29, 2005 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mad4, Dec 29, 2005 IP
  3. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #3
    Thanks, but how about a server based one like Google? I know the scripts you are talking about but want to combine it into my search box.
     
    misohoni, Dec 29, 2005 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You would need to write a script to recognise whether a calculation is being typed or a standard search query and then either use the search script or the calculation script.

    in php you could recognise a pattern eg 2 + 2 = and if the search variable looks like this then use the calculation script.

    Alternatively use the calculation script everytime but only output the result if it comes up with a numerical answer. If the answer is not numerical then output the standard search results.
     
    mad4, Dec 29, 2005 IP
  5. misohoni

    misohoni Notable Member

    Messages:
    1,717
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    200
    #5
    Err Thanks again, I was actually looking for a script to implement rather than how it could be done.

    Thanks anyway.
     
    misohoni, Dec 29, 2005 IP