Domanda

im having an problem, currently im using a code to alter page content.

<?php
if (isset($_GET['ad']) && $_GET['ad'] == 1)
{
echo "";
}
else {
echo '<div class="ad-area"><p>This is the ad, click here</p> </div>';
}
?>

But now I face a problem, since I need to display another URL and it echos from wordpress custom field.

<input type="hidden" name="link" value="<?php echo $linkk; ?>?kw=<?php echo $_GET['kw']; ?>" />

What I would like to see is that if url has

ad=1

inside it,

$linkk would be $linkk2

, but im unsure how to do it, cause echoing just displays the code, cause its server side. Since its a page template and the URLs change, then I cant just insert them into the code.

What to do?

Thanks, M

È stato utile?

Soluzione

Do you mean like this?

echo '<input type="hidden" name="link" value="'.$linkk.'?kw='.$_GET['kw'].'" />';
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top