Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/41602-solved-echo-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.