How would I create a hyperlink to pass a search result to another website?

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
IChaps
New php-forum User
New php-forum User
Posts: 126
Joined: Tue Mar 01, 2016 3:07 pm

Fri Jan 11, 2019 3:52 pm

Hi.

Could I just enquire at this stage (however I'm unsure to explain this).

I'm building a company review site,

My main site works fine, however I would like to create a link so that a company can place a badge on their site, and link it to their review page on my site.

The difficulty I've got, is that when I click on the badge on my test site it loads a blank page. When I manually type-in or copy the url into my web browser the required page loads ok.


If I use

Code: Select all

echo file_get_contents('http://www.seareview.co.uk/page/public_badge/3badge.php');
the page loads.

If I use

Code: Select all

echo file_get_contents('http://www.seareview.co.uk/page/public_badge/3badge.php?companies_name=Summer Hotel');
the page is blank and I'm unsure why.


Also at present, the 3badge.php reads,

Code: Select all

<?
            session_start();
            $business_name = $_GET['companies_name'];
echo "[ " . $business_name . "]";
exit;
?>
To see this for yourself, please visit www.seareview.me.uk and it should show [ Summer Hotel ] as a result, instead it shows [ ].

I'd just like to ask if I've gone wrong anywhere, and how would I create a hyperlink to similar to http://www.seareview.co.uk/page/public_ ... ame=Summer Hotel');

Thank You.

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 775
Joined: Mon Feb 22, 2016 5:52 pm

Sat Jan 12, 2019 10:22 am


IChaps
New php-forum User
New php-forum User
Posts: 126
Joined: Tue Mar 01, 2016 3:07 pm

Sun Jan 13, 2019 3:45 pm

Thank you Hyper very much.
I'm unsure how to use urlencode, but will look into this further.

Thank you for your reply.

Post Reply