php - Paginating MySQL Results with User Values from HTML Form -
i'm not great php, i've got project working pretty expected. last piece getting pagination work correctly. correctly, mean retaining submitted form values past page 1. looked sessions , seems overkill i'm passing results get
.
again, pagination works, doesn't retain form values. i'm working query on same page, figured use $_server['request_uri']
, reason when in href
of pagination, either breaks page , nothing displayed, or generates url doesn't resolve correctly— myurl.com/$_server['request_uri']?p=2—
as opposed having values get
.
thoughts on this? think i'm missing character or brackets or (again, php isn't forte).
thanks help!
function pagination($page,$num_page) { echo'<ul style="list-style-type:none;">'; for($i=1;$i<=$num_page;$i++) { if($i==$page) { echo'<li style="float:left;padding:5px;">'.$i.'</li>'; } else { echo('<li style="float:left;padding:5px;"><a href="$_server[\'request_uri\']?p='.$i.'">'.$i.'</a></li>'); } } echo'</ul>'; } if($num_page>1) { pagination($page,$num_page); }
Comments
Post a Comment