Syntax question

 <?php if (in_category('35')) { echo "<a href=\"".$subdomain."podcast\"><img src=\"\" alt=\"Download this podcast through iTunes\"></a>"; } ?>

The $subdomain variable will not display . everything else echoes fine. Is my syntax wrong?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ashish PatelCommented:
no i guess just try echo for $subdomain as it might not be having any value. can you just echo that vraible before you use and let me know. The syntax you are using is correct.
Ashish PatelCommented:
or try with this

<?php if (in_category('35')) { echo "<a href='" . $subdomain . "podcast'><img src='' alt='Download this podcast through iTunes'></a>"; } ?>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
probably your value for $subdomain is not set
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

>>Is my syntax wrong?
No. If it were a syntax problem you would get a runtime error. See the code below:
if (in_category('35')) 
	if(isset($subdomain) && !isempty($subdomain) )
	 	echo '<a href="'.$subdomain.'podcast"><img src="" alt="Download this podcast through iTunes"></a>';
		echo 'no subdomain';

Open in new window

Loganathan NatarajanLAMP DeveloperCommented:
i would suggest this would work,

if (in_category('35')) {

echo '<a href="'.$subdomain.'podcast"><img src="" alt="Download this podcast through iTunes"></a>';

CWS (haripriya)Commented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Split: asvforce {http:#20799984} & syedasimmeesaq {http:#20800061} & hielo {http:#20800128}  & logudotcom {http:#20812777}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Experts Exchange Cleanup Volunteer
Forced accept.

EE Admin
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.