Hi,
I am trying to get a variable from various google location ads to change the phone number depending on the ?number=xxx from the ad.
The number displays a default value unless the page is refreshed, then the variable is displayed.
Is there a better way of doing this that will display the variable number without the need for a page refresh?
In page.ss
<% if phonenumber %>$phonenumber <% else %>0800 xxx xxx<% end_if %>
In page.php
public function Phonenumber() {
include('defines.php');
return strip_tags (Session::get ('number'));
}
And defines.php
<?php
ob_start();
if (!isset($_SESSION)) {
@session_start();
}
if (!isset($_SESSION['number']))
{
$phonenumber = $_GET['number'];
$_SESSION['number'] = $phonenumber;
}
ob_end_flush();
?>