Jump to content

Array forwarding?


ecopetition

Recommended Posts

One method to not show your data in get parameters is to post this array data only with post methods to another page.

<fom method=post ...>

Another method is to use Sessions to save data in. and then you can access them from $_SESSION array.

 

<?php
session_start();


$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
?>

 

and then in other page you can get variables with:

$favcolor=$_SESSION['favcolor']
.....

 

Third method is to use mysql table to store this array thata only temporary - and to use unique id from mysql_insert_id() with wich you can get again this post variables from second page.

Link to comment
Share on other sites

serializing the array is probably a bad idea, especially if you are putting it in the URL, as anyone can simply alter the data in the variable.

 

I would use either the post method, or the sessions method.

 

Um, GET data is no more/less secure than POST data. A user can modify POST data just as easily than GET data. If you are not validating/cleansing ALL user data (GET, POST & COOKIE) you are not secure.

Link to comment
Share on other sites

serializing the array is probably a bad idea, especially if you are putting it in the URL, as anyone can simply alter the data in the variable.

 

I would use either the post method, or the sessions method.

 

Um, GET data is no more/less secure than POST data. A user can modify POST data just as easily than GET data. If you are not validating/cleansing ALL user data (GET, POST & COOKIE) you are not secure.

 

yes true, but modifying GET data is, for lack of a better word, easier for the end user in my opinion. since it is right there on the URL line, most anyone can figure out how to change the data in a few seconds. then again, if he validates the data it doesn't really matter in the end anyways.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.