evdoxos said:How to pass a long array from one PHP Script to another?
My array could have 10000 integers and it is the result from a mysql query.
(I can't execute this query to the target php script, because many other php scripts link to this one passing arrays like this)
jagusa said:Though I am not the master php programmer, it seems like this is the reason to use a database like MySQL in the first place. Do the MySQL query, save the results as an element of a MySQL database, and then pass the MySQL element location from one script to the other.
evdoxos said:How to pass a long array from one PHP Script to another?
My array could have 10000 integers and it is the result from a mysql query.
(I can't execute this query to the target php script, because many other php scripts link to this one passing arrays like this)
Yes it simplifies the matters because: in source scripts he stores IDs only and in the target script he is searching by ID only not by all criteria as he was doing in the source scripts.Daniel said:He's passing a database output anyway, so this wouldn't simplify matters.
I don't understand why he can't just run the DB query again on the final PHP page, would seem a lot simpler. :p
Dan
<a href="page.php<?php echo htmlspecialchars(SID); ?>">Page</a>
Daniel said:I'm going to agree with Peter on this one, sessions is a much more sensible approach. It is indeed what they are designed for.
And to evdoxos, you state that sessions need cookies. But they don't.
Use the PHP variable SID; to append the session ID data.
Code:<a href="page.php<?php echo htmlspecialchars(SID); ?>">Page</a>
Most PHP setups should only append the SID if cookies are off, some servers even have it on by default. (session.use_trans_sid setting if I remember correctly.)
Dan
P.S. Why are you referring to yourself in the 3rd person? :P
file: page1.php
<?php
session_start();
$session = session_name() . '=' . session_id();
// code here
header("location:page2.php?".$session);
exit();
?>
file: page2.php
<?php
session_start();
// code here
?>

