Jump to content


Photo

Help With One Line


  • Please log in to reply
9 replies to this topic

#1 JustNeedHelp

JustNeedHelp
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 07 October 2006 - 01:22 AM

I have one line of script that isn't working and I'm not sure why... Could someone help me

<?php
echo ('<a href="'.$acfolder.'rss.php?get_cat='.$cat.'"><img src="/content/images/icons/rss.gif" alt="RSS Feed" width="40" height="40" border="5" style="border-color:#02a5cb" /></a>')
?>
That code works which means my variables are correct

<link rel="alternate" type="application/rss+xml" title="<?php echo ($cat) ?>" href="<?php echo ($acfolder.'rss.php?get_cat='.$cat) ?>" />
This code doesnt work... can anyone fix it for me?




#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 07 October 2006 - 01:29 AM

Just one way to do it!

<link rel="alternate" type="application/rss+xml" title="<?=$cat;?>" href="<?=$acfolder;?>rss.php?get_cat=<?=$cat;?>" />


me!

#3 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 07 October 2006 - 01:30 AM

Explain isn't working.

#4 JustNeedHelp

JustNeedHelp
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 07 October 2006 - 01:32 AM

aww no.. when u view ource this comes up:
<link rel="alternate" type="application/rss+xml" title="" href="rss.php?get_cat=" />


#5 JustNeedHelp

JustNeedHelp
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 07 October 2006 - 01:44 AM

Bump...

Can anyone help me with this?

#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 07 October 2006 - 01:53 AM

Dont Bump threads!

Are you sure $cat is defined?

#7 JustNeedHelp

JustNeedHelp
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 07 October 2006 - 01:57 AM

Sorry about the bump.

And it must be because the other code works with $cat in it >>

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 07 October 2006 - 02:02 AM

And it must be because the other code works with $cat in it >>


So maybe 'short tags' aren't enabled for you, if you used printf's solution.
Legend has it that reading the manual never killed anyone.
My site

#9 JustNeedHelp

JustNeedHelp
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 07 October 2006 - 02:04 AM

They are....

#10 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 07 October 2006 - 04:45 PM

Can we see where these lines are located in your script? Is the one that works before or after the one that doesn't work? Are either of them in a function? We need to see more of your script to be able to help you. Having seen two lines out of context does us no good.

Ken




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users