Php & query string variables in a url

I've been scratching my head for a couple days now. What I'm
trying to do seems soooooo easy but it doesn't work. Maybe someone
can spot my problem in the code.
What I'm doing is breaking a single blob mysql field into
multiple "pages" by inserting a code snippet into the field. That
part works fine. The url for the page in question with a sample
article is
http://208.106.143.80/articles/articles.php?idq=141&cat=4&pg=1
The url contains the article id, article category and page
number. At the bottom of the page is the pagination that reloads
the page with another "page" of the article. The code for that is:
$totalpages = $total;
if ($totalpages > 1) {
echo "<p
style='text-align:right;'><strong>Page:</strong> ";
if ($i > 1) {
echo " <a
href='".$_SERVER['PHP_SELF']."?pg=".($i-1)."'><<
Prev</a> ";
for ($x = 1; $x <= $totalpages; $x++) {
if ($x == $i) {
echo "<strong>[".$x."]</strong> ";
else {
echo "<strong><a
href='".$_SERVER['PHP_SELF']."?pg=".$x."'>".$x."</a></strong>
if ($i < $total) {
echo " <a
href='".$_SERVER['PHP_SELF']."?pg=".$k."'>Next
>></a></p>";
Basically all I'm doing is throwing the new querystring pg=$x
to the end of the current page url and reloading the current page.
And that is the problem. Even though the page links look right in
the browser, it just keeps loading the same "page" over and over
again. I can go into the url in the browser and manually change
from page 1 to page 2, etc. and that works as it should.
Ideas from anyone smarter than I?
What am I missing here.

.oO(aerobicdesign)
>Hi Peter. No, that I can add if need be. But if you go to
the link I provided
>to you below, then go down to the bottom of the page and
click on any of the
>page numbers, eventhough the link appears to be correct
(as in the pg=x
>changes), the page, when it reloads, is still the same
page.
The response from the server is somewhat broken. In some
browsers this
might lead to a reload of the current page, in others like
Opera and
Lynx you'll get a "Object Moved" response instead, containing
a link to
the same page.
This is your posted link:
http://208.106.143.80/articles/articles.php?idq=141&cat=4&pg=1
These are the links at the bottom of that article:
http://208.106.143.80/articles/articles.php?pg=2
http://208.106.143.80/articles/articles.php?pg=3
But of course this won't work.
> It is like something is just eating up the querystring
I'm sending to that
>page.
No, you're just not creating a complete query string. The
article and
category IDs are missing, so the script doesn't know what to
display.
Micha

Similar Messages

  • Query string variable from "loaderInfo.parameters" always "undefined"

    I've searched the internet and these forums and found plenty of information on accessing query strings using loaderInfo.parameters but they're all written for ActionScript in the Timeline and none of them work for me.
    This is my HTML:
                 ...which is a modification of the HTML that Flash generates, which I'm eventually not going to be using but this is for quick testing purposes. I have read that Flash's "AC_RunActiveContent.js" has to be modified to use the flashVars parameter, but does it have any affect on query strings appended to a URL?
    The variable I want is swfid (=3).
    eamchartmaster04.fla has a Document class, EAMChartMaster.as. Within that I have the following ActionScript:
    // class constructor public function EAMChartMaster() {                // set this as the parent object                myParent = this;                myParent.loaderInfo.addEventListener(Event.COMPLETE, loaderComplete);           } private function loaderComplete(myEvent:Event):void {                myLoaderInfo=myParent.loaderInfo.parameters;                testTxt.text = String(myParent.loaderInfo.parameters.swfid);                           } 
    testTxt is ALWAYS "undefined".
    I've also tried creating an Object (eg. myQueryStrings), loading loaderInfo.parameters into that object and then accessing it as a property of the object (eg. myQueryStrings.swfid) to no avail.
    Note the "myParent" object is created for scoping to other classes, but I used it here in desperation because "this" and "this.root" did nothing, but they should all be the same thing.
    Thanks for any help!

    I looked into my own question about AC_RunActiveContent.js, and why yes, it does need to be addressed, no matter how you want to pass your variables. So in addition to appending the query on the filenames in the HTML object section, it also goes in the javascript in the HTML like so:
    <script language="javascript">
        if (AC_FL_RunContent == 0) {
            alert("This page requires AC_RunActiveContent.js.");
        } else {
            AC_FL_RunContent(
                'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
                'width', '800',
                'height', '500',
                'src', 'eamchartmaster04',
                'quality', 'high',
                'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
                'align', 'middle',
                'play', 'true',
                'loop', 'true',
                'scale', 'showall',
                'wmode', 'window',
                'devicefont', 'false',
                'id', 'eamchartmaster04',
                'bgcolor', '#ffffff',
                'name', 'eamchartmaster04',
                'menu', 'true',
                'allowFullScreen', 'false',
                'allowScriptAccess','sameDomain',
                'movie', 'eamchartmaster04?swfid=3',
                'salign', ''
                ); //end AC code
    </script>
    Similar things would have to be done with SWFObject, I assume.
    At least I know my actionscript-fu is not weak.

  • How to retrieve query string value from the URL in my portlet

    Hi,
    When user clicks on "Advance Search", i am redirecting to page in the community. At the same i am adding some more values to the query string (to the URL).
    My URL will look like this.
    http://ctp-mc0149/portal/server.pt?space=CommunityPage&parentname=CommunityPage&parentid=0&in_hi_userid=200&cached=true&control=SetCommunity&PageID=202&CommunityID=200&searchType=2
    Now in one of my portlet in that page, i want to retrieve the query string values from the URL.
    Please help me regarding this.
    Thanks in advance.
    Thanks,
    sreekanth.

    Hi,
    Look at the following threads,
    For programmatically getting the iview properties,
    Programmatically getting iView Properties
    Also,
    Get Properties of IView Programmatically
    Permanent change of iView property programmatically
    Hope these threads help u.
    Regards
    Srinivasan T

  • MODIFY THE RESPONSE HEADER VALUE IN IIS BASED ON THE QUERY STRING IN THE REQUESTED URL

    We Hosted a directory on IIS.
    The Files in the directory are saved with a Guid values.
    when there is a request from the client for a given resource ,we need to fetch the file name from the query string and modify the reponse header :" Content-Disposition",So that the User can Download with the requested name

    Sounds like a question for the ASP.NET forums:
    http://forums.asp.net
    Or the IIS forums in case you want to write some kind of module to do this without involving ASP.NET:
    http://forums.iis.net/

  • Setting SharePoint 2010 Form Fields Using Query String Variables

    Hi All,
    I have a requirement to populate sharepoint form field value with query string while uploading document to document library.
    While uploading the document to document library, I want to populate claim number available from query string in a pop up page i.e in my case EditForm.aspx, Located at
    http://servername:port/sitename/documentlibraryname/forms/EditForm.aspx.
    Additional Information:
    Created document library and added custom columns like claim number etc..
    Created a view to filter uploaded documents as per claim number.
    Server Details:
    Windows Server 2008 R2
    SharePoint 2010
    SQL Server 2008 R2
    I have written javascript for the same, but not sure where exactly to add the code in EditForm.aspx page.
    Any help on this would be greatly appreciated.
    Thanking you in advacne.
    Regards
    Seva

    if the NewForm.aspx contain a "New Item Form" or "Edit Item Form" you can populate the form field by doing the following:
    First for the data view create a parameter from query string and give it the claim_number query string name.
    now for the field Claim Number Convert it to normal ASP.NET TextBox example below for this
    Normal Field will be like this
    <SharePoint:formfield runat="server" id="ff5{$Pos}" ControlMode="Edit" FieldName="ClaimNumber" ItemId="{@ID}" __designer:bind="{ddwrt:DataBind('u',concat('ff5',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@ClaimNumber')}" />
    you will change it to
    <asp:TextBox runat="server" id="ff5{$Pos}" __designer:bind="{ddwrt:DataBind('i',concat('ff5',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@ClaimNumber')}" />
    Now in the asp:TextBox you can add the "Text" Attribute and assign the created data view parameter to it example below
    <asp:TextBox runat="server" id="ff5{$Pos}" Text="{$Claim_Number}" __designer:bind="{ddwrt:DataBind('i',concat('ff5',$Pos),'Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@ClaimNumber')}" />
    Where {$Claim_Number} is your Query String Parameter.
    Now if you send the query string NewForm.aspx?Claim_Number=1232
    you should see the field populated
    This what I do usually to populate the fields
    How I Bought a Brand New $1.2 Million Home Using ONLY Affiliate Commissions
    I'm having the same problem.... allmost
    I have a querystring I wan't to parse into a form. But on editform, not newform. then the field gets populated, but on save, nothing happens.... It's just blank.... any ideas.?
    /Ulrich

  • Flash, AS3, PHP, & Query Strings

    I think what I am after is pretty simple but unfortunately, I
    don't know much php. Basically what I am looking for is this.
    I want to pass a query from the browser address to a flash
    document.
    For Example, if someone visits.
    http://www.whatever.com/tour?mls=123456789
    (or tour.php?mls=123456789, whatever is easiest)
    A document opens, resizes the browser (optional but would be
    nice), and loads a flash SWF. It also passes the mls=123456789
    string into flash to a variable mls.
    Any ideas?
    Thanks!
    Drew

    Try: URLLoaderDataFormat.VARIABLES

  • ColdFusion: onload pass a variable via query string

    Hey guys - I have a form on a page that creates a coupon code (something like 879COUPON) and emails it to the user when they submit the form. They are also taken to a thank you page after submitting the form.
    What I want is to pass the variable (879COUPON) via query string to an outside URL (www.notmysite.com?id=879COUPON) when the thank you page loads.
    I use ColdFusion to generate the code, so is there a ColdFusion way to automatically send the query string when the second page loads? Or do I need to do some kind of ColdFusion/JavaScript hybrid?

    Thanks for the reply.  I just want to pass the query string info to the page without actually going to the page.  I also want it to be automatic when they arrive on the first page, the second page would then recieve the query string info and the person on the page would not be aware of it being passed (i.e., they wouldn't have to click a link).

  • Include XML payload as URL query string

    Hello Gurus -
    I have a business requirement that I'm hoping you all can help me with:
    Scenario: Send XML message from SAP XI to a third party system via the Receiver Plain HTTP Adapter
    I need to include the actual XML message as a query string in the target URL at the time of posting. The content of the XML message is determined within XI message mapping and will not be known until runtime, so the URL determination will need to be dynamic.
    For example - a target URL with the "xmldata=" query string:
    http://server01/receiver.asp?xmldata=<?xml version="1.0" encoding="UTF-8"?><headertag><tag1><value1></tag1></headertag>
    Does anyone know how to do this - Is there some communication channel configuration and/or programming that would work?
    Thanks to all!
    Chad

    Hi,
    This is very similar to our scenario. By manipulating some of the Plain HTTP Adapter parameters, my colleague was able to post using xmldata. He set content type to text/plain then set the prolog to xmldata=. Let me know if this worked.
    Regards

  • Portal URL Query String

    I am creating a Portal component and I want to catch the query string passed thru Portal url.
    Example:
    Suppose If user login thru this URL
    http://localhost:50000/irj/portal?userID=test
    I want to catch this userID=test in my component.
    Is it possible?
    Many Thanks,
    B Das
    Message was edited by: B Das

    Hi Das,
    HttpServletRequest Object contains many methods like
    HttpServletRequest servletRequest = request.getServletRequest();
    servletRequest.getRequestURL();
    servletRequest.getQueryString(); -->
    servletRequest.getParameter();
    servletRequest.getProtocol(); etc..
    Hope this helps..
    Regards,
    Karthick K Eswaran

  • Why does Firefox remove the URL from the query string?

    Hello there,
    I've writing a servlet to read data from a file stored on a server. I'm using an HTTP <INPUT TYPE=file > element to locate the file to be read. When I run the servlet using IE as the browser it works fine. When I try running it using Firefox, the path to the file is not included in the query string. The full URL to the file shows up in the file input text field but then mysteriously disappears from the query string. Without the path, the servlet can't locate the file and the servlet fails. How do I get Firefox to include the path in the query string or is there some other workaround for this problem. I want my servlet to work on all types of browsers.
    thanks,
    grant

    Well you may also ask it the other way. Why does Microsoft send the full path file with the input type="file" component?
    The purpose of this control is to upload a file from the client to the server. That file is sent with the request.
    It does not allow you to browse server files at all. Most probably you are working on your developer machine where the client IS the server, so it works right now.
    It won't once they're seperate.
    <input type="file"> is the wrong tool to use to browser the server. You need to write your own html pages to do that.
    Cheers,
    evnafets

  • Example to use Query String in Oracle Access Manager Policy.

    Hi All,
    Can any one please tell me what is the use of Query String and Query String Variable in OAM Policy?
    If possible please explain with a sample example.
    Thanks in Advance.
    Siva Pokuri.

    Query string is used to protect URL with complete query string.
    Ex: in case you want to protect http://hi.com/first.html?uid=abc&pqr=123 URL then you will specify query string as uid=abc&pqr=123.
    In case you want to protect a URL with one of the query parameter as xyz and you do not care of other query parameters, then query string variables are used.
    Ex: in case you want to protect http://hi.com/first.html?uid=abc&pqr=123 and http://hi.com/first.html?uid=abc&pqr=456 both with same policy then you will create a policy to protect first.html and in query string variables you will specify uid=abc.
    Let me know if you have any problems in understanding this.
    Thanks
    Kiran Thakkar

  • Query string access in jsp

    I want to access the query strings from this URL. http://localhost:8080/napstersBank/imageone.jsp?39,23
    I tried javascript method window.location.search.substring(1); but i want to implement it in JSP due to security reasons.
    How to extract the query string from the above URL.
    Thank you in Advance

    I am not sure of what exactly the question is.
    Are you asking about how to access variables in JSP ? Or how to pass a parameter from an HTML page to a SWF ?
    Here:
               'meetingModule.html?roomURL=<%= roomURL  %>&authToken=<%= token %>',
    you are simply passing variable to the HTML page. From there you need to use javascript to parse the query string and pass the values to your SWF.
    If you look at the ExternalAuthentication examples they all do something similar.

  • Reverse proxy query strings

    Hi
    got a reversse proxy running but no url's are cache where a query string is in the url. gif,doc, pdf are cached ok. what the max value for query-maxlen? will it accept 2000?
    any other ideas to check and try. i can't see any log into to tell my why it not cachiiiing these requests.

    version 4.0 b 05/10/2005
    request url is /wcm001/idcplg?idcservice=SS_Get_page&nodeid=308
    URL DB cache /wcm001/idcplg
    User clicks on page tab and requests wcm001/idcplg?idcservice=SS_Get_page&nodeid=309&sssourcenodeid=308
    nothing happens, the home page i displayed agian.
    query_maxlen=2000. set it to 32 and no difference. HTML header traces show web browser did make a new request to the proxy server for the different query string

  • Keeping query strings despite an automatic 302 redirect

    is there anyway for a query string to persist despite an automatic 302 redirect by the server??
    for instance if my site has a 'tmp' directory and i want to pass a parameter to the index page in 'tmp'
    ... but I go to
    http://www.mysite.com/tmp?qvar=something
    in a browser, the server will automatically do a 302 redirect to
    http://www.mysite.com/tmp/
    so the query string variable is lost.
    i thought about having a filter run, to pick off the query string variable before the redirect, but the filter will only run after the redirect happens.
    any insight would be great.
    thanks.

    This might help: http://www.mail-archive.com/[email protected]/msg00353.html

  • Get name of query string parameter in JSTL

    Is there a way to get only the query string name in a URL in JSTL?
    i.e.
    http://www.mysite.com/mypage.jsp?name=value
    and return "name" as a string. I can't seem to find any documentation saying this is possible.

    If I am using c:out or any of the jstl-core tags I don't think the request.getXYZ functions will work in tandem. (Correct me if I'm wrong). It seems like they are called before the request is called (my terminology is awful, sorry). So by the time request.getParameterNames() is called, <c:out value = ""/> has already finished - hence I can't use the value from request.getParameterNames(). I guess I wasn't clear when I asked the question that that is what I wanted to do.
    This isn't exactly what I wanted but it will work:
    <c:forEach var='parameter' items='${paramValues}'>
    <c:out value='${parameter.key}'/>
    </c:forEach>
    at http://www.informit.com/articles/article.asp?p=30946&seqNum=7
    I answered my own question but thanks anyway.

Maybe you are looking for

  • My iPod says it needs to be activated and then says Activation Error, also won't connect to iTunes. Help?

    My iPod Touch says it needs to be activated. I go to activate it using wifi and it comes up with Activation Error: this device is not registered as part of the iPod Developer Program. I'm not a memeber of that. I'm not even an developer, I'm 14. My i

  • Blank screen after boot

    I was running a fairly resource intensive program and went off to do something else. Upon return, the restart windows prompt had appeared (for updating to build 9926) but was unresponsive and stopped me from interacting with the screen with my mouse.

  • How to add favorite folders to "Save As.." dialog screen

    Hi all, To the Windows Explorer shell it is possible to add favorite folders to the "Save as..." dialog screen (done so by dragging shortcuts to an open "Save as..." screen). [ see screendump for what I am referring to ] Now one would suppose the sam

  • Cannot update 6th gen iPod nano.

    Hi all, I am trying to update music and software but I get the following message .... "The iPod ....... cannot update because it contains files that are in use by another application". I have done a couple of resets and have tried the restore in iTun

  • Could my RAM be causing my problems?

    Like many with early build Core Duo MBPs, I have had the fan issues. My unit just returned from Applecare (for the third time) with both fans replaced, and as usual, they removed my TechWorks 1GB RAM, saying it didn't pass their tests. As I understan