Echo google problem
Please advice you inputs are greatly appreciated

<?php
if (empty($_GET['q'])){
echo "What are you doing?";
}
else 
{
/* getting value from the search form creating a new variable*/
$ser = $_GET['q'];
/* applying logic and creating a new variable to it*/
$logic = "~resume (filetype:pdf OR filetype:doc OR filetype:rtf OR filetype:htm OR filetype:html) KEYWORD -jobs -apply -submit -required -wanted -write -sample";
/* replacing KEYWORD*/
$logic = str_replace ("KEYWORD", "$ser", $logic);

$query = file_get_contents('http://www.google.com/search?q='.urlencode (['$logic']).'&start='.$_GET['p'].'00&num=100&hl=en&ie=UTF-8&filter=2');
echo $query;

}
?>

Guys any inputs

This:
urlencode ()

Should be:
urlencode ($logic)...


Whole code:

<?php
if (empty($_GET['q'])){
echo "What are you doing?";
}
else 
{
/* getting value from the search form creating a new variable*/
$ser = $_GET['q'];
/* applying logic and creating a new variable to it*/
$logic = "~resume (filetype:pdf OR filetype:doc OR filetype:rtf OR filetype:htm OR filetype:html) KEYWORD -jobs -apply -submit -required -wanted -write -sample";
/* replacing KEYWORD*/
$logic = str_replace ("KEYWORD", "$ser", $logic);

$query = file_get_contents('http://www.google.com/search?q='.urlencode($logic).'&start='.$_GET['p'].'00&num=100&hl=en&ie=UTF-8&filter=2');
echo $query;

}
?>

this is solved appreciate your help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.