Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6803963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:24:31+00:00 2026-05-26T19:24:31+00:00

I am using many get values in one page and making up a hyperlink

  • 0

I am using many get values in one page and making up a hyperlink with adding ?var=value&… each time is time cosuming. I would like to use hyperlinks as a submit button in a form and html would attach the variables to the url right away.

Update: I used this method and it worked fine now.

<a href="index.php?
<? foreach($_GET as $gk=>$gv)
{
echo $gk."=".$gv."&";
} 
?>
pager=
<? echo $i; ?>">
<? echo $i; ?>
</a>

Update 2:
Making url’s is too much of a work, now I decided to use hidden fields in current forms and getting get values as default for the hiddent values. For preserving the get values, I won’t be making a link. I’ll post same get values from a get form. it works just fine. and I like using standard forms because the standard things work best.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:24:31+00:00Added an answer on May 26, 2026 at 7:24 pm

    You could make a function in php that writes all the $_GET variables for you:

    function WriteGetForHyperlink ( $array ) {
        $output = "?";
        foreach ( $array as $key=>$value ) {
            $output .= $key.'='.$value.'&';
        }
        return $output;
    }
    

    Then your HTML link could be:

    <a href='wherever.html<?= WriteGetForHyperlink( $_GET ) ?>'>Link</a>
    

    Doing this will allow you to add more get variables to the end of the link, or you could pass custom arrays (so instead of all the $_GET, maybe only two or three parts of it), and you don’t need to use javascript or have a lot of HTML on a page that is unnecessary.

    OR

    If you were set on using a form, you could do create a form with a bunch of hidden elements:

    <form method='GET' action='wherever.html'>
     <input type='hidden' name='var1' value='1' />
     <input type='hidden' name='var1' value='1' />
     <input type='submit' class='submit-link' value='Link' />
    </form>
    

    Here is some CSS:

    input.submit-link {
        border: none;
        background: Transparent;
        cursor: pointer;
        color: #00f
    }
    input.submit-link:hover {
        text-decoration: underline;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using many checkboxes in a page as the following: <%= check_box_tag(:one, value
A] Summary: Using get or insert functionality on one to many django models, checking
I have a page which tries to get the value from another server using
I am trying to implement a one-to-many relationship using NHibernate 2.1.2 but keep getting
i am trying to persist two entities(with one to many relationship) using jpa but
Really been struggling with this one for some time now, i have many text
I have been in both situations: Creating too many custom Exceptions Using too many
I was browsing for an alternative to using so many shared_ptrs, and found an
I am trying to delete records in many to many using Doctrine. I used
For obvious productivity reasons, I make an effort of learning and using as many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.