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
https://forums.phpfreaks.com/topic/170128-array-forwarding/#findComment-897579
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
https://forums.phpfreaks.com/topic/170128-array-forwarding/#findComment-897587
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
https://forums.phpfreaks.com/topic/170128-array-forwarding/#findComment-897593
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.