0

i want to pass long data value in next file using post method or in URL but it's say Submitted URI too large! how to solve this issue.

2

2 Answers 2

1

you can use $_SESSION

A session is a way to store information (in variables) to be used across multiple pages. Unlike a cookie, the information is not stored on the users computer. - W3Schools

Try this code using session

Index.php

<?php
    //Index Page  Storing variable 
    $_SESSION['var'] = $long_var;
?>

Action.php

<?php
    //Action Page Getting session 
    $long_var= $_SESSION['var'];
 ?>

or use method POST/GET but add hidden input field just like this.

Index.php

<form method="POST" action="action.php">
    <input type="hidden" name="var" value="long_var">
    <input type="submit" name="submit">
</form>

Action.php

<?php 

//getting POST variable from form
$long_var = $_POST['var'];


//getting GET variable from form
$long_var = $_GET['var'];
?>
4
  • it is not a long variable it is long text data like 1000 lines of code that i want to pass in next page and store in to db Commented Apr 18, 2018 at 13:08
  • @JimishGajjar its still the same ? long longblob , or text, they are store in 1 variable whether they are 1000 lines then submitted by form then run the query(insert) to save in your database Commented Apr 18, 2018 at 14:40
  • but 1000 lines code is not pass in form in post method it says it is to large data because in post method there is limit to pass data maximum 65000 character or 1000 lines of code is more then 65000 character. Commented Apr 19, 2018 at 14:12
  • 1
    @JimishGajjar so you used, textarea and already reach the limit, check this link ,next time when you creating post read this first follow the guidance to post a minimal example , many people will help you here. if you add more information on your post, including image or error codes. :) Good luck Commented Apr 20, 2018 at 2:03
0

use PHP_SELF with form action to send character in length more than 65000 characters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.