Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

send an array to another php file

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
NAME: IMAN
PRODUCT: NOKIA



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

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 http://www.youtube.com/watch?v=CEl3bhCBjtI ), cookies ($_COOKIE http://www.youtube.com/watch?v=tOuym4a7XjY ), sessions($_SESSION http://www.youtube.com/watch?v=TOMLpOSlkto ), databases(PDO http://www.youtube.com/watch?v=dF8hoPj-1bc ),or files (fopen() http://www.youtube.com/watch?v=QFuk_2d1guo ) They each have their own strengths and weaknesses
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

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

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.