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 9270699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:26:04+00:00 2026-06-18T15:26:04+00:00

I’m looking for a simple solution to reduce the length of my GET input

  • 0

I’m looking for a simple solution to reduce the length of my GET input code (on my website).

The forms are handled in JavaScript and, using a function, made simpler for URL sharing. For example: multiple form inputs, with different names, are converted into a simple settings=1,0,0,1 and placed in the URL as GET – this data is then exploded/imploded in PHP to use/re-use the input.

But, given the size of the form, it can still get pretty bloated. I’d like to compress that same data in the JavaScript and then decompress it in the PHP, allowing considerably shorter URLs for sharing.

Think TinyUrl. I did some googling, but solutions were more complex than I’d like – this isn’t an attempt to hide data, but simply make it shorter.

Update: A better example of what I want is to to convert a long GET input like: settings=1,1,1,1,1,1,1,1,1,1,1,1,1 into settings=s8djh.

  • 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-06-18T15:26:06+00:00Added an answer on June 18, 2026 at 3:26 pm

    You could create your own “short URLs” like this: Create a unique id from the parameters (for example a md5 hash) and store the id-parameter pair in the data store.

    You can use a database, key-value-store like BerkeleyDB or a noSQL db or flat text file that stores two values.

    If the MD5 hash is still too long, you have two options: 1) Just use a counter that is counted up for each parameter string you store. Note however, that each of the parameter combinations can then be reached by simple URL manipulation. The other option would be to create a random n-character string (n at least >= 4), look if it exists in the database. If it does not exist, use the string as the id. If it does exist, try 2-5 times with nerw strings and if they all exist, bump up n by one. As time passes, you will fill up the 4-char namespace, then the 5-char namespace, etc. The 6-char namespace (using upper- and lowercase and digits) allows for 62^6 combinations – a lot to fill up!

    See this introductory article for some example code. It uses MD5 hashes encoded in base62 for the hashes, making them less than the usual 32 hexadecimal chars long.

    Edit: If you don’t want to use a data store, maybe using an actual compression algorithm like LZW in JavaScript may shorten long rows of identical parameters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am using JSon response to parse title,date content and thumbnail images and place
I have a small JavaScript validation script that validates inputs based on Regex. I

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.