NickG21 Posted January 3, 2007 Share Posted January 3, 2007 hey everyone im looking to make a signup form that will be located on 6 different forms. i want to make it so each form is loaded individually while storing all of the previous information into a session variables. is there anyway i can do this without going through these pages and declaring 50 different variables to store the individual data? any help is appreciatedthank you Link to comment https://forums.phpfreaks.com/topic/32755-solved-session-variables/ Share on other sites More sharing options...
trq Posted January 3, 2007 Share Posted January 3, 2007 You could just use something like...[code]<?php session_start(); foreach($_POST as $key => $var) { $_SESSION[$key] = $var; }?>[/code]If thats not helping you'll need to be clearer in your explination. Link to comment https://forums.phpfreaks.com/topic/32755-solved-session-variables/#findComment-152491 Share on other sites More sharing options...
NickG21 Posted January 4, 2007 Author Share Posted January 4, 2007 will that code go through and take every individual piece that is submitted and put the name and value into a specific key of the session?To try and be a little more clear of my whole purpose i have a signup for service page broken into 6 different sections. i am trying to have the user fill in one section, click a next button and have the next form load on the same page and store all of the information into either one or multiple session variables that will be able to be viewed and accessed after the 6th and final form is submitted.hope that helps a little more Link to comment https://forums.phpfreaks.com/topic/32755-solved-session-variables/#findComment-152912 Share on other sites More sharing options...
trq Posted January 4, 2007 Share Posted January 4, 2007 [quote]will that code go through and take every individual piece that is submitted and put the name and value into a specific key of the session?[/quote]Yes. Everything submitted via post will ned up in a session variable, the session variables key would be the same as that of the post. Link to comment https://forums.phpfreaks.com/topic/32755-solved-session-variables/#findComment-152917 Share on other sites More sharing options...
NickG21 Posted January 4, 2007 Author Share Posted January 4, 2007 do you know what the syntax would be for me to just print out all of the variables onto a page just so i can test to make sure they store correctly? Link to comment https://forums.phpfreaks.com/topic/32755-solved-session-variables/#findComment-152969 Share on other sites More sharing options...
effigy Posted January 4, 2007 Share Posted January 4, 2007 [code=php:0]echo '<pre>', print_r($_SESSION, true), '</pre>';[/code] Link to comment https://forums.phpfreaks.com/topic/32755-solved-session-variables/#findComment-152984 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.