Passing a variable not working at Apache 2.2.21/PHP 5.3.8

Hi All,

I’m working on a script that uses the JQwidgets’s grid framework. Instead of the pure .js files, I’m using .php files to generate the JS code. In some cases (when passing a variable through the $_GET command), the script does not work what it is supposed to because the variable is not passed to the other php script. It IS working on my other machine with Apache 2.2.9/PHP 5.2.6 that’s why I thought it is a server issue. I even tried to replace the php.ini file at my machine with the newer version (Apache 2.2.21) and it WORKED.
Here’s the part of the script :


var source =
            {
                datatype: "json",
                datafields: [
					 { name: 'id', type: 'number' },
					 { name: 'task_name', type: 'string' },
					 { name: 'task_worked_by', type: 'string' },
					 { name: 'task_id', type: 'number' },
					 { name: 'project_id', type: 'string' },
					 { name: 'task_notice', type: 'string' },
					 { name: 'task_cost', type: 'string' },
					 { name: 'units_spent', type: 'number' },
					 { name: 'units_label', type: 'string' },
					 { name: 'sub_total', type: 'string' },
					 { name: 'finished', type: 'number' },
					 { name: 'timestamp', type: 'string' }
                ],
                id: 'id',
                url: '../grid/jqwidgets/controllers/project_details_controller.php?action=<?=$action;?>',
				
		deleterow: function (rowid, commit) {
                    // synchronize with the server - send delete command
                    var data = "delete=true&id=" + rowid;
                    $.ajax({
                        dataType: 'json',
                        url: '../grid/jqwidgets/controllers/project_details_controller.php?action=<?=$action;?>',
                        data: data,
                        success: function (data, status, xhr) {
                            // delete command is executed.
				commit(true);
                        }
                    });
                },
            };

How can I change the script to pass the variable ‘action’ REGARDLESS of the server version and php.ini configuration? Is it possible at all?
Thank you in advance.

Huh… Debugging line-per-line… It turned out this line caused the problem :


$task_sub_total = number_format($task_sub_total, 2, ',', '.');

I was trying to format the number to make it more readable… Is there a better method (which is not dependent on server/php.ini configuration) to format the number?

Hi Dujmovicv!

I’d looked at your thread yesterday and it appeared to be a PHP problem rather than server-related.

Saying that, you indicate that $task_sub_total was in error but didn’t show how/where it was used. Same comment, though, about $action in the first post. Before I get into a function, I ensure that all the output variables are set (preferably pre-entry so I’m never calling a variable which has not been set but at least initiated within the script so it can output something expected).

To account for the different responses, there must be something in the configuration of your php.ini files which is initializing a variable on your behalf. In other words, try to get both php.ini files and compare with a product like WinMerge or BCompare for the answer (to the different responses).

Sorry, that’s the best I can offer with what you’ve provided.

Regards,

DK