Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
A little gps() question
Hi at all.
I have this page
<html>
<head></head>
<body>
<txp:php>
$post=gps('obj');
print_r($post);
</txp:php>
<form method="post">
<p>Association<input type="text" name="obj[ass]" />
Address <input type="text" name="obj[adr]" />
City <input type="text" name="obj[city]" /></p>
<p>First user <br />
First Name <input type="text" name="obj[usr][1][first]" />
Second Name <input type="text" name="obj[usr][1][second]" />
Age <input type="text" name="obj[usr][1][age]" /></p>
<p>Second user <br />
First Name <input type="text" name="obj[usr][2][first]" />
Second Name <input type="text" name="obj[usr][2][second]" />
Age <input type="text" name="obj[usr][2][age]" /></p><input type="SUBMIT" name="save" value="Iniva" />
</form>
</body>
</html>
If I execute this page on my local host i read all array():
Array (
[ass] => VSP
[adr] => via tal dei tali
[city] => Como
[usr] => Array (
[1] => Array (
[first] => Pippo
[second] => Pippetta
[age] => 10
)
[2] => Array (
[first] => Pluto
[second] => Pippetta
[age] => 13
)
)
)
If I execute this page on online web server i obtain this output:
Array (
[ass] => Vsp
[adr] => via tal dei tali
[city] => Como
[usr] => Array
)
For you, what is the trouble?
Last edited by ruud (2011-12-19 12:32:56)
Offline
Re: A little gps() question
Hi
why not use adi_gps plugin that turn post and get variable into textpattern variable? is easiest no? (dont forget to add html=1” to adi_gps as a security option)
Cheers
Offline
Re: A little gps() question
What happens if you do print_r($_POST);
?
Is there a difference in PHP versions or configuration between your local setup and the other webserver?
Offline
Re: A little gps() question
Dragondz. Why use adi_gps in ther is an internal function?
Ruud If I print print_r($_POST);
I obtain a correct array data!
Array (
[ass] => VSP
[adr] => via tal dei tali
[city] => Como
[usr] => Array (
[1] => Array (
[first] => Pippo
[second] => Pippetta
[age] => 10
)
[2] => Array (
[first] => Pluto
[second] => Pippetta
[age] => 13
)
)
)
On my local host I have PHP Version 5.3.3-1 on webserver PHP Version 5.2.6-1.
About php configuratio I don’t know difference..
Last edited by MarcoK (2011-12-19 13:54:05)
Offline
Re: A little gps() question
Although I can’t find anything about this in the PHP changelogs, I suspect it’s related to differences in how the function “array_map” works in the PHP version on your webserver (compared to your local install).
You may want to submit this as a bug (in TXP) and suggest the use of “array_walk_recursive” instead of “array_map”… and/or (and this is probably good idea anyway) upgrade the PHP version on the webserver.
Last edited by ruud (2011-12-19 14:48:28)
Offline
Re: A little gps() question
thanks
Offline
Pages: 1