0

I would like to know how can I access or read the array from another php.

I mean that I am working on a .php page which contains the array and I want to display the content of that array but on another .php page.

for example I used the following method in a .php file and I want to get the content of the array in another .php file. what is the method that is going to receive the array's content in the second page?

<?php

$r= new HttpRequest('http://localhost/sameh.php', HttpRequest::METH_POST);
$r->addPostFields ( array ( "n" => 'welcome to our server')) ;
$r->send ();

?>

* This code is in the first page but I don't know what to write to receive it on the second one. so what is the method that can help me with this?

4
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by diafol
0

If you want to pass the array to another module, make it a session variable. That way it remains available to all modules as long as the session is alive.

0

store the array in one variable
e.g.

$a = array(array()array());

Edited by mike_2000_17: Fixed formatting

0

Maybe my question was not that clear and sorry about that ,, I want to find a way to access the array that is defined inside the HttpRequest() class on another page. So that the array "n" that include value "heba" will be displayed on another.php page. this is what make me thinking that the problem is on how to access the content of the array on the second page.


I tried the session and It sends the array to another page ,, but when I tested with the httpRequest() method it doesn't send the content of the array "heba" to the second page.

Thanks for your help.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.