Jump to content

[SOLVED] Setting Variables to HTML markup


UbH

Recommended Posts

Hi everyone,

I am currently creating a CMS for my sites navigation but I am having a little problem.

The CMS capabilitys include adding more menu items and this mean setting a few PHP variables that get inserted into MySQL to HTML markup like the following:

$openLinkVar = "<a href=";
$linkVar = "main.php?id=1";
$closeLinkVar = ">";
$linkNameVar = "Some Link";
$finishLinkVar = "</a>";

 

The problem is that after being sent to MySQL the link wont work on my test page.

The source of the test page shows the output as the following:

<a href=main.php?id=1>Some Link</a>

 

When I enter these variables into MySQL manually with proper HTML link quotes the link works :

<a href="main.php?id=1">Some Link</a>

 

So obviously its because I cant have quotes for my HTML link variables, how do I get around this?

Link to comment
https://forums.phpfreaks.com/topic/100226-solved-setting-variables-to-html-markup/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.