Tag Archives: php

How To Create Simple PHP Widgets


Objective:

  • Creating a simple PHP Widget, which will allow the user to reach the result page of Google! from your site.

Requirement:

Creating the form(index.htm):

<form action=“google.php” method=“get” name=“query_form”>

<input id=“search” onclick=‘value=”" ‘ name=“search” type=“text” value=“Enter the search term” />

<input id=“submit” name=“submit” type=“submit” value=“Submit” />

</form>

PHP Script(google.php):

?php
$url=”http://www.google.com/search?q=”.$_REQUEST['search'];//Adding the user query with the URL
header(“Location:$url”);
?>

<?PHP

$url=“http://www.google.com/search?q=”.$_REQUEST['search'];

header(“Location:$url”);

?>

Download the full script, here

Even you can create more widgets just by changing the URLs. I’m mentioning few search URLs:

  • Yahoo Search : http://search.yahoo.com/search?q=
  • Live Search : http://search.live.com/results.aspx?q=
  • Youtube : http://www.youtube.com/results?search_query=
  • Answers : http://www.answers.com/topic/
  • Wikipedia : http://en.wikipedia.org/wiki/

Thanks to SachinKRaj for guiding me on this script. Do post your comments :)

Shubhamoy

An engineer by chance and a blogger by choice. Love to share my knowledge with the masses. My main focus is always on open source technologies and latest gadgets. This blog provides me the platform to cherish my passion.

Website - More Posts

Fix PEAR Installation on WAMP Server

Hi Folks,

shubhamoy_wamplogo

Few weeks later I faced a great trouble while installing PEAR on WAMP Server.

The Problem:

The PEAR path is wrongly set to C:\php5\pear automatically than its original path.

The Solution:

  1. Edit every php.ini file, change INCLUDE_PATH to your path where WAMP Server is installed(e.g. C:\WAMP\bin\php\php5\includes).
  2. Now run go-pear.bat, and follow all the instructions. If everything is fine then its OK. You can check it by running http://localhost/phpinfo(). Else if go to Step 3.
  3. Right Click My Computer->Advanced Tab->Environment Variables->Add New User Variable->PHP_PEAR_INCLUDE_PATH->Add new value->The path where PEAR is installed(e.g. C:\WAMP\bin\php\php5\PEAR).
  4. Do post your results soon.

If any step is not clear or you have some doubt then kindly post a comment. Even if you insist then I’ll post thumbnails also.

Reblog this post [with Zemanta]

Shubhamoy

An engineer by chance and a blogger by choice. Love to share my knowledge with the masses. My main focus is always on open source technologies and latest gadgets. This blog provides me the platform to cherish my passion.

Website - More Posts

Multiple Web Search

Hi Friends,

Today I introduced a Multiple Web Search in my Website. It’s really amazing and very helpful as you enter a single query, you get results from three search engines at a time.

How to use:

  1. Enter a keyword in the text area. And click Submit.
  2. You will obtain results from three search engines, i.e., Google,BING & Yahoo.
  3. All the results will be displayed in single page(three frames and 33% each).

Its development:

This whole creation is the result of SachinKRaj’s guidance. He guided me all along the development. Hats Off to him :-D

Update:

Today I launched its Version 2.0. I had made it free from few bugs and also added a new feature which will allow you to select a single search engine also. So do check it out. Here is its snapshot.

Shubhamoy

An engineer by chance and a blogger by choice. Love to share my knowledge with the masses. My main focus is always on open source technologies and latest gadgets. This blog provides me the platform to cherish my passion.

Website - More Posts