0

I'm working on a company intranet system and have a function to load a form via include while passing an url encoded array in GET format

$draftcook = urlencode(serialize($draft));
include(FORM_PATH .'newrangesubtypeform.php?draft=yes&type='.$value.'&draftcook='.$draftcook);

Unfortunately my array has gotten too long to be able to be passed via a url, I have tried many other alternatives, including setting the array into a session variable and then pulling it through in the included form but that for some reason is unable to see the session variable.

Could someone please suggest a work around for this situation, the array itself is likely to have upward of 1000 fields in it by the time the whole page is completed if that effects the solution.

Thanks

2 Answers 2

1

You can write into db or file a threat (id, draftcook) and pass the PK of the threat vía URL and then get the draftcook

Sign up to request clarification or add additional context in comments.

Comments

1

Included code runs in the same scope as wherever you called include. I'm not even sure why you're passing this stuff info the new file; any variable that exists can be used in the include.

So you can access $draft as a regular variable already.

1 Comment

I was under the impression it should of ran like that, however it was giving me errors of the var being undefined, even trying simple single var declarations then calling from the form field was failing

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.