Problems retrieving a post value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jhorra
Forum Newbie
Posts: 24
Joined: Mon Aug 18, 2003 1:00 am

Problems retrieving a post value

Post by Jhorra »

I'm making an ajax call using scriptaculous, and passing it a sortable list via the built in functionality. What it's passing seems to be passed also using the javascript escape function. I'm not sure what happened, but somewhere along the way, all my ajax calls started getting passed that way.

Here is a sample of what's being passed that I captured through firebug:task_list_ul%5B%5D=54&task_list_ul%5B%5D=56&task_list_ul%5B%5D=57&task_list_ul%5B%5D=58

Where you see task_list_ul%5B%5D should be task_list_ul[] because it's going as an array. When I try to grab the post value I get nothing. Before everything started getting passed with the escape function it worked fine grabbing the task_list_ul value, but now I get nothing. I even tried grabbing task_list_ul%5B%5D

Can anyone help me with this?
phpBuddy
Forum Commoner
Posts: 37
Joined: Mon Nov 05, 2007 3:42 am

Post by phpBuddy »

Code: Select all

<?php

$str = 'task_list_ul%5B%5D=54&task_list_ul%5B%5D=56&task_list_ul%5B%5D=57&task_list_ul%5B%5D=58';

echo urldecode($str);
/* output:
task_list_ul[]=54&task_list_ul[]=56&task_list_ul[]=57&task_list_ul[]=58
*/
You pass it with a <form method="post"> .... or is it a GET method?
It is not possible to pass an array directly in URL. (possibly you can use a serialized-array-string)
Only single variables with string values.
Jhorra
Forum Newbie
Posts: 24
Joined: Mon Aug 18, 2003 1:00 am

Post by Jhorra »

I figured it out, these were being passed through post.
Post Reply