Jump to content
Sign in to follow this  
francis Aneke

PARSING VARIABLES WITH ARRAY

Recommended Posts

After fetching my data from the database, all of them were fetched correctly,

but i want to parse all of them to the next page after storing them in an array for easy access on the next page

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

<?php $array = array( $index_id, $weekly_gen_news, $what_is_env, $things_in_env, $need_to_clean, $how_does_env, $african_env, $env_culture, $env_and_event, $cnn_env, $weekly_gen_news ); header("location: echo.php?GetArray=$array"); exit();?>

 

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

and when i parse them, i only see this on the url---->......./ echo.php?GetArray=Array

i tried to get them using $_GET['GetArray'] but its not working

Also how can i display the variables individualy

Share this post


Link to post
Share on other sites

I would recommend storing the values in a session:

session_start();$_SESSION['array'] = array(    $index_id, $weekly_gen_news, $what_is_env, $things_in_env, $need_to_clean, $how_does_env,    $african_env,    $env_culture, $env_and_event, $cnn_env, $weekly_gen_news);session_write_close();header('Location: echo.php');

Read about sessions here: http://www.w3schools.com/php/php_sessions.asp

Share this post


Link to post
Share on other sites

but how can i output them individualy at the echo page using this SESSION

Share this post


Link to post
Share on other sites

A session variable is the same as any other variable. What does echo.php currently have?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...