I'm not sure if this is a common question or not (I'm fairly new to PHP and HTML in general) but this has plagued me for the past couple of days. Basically, all I want to do is use PHP to manipulate a string and make the string show up as a link on a page.
This is the code for the string manipulation:
<?php
$url = "{$test}";
$test2 = "?test2={$test2}";
$finishedurl = $url . $test2;
?>
I want to insert $finishedurl from the above into this html code:
<a href="{$finishedurl}" class="blueoff">Finished URL!</a>
I tried a few things, all of which do not work, here's an example:
<?php
$url = "{$test}";
$test2 = "?test2={$test2}";
$finishedurl = $url . $test2;
<a href="{$finishedurl}" class="blueoff">Finished URL!</a>
?>
I also read somewhere that adding echo ""; before html commands should make them work, but after some testing it didn't work.
I've nearly given up on this.. it seems so simple yet I can't seem to make it work. Any takers?