Welcome Guest, Not a member yet? Register   Sign In
anchor() generates wrong links?

I see no echo statements:
<ul id="newsPosts">    
    &lt;?php if ($verify['available'] === TRUE) : ?&gt;
        &lt;?php foreach($news as $row): ?&gt;
                &lt;li><h1>&lt;?php echo $row['title']; ?&gt;</h1></li>
                &lt;li><h2>Posted by &lt;?php echo $row['user']; ?&gt; on &lt;?php echo $row['date']; ?&gt;</h2></li>
            &lt;?php if($row['image'] != ""): ?&gt;
                &lt;li class="post_body"><img src="&lt;?php echo $row['image']; ?&gt;">&lt;?php echo $row['text'] . anchor($row['archive'], '(read more)'); ?&gt;</li>
            &lt;?php else: ?&gt;
                &lt;li class="post_body">&lt;?php echo $row['text'] . anchor($row['archive'], '(read more)'); ?&gt;&lt;/li>
            &lt;?php endif; ?&gt;
        &lt;?php endforeach; ?&gt;
    &lt;?php else: ?&gt;
          &lt;?php echo $verify['message']; ?&gt;
    &lt;?php endif; ?&gt;
The above code is untested, but should hopefully get you back on the right track.

I've compacted it a bit, and (in theory) made it easier to follow by using the alternative construct syntax, and I got rid of the short tags (even though you're free to replace them). I also noticed that you had an extra opening &lt;ul> in there, and so I removed it.

Thanks I will put this all in when I get home to see if it works. the "extra" <ul> wasn't extra, I have an unordered list of unordered lists Smile

thanks again for the help. I'll let you know how it goes.

You're right. I do apologise, I missed that last &lt;/ul>

huh. would you look at that. it worked. thanks a ton. I didn't know you have to echo those statements

Glad you got it sorted. Smile

[quote author="brianw1975" date="1235122675"]hrm... did you try site_url in place of anchor?



echo site_url("news/local/123");

The above example would return something like: http://example.com/index.php/news/local/123

Here is an example of segments passed as an array:
$segments = array('news', 'local', '123');

echo site_url($segments);

the sound you hear in the distance is me weeping


Quote:the sound you hear in the distance is me weeping


hahaha I was blind but now I see. lol thanks for the help

Theme © iAndrew 2016 - Forum software by © MyBB