How do I add a hidden keyword to a search form?

4 replies
I want to have a hidden keyword attached to a search form, so when someone types in their words the hidden keyword will get attached when bringing the search results. Does anyone know how to apply this to the coding? Thanks.
#add #form #hidden #keyword #search
  • Profile picture of the author zerofill
    Your search form posts to a search result page like search.php or whatever. You could have it post to itself to... whatever...


    $mynewterm = $_POST['yoursearchfieldname'] . "Your other word to append";

    Then do whatever you want with the variable mynewterm
    Signature
    Serp Shaker
    The IM World Will Be Shaken to the Core!
    Join my list at: IMCool.Biz
    New Podcast --> podcast.imcool.biz
    {{ DiscussionBoard.errors[3409285].message }}
    • Profile picture of the author Tashi Mortier
      Okay... It depends on the form that you want to send.

      Can you modify the form with Javascript? Does it get sent to a page on your local webserver? I need a bit more input on this.
      Signature

      Want to read my personal blog? Tashi Mortier

      {{ DiscussionBoard.errors[3409415].message }}
  • Profile picture of the author Evan-M
    to add a hidden field to a form

    add to your form
    <input type="hidden" name="keyword" value=" keyword or php to add the keyword here">

    then on the next page to retrieve it
    $keyword=$_POST[keyword];


    now $keyword = whatever the value of keyword was on the previous form page.
    Signature

    Evan-M

    Easily The Worlds Best Wordpress Popup plugin

    Visit Website Design Firm For All Your Wordpress Coding Needs

    {{ DiscussionBoard.errors[3409585].message }}
  • Profile picture of the author leahpot
    I agree with Evan-M, we have the same idea..
    so, i wont have any instruction for it, your instruction is enough to do with it.
    {{ DiscussionBoard.errors[3611645].message }}

Trending Topics