Got stuck
How to make $newUrl a hyperlink in a different html page
new to php code

<?php
if (!isset($_GET['p']) || empty($_GET['p'])) {
    $_GET['p']=0;
    }
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);

$url = "http://www.google.com/search?q=";
$inc = '00&num=100&hl=en&ie=UTF-8&filter=2';
$newUrl = "$url" . "$logic" . "$inc";    

}
?>

add this after $newUrl:

echo '<a href="'.$newUrl.'">Link Text Here</a>';

or this:

echo "<a href=\"$newUrl\">Link Text Here</a>";

its the same

I want hide the code and take it as include function in a different page can be php or html
appreciate your replies
Please advice

How about Iframe?

thats is great but the problem is the codes must hit google
it not going to display results if the http://google... with visitors query and refine search... is not hitting google.
Will iframe do

I was looking for forwarding to another PHP file where include functions and then create url. This going to be advance level for me

I will explain you in detail
The form page gets a query and then it process in this query with a refine search but i dont want action in this page and hide and get another file which should have include or may be wisable function and then process $newUrl as hyperlink
here is code again

<?php
if (!isset($_GET['p']) || empty($_GET['p'])) {
    $_GET['p']=0;
    }
if (empty($_GET['q'])){
echo "Your Search Is Empty";
}
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);
/* processing new url*/
$url = "http://www.google.com/search?q=";
$inc = '00&num=100&hl=en&ie=UTF-8&filter=2';
$newUrl = "$url" . "$logic" . "$inc";

}
/* echo newlink*/

echo "<a href='$newUrl'>Google Document Type</a>"
?>

the echo function has to get process in another x.php file

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.