Welcome our webmaster and SEO forum
Please enjoy the forum, contribute what you can, and wind up the Moderators!
Closed Thread
Results 1 to 2 of 2

Thread: encrypt and decrypt query string

  1. #1
    hanusoftware is offline Junior Member hanusoftware is on a distinguished road
    Join Date
    Jun 2007
    Posts
    1

    Default encrypt and decrypt query string

    Mentioned below is a PHP function , which can be used to navigate pages generated from the select query . ie. in the form of << Previous || Next >>

    <?


    function PagerNextPrevious(&$sql,$pagesize,$class='txt'){

    // Set Default Page Size to 20
    if($pagesize=="")
    $pagesize=20;
    $page=get_post('page');
    if($page!='NA'){
    $beg=($page-1)*$pagesize;
    $end=$pagesize;
    }else{
    $beg=0;
    $end=$pagesize;
    $page=1;
    }
    $rs=mysql_query($sql) ;
    $nrows=mysql_num_rows($rs);
    $sql=$sql." limit $beg,$end";
    $rs=mysql_query($sql);
    $subrows=mysql_num_rows($rs);

    if($nrows!=0){
    $from=(int)($beg)+1;
    $totalpages=(int)($nrows/$pagesize);
    $frac=($nrows/$pagesize);
    if(($frac-$totalpages)>0)
    $totalpages+=1;
    echo "( Page $page of $totalpages )&nbsp; &nbsp;&nbsp; ";
    if($page>1 ){
    echo "<a class=$class href='".selfq()."&page=".($page-1)."'> &lt;&lt;Previous </a>";
    }
    $next=$page+1;
    if($next <=$totalpages ){

    echo "&nbsp;&nbsp;&nbsp;<a class=$class href='".selfq()."&page=".$next."'> Next &gt;&gt; </a>";
    }

    }
    }

    // Assuming you have Opened connection to mysql database.

    $sql=" Select * from Products ";

    // Show the pager link in form of Previous||Next

    PagerNextPrevious($sql,20,'text');

    $rs=mysql_query($sql);
    if(mysql_num_rows($rs)>0){
    while($row=mysql_fetch_array($rs)){
    echo $row["ProductName"]."<br>";

    }
    }




    ?>

  2. #2
    temi's Avatar
    temi is offline Facilitator temi is just really nice temi is just really nice temi is just really nice temi is just really nice temi is just really nice
    Join Date
    Jun 2003
    Location
    London, England.
    Posts
    10,304

    Default

    Hanussoftware, thanks for that, I will add to your reputation after you introduce yourself at the intro forum which can be found here: http://forums.ukwebmasterworld.com/n...-introduction/ but thanks for that code snippet

    * Build a shopping cart for your business with eCommerce software UK
    * BossCart.com can build you a.
    Register your domain names at Velnet
    ::
    Add Eco sites to The Green Directory free of charge.
    Use LBS Free PHP Directory Script . Web Hosting Blog

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. PAGERANK retrieval = automated query
    By maxseo in forum Webmaster Toolbox
    Replies: 1
    Last Post: 02-22-2007, 05:11 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0

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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124