Jump to content


Photo

Using A Link To Perform Search


  • Please log in to reply
6 replies to this topic

#1 justlukeyou

justlukeyou

    Advanced Member

  • Members
  • PipPipPip
  • 966 posts

Posted 12 February 2013 - 04:52 PM

Hi,

I have search scripts which reads a forms and outputs to /test/searchoutput.php

The form perfectly however I am now trying a form search to a link. For example there is a link on the page called "Green Widgets". One someone clicks the link it performs a search and also outputs to /test/searchoutput.php

The idea is these links will be used directly below the search form to give examples of what users can search for.

Is it possible to do this?

#2 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 12 February 2013 - 04:56 PM

Is it possible to do this?


Yes.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#3 justlukeyou

justlukeyou

    Advanced Member

  • Members
  • PipPipPip
  • 966 posts

Posted 12 February 2013 - 05:03 PM

Thanks, how would I do this please?

Edited by justlukeyou, 12 February 2013 - 05:10 PM.


#4 justlukeyou

justlukeyou

    Advanced Member

  • Members
  • PipPipPip
  • 966 posts

Posted 13 February 2013 - 03:58 AM

Hi,

Do I need a form to the link. I cant add a query to the end of the link such as /test/searchoutput.php?search=green-widgets.

So Im a bit confused what the next step is. I have tried Googling but nothing suitable seems to come up.

I have tried "search database with link" etc

#5 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 13 February 2013 - 07:49 AM

Yes, you can add it to the URL.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#6 justlukeyou

justlukeyou

    Advanced Member

  • Members
  • PipPipPip
  • 966 posts

Posted 13 February 2013 - 08:19 AM

Thanks,

What process would I follow. I cant see how I can use /test/searchoutput.php?search=green-widgets

#7 KevinM1

KevinM1

    Snarkimus Prime

  • Moderators
  • 5,209 posts
  • LocationNew Hampshire, USA

Posted 13 February 2013 - 08:34 AM

Do you know how to use $_GET[]? Do you know how to create a hyperlink?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com