rich w
April 12th, 2006, 17:36
Hi to all, i'm glad to join these forums they look very useful. Thanks to Jamie for introducing me to them.
I've got a really annoying PHP problem.
On my home server, the following code works:
while ($cur_row=mysql_fetch_assoc($result)) {
$_SESSION["hikes"][]=$cur_row["hikeid"];
$_SESSION["routedesc"][]=$cur_row["routedesc"];
}
//print_r($_SESSION);
for ($a=0; $a<count($_SESSION["hikes"]); $a++) {
$routedesc = substr($_SESSION["routedesc"][$a],0,11)."...";
}
The value of $routedesc outputs 3 times, eg. "abcdefg..." "dfsfsdfdsff..." dsfsddf..."
However, when I upload this to another server, I get this output:
"a" "." "."
If I then print the session, I get this:
[routedesc] => ....
Any ideas on what appears to be destroying the session?
Rich
I've got a really annoying PHP problem.
On my home server, the following code works:
while ($cur_row=mysql_fetch_assoc($result)) {
$_SESSION["hikes"][]=$cur_row["hikeid"];
$_SESSION["routedesc"][]=$cur_row["routedesc"];
}
//print_r($_SESSION);
for ($a=0; $a<count($_SESSION["hikes"]); $a++) {
$routedesc = substr($_SESSION["routedesc"][$a],0,11)."...";
}
The value of $routedesc outputs 3 times, eg. "abcdefg..." "dfsfsdfdsff..." dsfsddf..."
However, when I upload this to another server, I get this output:
"a" "." "."
If I then print the session, I get this:
[routedesc] => ....
Any ideas on what appears to be destroying the session?
Rich