freakyorkshire Posted August 19, 2013 Share Posted August 19, 2013 Hi im trying to add a hyperlink or a picture to php variable file, please could someone tell me if possible and how to or help with terminology and point me to a reference. The mainpage index.php has a reference <div id="subtitle2content"> <p><?php echo $pagesubtitle2content ?></p> </div> the file variables.php has a reference $pagesubtitle2content='More on essays in this example text'; This works well but when I try and add a picture or a hyperlink around the word sample it breaks the page im trying to change until I return to text only Maybe ive just got the syntax wrong but i cant work out what to search for on Google. Ive tried "using hyperlinks in php variable reference files" but it doesnt give me anything useful - Is this what I am dealing with? A PHP variable reference file? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/281372-how-to-add-a-hyperlink-or-a-picture-to-php-variable-file/ Share on other sites More sharing options...
Solution freakyorkshire Posted August 19, 2013 Author Solution Share Posted August 19, 2013 Hi I managed to do this with $pagesubtitle2content='<a href="www.google.com">More on essays in this example text</a><img src="img/1.png">'; would be interested in what you could help with on the question - Is this what I am dealing with? A PHP variable reference file? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/281372-how-to-add-a-hyperlink-or-a-picture-to-php-variable-file/#findComment-1445876 Share on other sites More sharing options...
AbraCadaver Posted August 19, 2013 Share Posted August 19, 2013 (edited) I'm not sure if there's really a name for it. It's just a file with variables that is included into another file that uses those variables. You could just as easily have those variables in the same file as the echo. This just makes it more flexible and possibly modular. Most likely you're running into a quoting problem. Different quotes have different rules and purposes. Check here, especially the single and double sections: http://us2.php.net/manual/en/language.types.string.php Edited August 19, 2013 by AbraCadaver Quote Link to comment https://forums.phpfreaks.com/topic/281372-how-to-add-a-hyperlink-or-a-picture-to-php-variable-file/#findComment-1445878 Share on other sites More sharing options...
freakyorkshire Posted August 19, 2013 Author Share Posted August 19, 2013 Thanks AbraCadaver Its a modular site with the one variables.php file to adjust to customise content. Thanks for the link Quote Link to comment https://forums.phpfreaks.com/topic/281372-how-to-add-a-hyperlink-or-a-picture-to-php-variable-file/#findComment-1445880 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.