Click here to Skip to main content
15,896,726 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionImage Upload Problem Pin
indian2212-Jun-09 1:46
indian2212-Jun-09 1:46 
AnswerRe: Image Upload Problem Pin
Marc Firth15-Jun-09 3:39
Marc Firth15-Jun-09 3:39 
AnswerRe: Image Upload Problem Pin
Syed M Hussain17-Jun-09 5:29
Syed M Hussain17-Jun-09 5:29 
Questionpipeing proc_open() output over a period of time Pin
SalilJain7-Jun-09 6:56
SalilJain7-Jun-09 6:56 
AnswerRe: pipeing proc_open() output over a period of time Pin
Marc Firth11-Jun-09 22:02
Marc Firth11-Jun-09 22:02 
News[Announce] PyJumble v1.0.0 Pin
PavanPareta5-Jun-09 3:40
PavanPareta5-Jun-09 3:40 
QuestionPHP and code flow... Pin
angusmann4-Jun-09 18:50
angusmann4-Jun-09 18:50 
AnswerRe: PHP and code flow... Pin
Marc Firth4-Jun-09 22:03
Marc Firth4-Jun-09 22:03 
Good Question. There are many ways you can do this.

I would use an array stored in a session variable ("$tasks" - see below). I'd also have each page save data as you go along and refer to everything using a Unique ID - so that if you get halfway through and realise you need to do something else you can go off and do something else and the data will be stored.

I also suggest putting the code that stores a page's data to the database into a function so that you can reference it from any other file. This way, if your form has 5 possible exit points - you only need to write the code that stores the data once.

When you reach a point where they will be redirected to a new page add the current page to the tasks array:

$tasks = $_SESSION['tasks'];
$tasks[] = "/editInvoice.php?id=$invoiceid";
$_SESSION['tasks']= $tasks;

....
(on the next page: )

$tasks = $_SESSION['tasks'];
$tasks[] = "/editCustomer.php?id=$custid";
$_SESSION['tasks']= $tasks;

Then when a task is complete you can pop the array and redirect to the popped item:

$redirect = array_pop($tasks);
$_SESSION['tasks']= $tasks;

header("Location: $redirect");


GeneralRe: PHP and code flow... Pin
AtliThor5-Jun-09 8:52
AtliThor5-Jun-09 8:52 
GeneralRe: PHP and code flow... Pin
angusmann5-Jun-09 15:13
angusmann5-Jun-09 15:13 
QuestionLinux tutorials Pin
matjame4-Jun-09 3:53
matjame4-Jun-09 3:53 
AnswerRe: Linux tutorials [modified] Pin
Jimmanuel4-Jun-09 4:51
Jimmanuel4-Jun-09 4:51 
AnswerRe: Linux tutorials Pin
N a v a n e e t h15-Jun-09 2:17
N a v a n e e t h15-Jun-09 2:17 
GeneralRe: Linux tutorials Pin
matjame18-Jun-09 3:27
matjame18-Jun-09 3:27 
GeneralRe: Linux tutorials Pin
N a v a n e e t h18-Jun-09 15:07
N a v a n e e t h18-Jun-09 15:07 
GeneralRe: Linux tutorials Pin
matjame18-Jun-09 22:04
matjame18-Jun-09 22:04 
AnswerRe: Linux tutorials Pin
Sebastian Schneider15-Jun-09 23:32
Sebastian Schneider15-Jun-09 23:32 
QuestionHow to get INR symbol "Rs". Pin
jaraldumary3-Jun-09 19:14
jaraldumary3-Jun-09 19:14 
AnswerRe: How to get INR symbol "Rs". Pin
Marc Firth3-Jun-09 21:54
Marc Firth3-Jun-09 21:54 
QuestionPHP misses url parameters Pin
platinum19123-Jun-09 12:15
platinum19123-Jun-09 12:15 
AnswerRe: PHP misses url parameters Pin
Marc Firth3-Jun-09 21:53
Marc Firth3-Jun-09 21:53 
AnswerRe: PHP misses url parameters Pin
fly9044-Jun-09 1:42
fly9044-Jun-09 1:42 
GeneralRe: PHP misses url parameters Pin
platinum19124-Jun-09 8:28
platinum19124-Jun-09 8:28 
AnswerSolution Found Pin
platinum19124-Jun-09 12:00
platinum19124-Jun-09 12:00 
Questionphp Pin
mrs gbolagun1-Jun-09 4:44
mrs gbolagun1-Jun-09 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.