chriscloyd Posted March 7, 2007 Share Posted March 7, 2007 okay heres my problem im get a var $for_id when i echo it by its self it shows but when i echo it in a link it wont show heres my code <link href="cl.css" rel="stylesheet" type="text/css"> <?php include("config.php"); //viewtopic.php $topic_id = $_GET['id']; $topic_info = mysql_query("SELECT * FROM cl_topics WHERE top_id = '$topic_id'"); $topic = mysql_fetch_array($topic_info); $old_top_views = $topic['top_views']; $top_views = $topic['top_views'] + 1; mysql_query("UPDATE cl_topics SET top_views = '$top_views' WHERE top_id = '$topic_id' "); $forum_id = $topic['for_id']; $forum_info = mysql_query("SELECT `for_title` FROM cl_forum WHERE for_id = '$forum_id'"); $forum = mysql_fetch_array($forum_info); $mod_all = mysql_query("SELECT * FROM cl_moderators WHERE for_id = '$forum_id'"); $mod = mysql_fetch_array($mod_all); $mod_num = mysql_num_rows($mod_all); if ($mod_num > 1) { $show_mod = 'Moderator: '; } else { $show_mod = 'Moderators: '; } echo '<a href="forums.php" class="headerright">Chaos Legion Forums</a><br> -> <a href="viewforum.php?id="'; echo $topic['for_id']; echo '" class="headerright">'.$forum['for_title'].'</a><br> --> <span class="headerright">'.$topic['top_title'].'</span> '; ?> <a href="javascript:void();" class="style1" onClick="show_hide('topic')">+/-</a> <? if ($mod['username'] == $_SESSION['cluser']) { echo '<img src="images/topic_delete.gif" width="20" height="18" border="0" /> <img src="images/topic_move.gif" width="20" height="18" border="0" /> <img src="images/topic_lock.gif" width="20" height="18" border="0" />'; } echo '<br><br><br>Start Test for $topic[for_id]<br>'; echo $topic['for_id']; echo '<br>End Test for $topic[for_id]<br><br><br>'; //get all topics and post numbers and what not echo '<div id="topic">'; echo '</div>'; echo '<br><br><a href="posttopic.php?id='.$forum_id.'"><img src="images/newtopic.gif" width="82" height="25" border="0" alt="Post new topic"></a> <a href="postreply.php?id='.$topic_id.'"><img src="images/reply.gif" width="82" height="25" border="0" alt="Post reply"></a>'; ?> to view what im talking about and the actual code check here try clicking on general forum thats what im trying to echo it in http://www.chaoslegionclan.net/viewtopic.php?id=1 Quote Link to comment https://forums.phpfreaks.com/topic/41602-solved-echo-problem/ Share on other sites More sharing options...
reshpu Posted March 7, 2007 Share Posted March 7, 2007 hi.... try this code: echo '<br><br><br>Start Test for' .$topic[for_id]'<br>'; echo $topic['for_id']; echo '<br>End Test for' .$topic[for_id]'<br><br><br>'; Quote Link to comment https://forums.phpfreaks.com/topic/41602-solved-echo-problem/#findComment-201564 Share on other sites More sharing options...
chriscloyd Posted March 7, 2007 Author Share Posted March 7, 2007 I think i found the problem in my link i did "" right after id so it wasnt catching the id i echoed Quote Link to comment https://forums.phpfreaks.com/topic/41602-solved-echo-problem/#findComment-201565 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.