-2

I have a param A and its 25000 characters long. How to send param A with GET method in php?

 $kq=0;
 $msg1= strtr(base64_encode($msg), '+/=', '-_,');              
 $Title1=strtr(base64_encode($Title), '+/=', '-_,'); 
header("Location:".JRoute::_('./index.php/i0702?'.'kq='.$kq."&Title=".$Title1."&Msg=".$msg1));

Note: strlen($msg1)> 25000 characters. Now, How send with post method?

mum
  • 1,637
  • 11
  • 34
  • 58

3 Answers3

1

The maximum characters you can send from GET method is 3000. Use POST method.

<form method="POST" action="your/url/to/open.php">

    <input type="text" value="<?php echo $a; ?>" />
    <input type="submit" />

</form>
Starx
  • 77,474
  • 47
  • 185
  • 261
1

The maximum size of an http request relies both on client and server to handle it... and it changes depending on what combination of client/server you are using.

This is an explanation of why a 25K HTTP GET request is not feasible in the real world unless you can choose both the client and the server you are operating on (definitely not an internet site, maybe for an intranet application).

Switching to an HTTP POST request is recommended (an HTML form can handle this). If this is not possible for you, you should consider refactoring your application data flow.

Community
  • 1
  • 1
Luca Putzu
  • 1,438
  • 18
  • 24
0

Since you're redirecting within the same page, save the large data server-side in a session or database and only put a small id which allows you to retrieve this data again into the URL.

deceze
  • 510,633
  • 85
  • 743
  • 889