Solved

PHP Parse Array

Posted on 2006-06-29
2
303 Views
Last Modified: 2008-03-10
Hi Experts,

pg1.php sent a form to pg2.php as $_POST['return'], pg2.php extracted the array data within $_POST['return'] and used the data.

Now I need to send that same array to pg3.php and extract the data from the array.

The array contains nothing but a list of id numbers.

Data must be parsed when they click a Send Email Link.

Please Help!

Thanks in advance
0
Comment
Question by:etechnicsit
  • 2
2 Comments
 
LVL 40

Accepted Solution

by:
RQuadling earned 250 total points
ID: 17016004
Add it to a session in pg2.php which can be read in pg3.php

<?php // pg2.php
session_start();
$_SESSION['Previous_POST'] = $_POST;

// continue with ph2.php
?>

<?php // pg3.php
session_start();

// NOTE: This will overwrite any $_POST supplied.
$_POST = $_SESSION['Previous_POST'];

// Alternatively, leave $_POST alone and just use $_SESSION['Previous_POST'] as an array.

// Continue with pg3.php
?>
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 17016013
If pg2.php contains a form which also uses POST, then you could ...

<?php
$s_POST = serialize($_POST);

$s_hidden_post = '<input type="hidden" name="Previous_POST" value="' . $s_POST . '">';

// Now use $s_hidden_post in the form somewhere.

echo <<< END_HTML
<form method="POST" action="./pg3.php">
$s_hidden_post
<input type="text" name="something">
<input type="submit">
</form>
END_HTML;
?>
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now