Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Sending URL parameters without a hyperlink.

New Here ,
Apr 17, 2010 Apr 17, 2010

I am sending URL parameters between pages like so:

<a href="<?php printf("%s?pageNum_Get1=%d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", $currentPage1, min($totalPages_Get1, $pageNum_Get1 + 1), $queryString_Get1, $townstr, $makestr, $modelstr, $countrystr,$bodystr, $neckstr, $boardstr, $pickupsstr, $memberstr, $postcodestr, $colourstr, $offersstr,$valuestr,$valueconditionstr, $yearstr, $yearconditionstr, $conditionstr, $selectorderstr,$selectascdescstr,$tabstr ); ?>"> Next</a>  

This is the code for a 'Next page' function. which uses a hyperlink,  Next

This works fine.

Now, the problem I have is I want to pass these variables from another page, but NOT using a hyperlink.

For example when the page is exited it run the following code:

     $insertGoTo = "index.php";

     if (isset($_SERVER['QUERY_STRING']))

     {
            $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
            $insertGoTo .= $_SERVER['QUERY_STRING'];

     }

      header(sprintf("Location: %s", $insertGoTo));

How do I add the URL parameters to this code so that the information is passed between the pages?

Thanks

Adam

TOPICS
Server side applications
393
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 21, 2010 Apr 21, 2010
LATEST

I would think you can use the same technique with a redirect as you would with a link. I'm no good with php, but it would look something like:

$insertGoTo = "index.php?pageNum_Get1="printf("%d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",  min($totalPages_Get1, $pageNum_Get1 + 1),  $queryString_Get1, $townstr, $makestr, $modelstr, $countrystr,$bodystr,  $neckstr, $boardstr, $pickupsstr, $memberstr, $postcodestr, $colourstr,  $offersstr,$valuestr,$valueconditionstr, $yearstr, $yearconditionstr,  $conditionstr, $selectorderstr,$selectascdescstr,$tabstr );

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines