Log in

View Full Version : confused....



insanemonkey
10-01-2007, 03:57 AM
Ok I added a script to my site on the mainpage..
it show the last 5 posted messages on my forum..
but the thing is, it only works on the index page and won't show on anyother pages.. ill post code below..



<?php
include "connect.php";


$blog_postnumber = 5;
if(!isset($_GET['page'])) { $page = 1;}else { $page = (int)$_GET['page'];}$from = (($page * $blog_postnumber) - $blog_postnumber);
$getthreads="SELECT * from forum where parentid='0' order by lastrepliedto desc LIMIT $from, $blog_postnumber";
$getthreads2=mysql_query($getthreads) or die("Could not get threads");while($getthreads3=mysql_fetch_array($getthreads2)){ $getthreads3[title]=strip_tags($getthreads3[title]);
print "<ul>
<li><A href='forums/forums/message.php?id=$getthreads3[postid]'>$getthreads3[title]</a><BR></ul>";
}

?>


thats my code... and for an example..
goto http://www.xudas.com
and goto the about page or contact us page. it doesn't show up anything???

PLZ HELP THNX!!!

tech_support
10-01-2007, 06:55 AM
Warning: Your title isn't describing your problem. Please read the new policy on thread titles (http://www.dynamicdrive.com/forums/showthread.php?t=24882).

Because you have in the URL ?page=contact_us, so it'll try and convert "contact_us" into a number.

insanemonkey
10-01-2007, 08:47 AM
is there a way to fix this.. I neeeed help... that so wierd...

if there is a way to fix it how would i go about doing this...

plz... thanks

tech_support
10-01-2007, 09:01 AM
Change the URL structure of the page.

And, SPELL dude.

insanemonkey
10-02-2007, 07:58 AM
is there a way to keep my url that way without changing anything but the coding.. or do i have to go back to seperate regular urls...

sorry for my abbreviations lol.. I'll try not to do that..

tech_support
10-02-2007, 08:00 AM
<?php
include "connect.php";


$blog_postnumber = 5;
if(!isset($_GET['p'])) { $page = 1;}else { $page = (int)$_GET['p'];}$from = (($page * $blog_postnumber) - $blog_postnumber);
$getthreads="SELECT * from forum where parentid='0' order by lastrepliedto desc LIMIT $from, $blog_postnumber";
$getthreads2=mysql_query($getthreads) or die("Could not get threads");while($getthreads3=mysql_fetch_array($getthreads2)){ $getthreads3[title]=strip_tags($getthreads3[title]);
print "<ul>
<li><A href='forums/forums/message.php?id=$getthreads3[postid]'>$getthreads3[title]</a><BR></ul>";
}

?>

And get it in the form ?p=1, not ?page=1

insanemonkey
10-02-2007, 09:06 PM
Thankyou so much.. it works now...