Skip to Content

Welcome!

This community is for professionals and enthusiasts of our products and services.
Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

This question has been flagged
As a moderator, you can either validate or reject this answer.
Accept Reject
39 Views

When you found some extra parameter in ur ajax url when it run

You can go to check the plugin code

then u can see it using $_REQUEST to getting parameter, which will get the extra parameter for the url


Way to fix:

use Joomla's input handling method to getting the url parameter

// Get Joomla input

$input = Factory::getApplication()->input;


// Debugging: Log POST data

$myfile = fopen("kiple_debug1.txt", "a") or die("Unable to open file!");

fwrite($myfile, print_r($input->post->getArray(), true));


// Check if callback is true


$callback = $input->get('callback', '', 'string');

if ($callback == "true") {

$myfile = fopen("kiple_callback_debug1.txt", "a") or die("Unable to open file!");

fwrite($myfile, print_r($input->post->getArray(), true));


$myfile = fopen("kiple_callback_debug2.txt", "a") or die("Unable to open file!");

fwrite($myfile, print_r($input->getArray(), true));

}

============================================================

Using this method, u can avoid system getting extra parameter for the url


Keypoint:

assign variable to $input->get('callback', '', 'string'); before using it is better since $input->get('callback', '', 'string'); is a method. If assign it to a variable before comparing it, can save system loading time.


Summary:

If you found ur url getting parameter, first step can check whether u r using $_REQUEST to get parameter or not.

Avatar
Discard

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Related Posts Replies Views Activity
0
Mar 25
47
0
Mar 25
31
0
Feb 25
70
0
Feb 25
54
0
Mar 24
71