Can anyone help me with this code?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Can anyone help me with this code?
trusttec
CZ Newbie
trusttec has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Sep 18, 2004
0.00 posts per day
Posts: 5
Points: 926
   
hey i was just wondering if anyone here could help me out with this code!

<?php include("<? echo $result_data[5];?>") ?>

I'm pretty sure you cant have to php tags in one string but how else would i make it work? I want to include a file that displays the number of hits a certian link has gotten. Any help is appreciated!



Back to top Reply with quote
#2   Re: Can anyone help me with this code?
madman
CZ Moderator
madman has been a member for over 19 year's 19 Year Member
Status: Offline
Joined: Dec 06, 2004
0.00 posts per day
Posts: 21
Points: 1,234
 Yahoo Messenger  


Originally posted by trusttec @ Sat Dec 18, 2004 5:40 am:

<?php include("<? echo $result_data[5];?>") ?>

I'm pretty sure you cant have to php tags in one string but how else would i make it work? I want to include a file that displays the number of hits a certian link has gotten. Any help is appreciated!

Use this:
<?php include("$result_data[5]"); ?>


More safer code:
<?php if (file_exists("$result_data[5]")) { include("$result_data[5]"); } ?>




_________________
Cheers,
madman
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum