[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 06-23-2008, 08:22 AM   #1 (permalink)
An American Soldier
 
-Ray-'s Avatar
 
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,630
2.53 NP$ (Donate)

-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold


Help... PHP

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 Code:
$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 Code:
<?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;
}
}
?>
__________________
Completely Free cPanel Hosting
-- Deployed to Afghanistan --
"There is no such thing as rich over-night unless you owned Google stock in 2006"

Last edited by -Ray-; 06-23-2008 at 12:13 PM.
-Ray- is offline  
Old 06-23-2008, 09:00 AM   #2 (permalink)
NamePros Member
 
Join Date: Sep 2006
Posts: 87
100.00 NP$ (Donate)

Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough


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
Bruce_KD is offline  
Old 06-23-2008, 09:12 AM   #3 (permalink)
An American Soldier
 
-Ray-'s Avatar
 
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,630
2.53 NP$ (Donate)

-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold


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.
__________________
Completely Free cPanel Hosting
-- Deployed to Afghanistan --
"There is no such thing as rich over-night unless you owned Google stock in 2006"

Last edited by -Ray-; 06-23-2008 at 09:28 AM.
-Ray- is offline  
Old 06-23-2008, 10:47 AM   #4 (permalink)
Domains my Dominion
 
sdsinc's Avatar
 
Join Date: Aug 2005
Location: Web 1.0
Posts: 6,285
1,095.94 NP$ (Donate)

sdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond reputesdsinc has a reputation beyond repute

Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer
It looks like the Unicode byte order mark. You may need to use another editor to remove that from your code.
__________________
Buy now - MassDeveloper.com $500
sdsinc is online now  
Old 06-23-2008, 10:48 AM   #5 (permalink)
An American Soldier
 
-Ray-'s Avatar
 
Join Date: Jun 2005
Location: Pennsylvania
Posts: 1,630
2.53 NP$ (Donate)

-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold-Ray- is a splendid one to behold


Quote:
Originally Posted by Kath
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...

Quote:
Originally Posted by Kath
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...
__________________
Completely Free cPanel Hosting
-- Deployed to Afghanistan --
"There is no such thing as rich over-night unless you owned Google stock in 2006"
-Ray- is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 04:21 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85