How to put google search box in php site.

Discussion in 'PHP' started by ltimranjaved, Apr 27, 2009.

  1. #1
    dear fellows i have a site
    http://loansandscholarships.tk

    i want to add a google search box in it.so can any one help me out where to place it(in coding) bcz when i am posting it in the pages with the content in the pages it doesnt appear.is there any special requirement to it.I am new to php and i built this site using templete.

    Thanks in advance
     
    ltimranjaved, Apr 27, 2009 IP
  2. fear

    fear Banned

    Messages:
    3,750
    Likes Received:
    221
    Best Answers:
    0
    Trophy Points:
    205
    #2
    You can get the google's search box code with your publisher id from your adsense account, copy that code and save it in a php file then using include you can recall the search box in all your pages. I think this is the easy way.
     
    fear, Apr 27, 2009 IP
  3. pipes

    pipes Prominent Member

    Messages:
    12,766
    Likes Received:
    958
    Best Answers:
    0
    Trophy Points:
    360
    #3
    Sometimes it takes up to 10mins for newly added adsense code to appear.
     
    pipes, Apr 27, 2009 IP
  4. ltimranjaved

    ltimranjaved Peon

    Messages:
    254
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    it seems a viable option let me try
     
    ltimranjaved, Apr 27, 2009 IP
  5. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    you will have to post the code outside of the PHP code, or else you will probably have problems.

    Make sure it is not inside of

    <?php

    ?>
     
    Lpe04, Apr 27, 2009 IP
  6. Grobbulus

    Grobbulus Peon

    Messages:
    557
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    yep. you should paste the code outside of the <? ?> php code. Are you using google's custom search http://www.google.com/coop/cse/ ?
     
    Grobbulus, Apr 27, 2009 IP
  7. ltimranjaved

    ltimranjaved Peon

    Messages:
    254
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    thanks for thelatest input but still it doesnt work,there is no error shown a small box rather a small rectangle appear but the search box i sstill missing.
    i m putting it outside the
    <?php .... ?>
     
    ltimranjaved, Apr 28, 2009 IP
  8. usadesi

    usadesi Peon

    Messages:
    296
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks to to all for sharing this information....
     
    usadesi, Apr 28, 2009 IP
  9. iwantvarun

    iwantvarun Active Member

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #9
    Put code out side php tags like we write html.You can put that search code in some other php and include it in you main php.
     
    iwantvarun, Apr 28, 2009 IP
  10. ltimranjaved

    ltimranjaved Peon

    Messages:
    254
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    yeah writing in other php file and including it in code is a good option,i try this now.lets see
     
    ltimranjaved, Apr 29, 2009 IP
  11. Lpe04

    Lpe04 Peon

    Messages:
    579
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #11
    We established this already
     
    Lpe04, Apr 29, 2009 IP
  12. iwantvarun

    iwantvarun Active Member

    Messages:
    200
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #12

    Where you have established any thing about putting code in other file and include it:confused:
     
    iwantvarun, May 3, 2009 IP
  13. usadesi

    usadesi Peon

    Messages:
    296
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    you can copy the code from google adscense account.Past it into your code.
     
    usadesi, May 6, 2009 IP