Dynadot — .com Registration $8.99

Help... PHP

Spaceship Spaceship
Watch

Ray

VIP Member
Impact
167
Ok...

i lied the unicode marker is still visibe in firefox? how can this be. I never had this problem before...




Im confused.. My script at http://theymix.com/test21.php?alp=a&page=1 seems to work fine...

However.. combinded with the layout the nav numbers move to the bottom of the results and have a weird  next to them.
http://theymix.com/search/by-letter/t/1/ -- See what I mean...

------------Code Snippet-----------

PHP:
$p = new Pager;
$start = $p->findStart($limit,$id4);
 

$count = mysql_num_rows(mysql_query("SELECT * FROM ---- WHERE LEFT(title,1) = '$alp'"));

$pages = $p->findPages($count, $limit);

$pagelist = $p->pageList($id4, $pages, $urlqry);
echo $pagelist;

$result = mysql_query("SELECT * FROM ---- WHERE LEFT(title,1)='$alp' ORDER BY title ASC LIMIT $start, $limit")
or die(mysql_error());  
while($row = mysql_fetch_array( $result )) {

$word= $row['title'];
$id=$row['id'];

$data = explode(' recipe',$word); 

echo ("<a href=\"http://theymix.com/drink/$id/\">" . $data[0] . "</a><br>");


pagerclass.php
-------------------

PHP:
<?php
class Pager
{
function findStart($limit,$id4)
{
if ((!isset($id4)) || ($id4 == "1"))
{
$start = 0;
$id4 = 1;
}
else
{
$start = ($id4-1) * $limit;
}

return $start;
}
function findPages($count, $limit)
{
$pages = (($count % $limit) == 0) ? $count / $limit : floor($count / $limit) + 1;

return $pages;
}
function pageList($curpage, $pages, $urlqry)
{

$page_list = "";

/* Print the first and previous page links if necessary */
if (($curpage != 1) && ($curpage))
{
$page_list .= "<a href=\"".$urlqry."1/\" title=\"First Page\">First</a> ";
}

if (($curpage-1) > 0)
{
$page_list .= "<a href=\"". $urlqry.($curpage-1)."/\" title=\"Previous Page\">Previous</a> ";
}

/* Print the numeric page list; make the current page unlinked and bold */
for ($i=1; $i<=$pages; $i++)
{
if ($i == $curpage)
{
$page_list .= "<b>".$i."</b>"; 
}
else
{
$page_list .= "<a href=\"". $urlqry.$i."/\" title=\"Page ".$i."\">".$i."</a>";
}
$page_list .= " ";
}

/* Print the Next and Last page links if necessary */
if (($curpage+1) <= $pages)
{
$page_list .= "<a href=\"". $urlqry.($curpage+1)."/\" title=\"Next Page\">Next</a> ";
}

if (($curpage != $pages) && ($pages != 0))
{
$page_list .= "<a href=\"". $urlqry.$pages."/\" title=\"Last Page\">Last</a> ";
}
$page_list .= "</td>\n";

return $page_list;
}
}
?>
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
So is your question why it's printing out those symbols?
I don't think you even gave the code that prints the page numbers...
If you don't feel comfortable posting it, you can PM or email it to me, but we'll probably need more than this small snippet to help.


Bruce
 
0
•••
yes my question is why it is printing out the symbols and why the page list is going to the bottom when it is added to a page.
 
Last edited:
0
•••
It looks like the Unicode byte order mark. You may need to use another editor to remove that from your code.
 
1
•••
Kath said:
It looks like the Unicode byte order mark. You may need to use another editor to remove that from your code.

but its not on there when there is no html atttached to the script

ok.. i got the page list back at the top of the page because i found a $page_list .= "</td>\n";

... however.. i still cannot get rid of those wierd caracters.. i tried opening up in notepage and saving but no luck...

Kath said:
It looks like the Unicode byte order mark. You may need to use another editor to remove that from your code.

thansk mate.... it was byte mark.. i removed it with a script i found...

-- Solved

ok.. i cannot rid of the unicode marker in firefox.. i tried everything...
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back