Use arrays on multiple php pages? [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am looking to use an array on 2 seperate pages of php. Not using Sessions a simple array, at the end of my page I use a Submit button to pass on to the 2nd page... how can I save the content of my array and print them on the 2nd page?

You can use cookies to save list of array and fetch on the other page. Arrays in cookies. And if you don't need to use that data again you can delete the cookie

You have to use
encoded json(json_encode($array);) format inside the form
after submit you have to retrieve the data by json_decode($array,true);

Related

Any idea on how to pass a a clicked number from an array to another page without using forms in PHP? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Any idea on how to pass a a clicked number from an array to another page without using forms in PHP?
I want to grab figures from the array and use it for calculations on the second page.
Use $_GET method.
Try, <a href="another_page.php?value=myvalue" class='btn btn-default style-as-button'>My Button</a>,
then on another_page.php check for $_GET['value'].
if (isset($_GET['value'])) {
// do some logic
}

HTML form values into SESSION variable as an array [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a html form with 16 fields (https://secure.high-speed-business-club.com//TEMPLATE-order-form-module/?affiliate=0).
What is the best way to capture all of these field values in a single array to be stored as SESSION variables?
In order to do this you will have to post your form data to a second page and assign your session variables there.
Once they're assigned you will be able to access them anywhere on the site as long as that session is active.
W3 School's tutorial

How to store array data of drag and drop form builder [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to know what's the best way to store array data of a dynamic form builder in mysql databse and retieve them based on each value?
As you are saying your Array is dynamic and you want to store into MySQL.
You can define any one column in DB for this purpose. store the the JSON encoded array output via json_encode() into that field.
And when you want to retrieve those values, just read and decode it via json_decode()
Otherwise there is no sense to create new columns dynamically via code.

How many ways we can pass the variable through the navigation between the pages? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Which is Better And Secure way to Pass the variable through the navigation between the pages?
Three ways can pass the variable through the navigation between the pages:
Put the variable into session in the first page, and get it back from session in the next page.
Put the variable into cookie in the first page, and get it back from the cookie in the next page.
Put the variable into a hidden form field, and get it back from the form in the next page.

Deleting entry from databse by deselcting checkbox in php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have list of checkboxes on web page. What I want is , after deselcting checkbox particular record from database should get deleted accordingly in php.
You'll need to use some javascript to "listen" for the uncheck action on each checkbox. You can then use AJAX to delete the record from the database on the fly, and use jQuery make the record disappear visually from the webpage, all without reloading.

Categories