Okay, this thread may sound convoluted, but here goes…
My website has different “Sections” (e.g. Finance, Legal, Management, etc.) which you access like this…
http://local.debbie/finance/
…and when you go to that URL, you get a listing of Articles for that Section.
For each Article, I echo an “Article Summary” that is stored in my database. And because I want to control how each one looks, I decided to just store the HTML in my “summary” field like this…
<p>Being an entrepreneur and a go getter, a lot of small-business owners want to do it all, however that isn’t realistic, especially when it comes to areas like Finance, Marketing, Legal, or I.T. issues.</p><p>First, you run a great risk of really messing up something could jeopardize your finances, your computer systems, or get you into a load of legal trouble. Secondly, even if you could master these areas, you’d be wasting your time that could be better spent growing your business.</p><p>Here are 5 Tips that will help you to know <a href=“http://local.debbie/articles/when-to-hire-a-consultant”>When to Hire a Consultant</a>
When I just had one Section called “Articles”, this worked fine, but moving forward I want my Article URLs to look like this…
http://local.debbie/management/articles/when-to-hire-a-consultant
This creates a few problems…
1.) The HTML in MySQL is static so there is no easy way to add the “Section”.
2.) I tried adding a PHP Field into the HTML that goes into MySQL, but it isn’t working.
Here s what I did…
<p>Being an entrepreneur and a go getter, a lot of small-business owners want to do it all, however that isn’t realistic, especially when it comes to areas like Finance, Marketing, Legal, or I.T. issues.</p><p>First, you run a great risk of really messing up something could jeopardize your finances, your computer systems, or get you into a load of legal trouble. Secondly, even if you could master these areas, you’d be wasting your time that could be better spent growing your business.</p><p>Here are 5 Tips that will help you to know <a href=“http://local.debbie/[b][COLOR=“Red”]$section[/COLOR][/b]/articles/when-to-hire-a-consultant”>When to Hire a Consultant</a>
And here is the PHP that attempts to echo things…
echo "<div class='articleSummary'>
<h3>$heading</h3>
<a href=''>$image</a>
<div class='date'>Published: $publishedOn</div>
$summary
</div>";
3.) It is likely that I will want to put the “Article Summary” in other sections - to get better exposure - like this…
http://local.debbie/legal/articles/when-to-hire-a-consultant
…so I can’t just hard-code in the “Section” to my stored HTML?!
If I could get my PHP variable to work, then when the HTML is echoed, it would pick up the $section variable and be dynamically populated.
Any ideas how to do this?
Thanks,
Debbie