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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:22:57+00:00 2026-06-15T07:22:57+00:00

I have a php script the generates links where-by the URL is very long

  • 0

I have a php script the generates links where-by the URL is very long (too long for IE to handle infact) such as www.somesite.co.uk/here/query?foo=bar&bar=foo&..... where somesite.co.uk gets the values (which I can’t change to post).

So in my index.php:

echo "<a href='$url'>".$link."</a>";

All works fine for values of $url that are under the limit the page is seen as expected however if over the limit the data on the page is truncated.

I created this long_url_test.php script and it’s loads the page as expected for long values of $url

<?php
header('Location: $url');
?>

I need help putting this all together, something like:

index.php:

echo "<a href='long_url_test.php'>".$link."</a>"; # and POST $url to script

long_url_test.php:

<?php
$url=$_POST['url']
header('Location: $url');
?>

Where the link displayed on index.php posts the url to long_url_test.php which fetches the actual required page, or indeed is there a better/easier way I should do this?

  • 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-15T07:22:58+00:00Added an answer on June 15, 2026 at 7:22 am

    Why are you generating such ridiculously long URLs? At this point you’re clearly missing out on a better solution like sessions.

    If we just want to slap a bandaid on the solution:

    1. Write a form to the page with a squillion hidden fields with your data in it, then make the link POST the form.
    2. The same as #1, but with javascript.

    Slightly better: Take whatever data you want to pass and run it through base64_encode(serialize($your_data)) and see if you can embed that in the URL without running into the length limit. If you have Zlib installed/enabled you can throw a gzcompress() in there too.

    Still, I have a very hard time imagining that there is not a far simpler/better solution where your data stays server-side.

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

Sidebar

Related Questions

I have written a php script that generates a list of links that match
I have a php script that randomly generates an image. Something like this: <?php
I have a php script (generator.php) which generates certain HTML/XML/SVG depending on various conditions.
I have a script that generates images from text using PHP. It's working fine
So I have a small PHP script that generates an xml feel for the
I have a php script which generates an image, and is used (mainly) like
I have a PHP script (news-generator.php) which, when I include it, grabs a bunch
I have PHP script works without problems, like this : while($row4 = mysql_fetch_array($result4)) {
I have php script that creates a temporary watermark image for users that are
I have a PHP script running on my LAMP server that requires certain files

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.