send an array to another php file

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Apr 29, 2014 9:07 am

send an array to another php file

Postby PersianHero » Tue Apr 29, 2014 9:13 am

Hi everyone;
I've got a php script ends with:

Code: Select all

$params = "NUMBER: ".$NUMBER."\n"."NAME: ".$NAME."\n"."PRODUCT: ".$PRODUCT";
header("Location: http://mysite/retrieve/msg?result=done");

I would like to print $params in retrieve/msg/index.php.
somthing like this:

Code: Select all

NUMBER: 1393

Any idea?

php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: send an array to another php file

Postby seandisanti » Tue Apr 29, 2014 10:06 pm

The ways you can pass values from one page to another are with forms ($_POST/$_GET ), cookies ($_COOKIE ), sessions($_SESSION ), databases(PDO ),or files (fopen() ) They each have their own strengths and weaknesses

Return to “PHP coding => General”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests