简体   繁体   中英

Echoing php in php

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

你是这个意思吗

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM