Welcome Guest, Not a member yet? Register   Sign In
Ajax concatenate query
#11

(07-12-2017, 11:12 AM)ivantcholakov Wrote: @pippuccio76

Use the browser development tools to see the response itself, especially the returned HTTP status code. Probably it is not 200, this is is why you see the message "Chiamata fallita, si prega di riprovare...".

If it is 404 - there is a problem about routing;
if it is 500 - there is an error within code - see the response body, the error would be echoed there.

403 (Forbidden)
Reply
#12

403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...
Reply
#13

I don't know how many options you plan to have, but if your options are limited, you might consider putting all of the options data in hidden inputs as JSON. Put the JSON in the value with PHP's json_encode function. Let javascript use the JSON by using JSON.parse. I do it often, and it works well.
Reply
#14

(07-12-2017, 03:37 PM)skunkbad Wrote: I don't know how many options you plan to have, but if your options are limited, you might consider putting all of the options data in hidden inputs as JSON. Put the JSON in the value with PHP's json_encode function. Let javascript use the JSON by using JSON.parse. I do it often, and it works well.


In italy there are 20 Regioni , 107 Province ,8100 Comuni . But this is to learn too ...
Reply
#15

(07-12-2017, 12:19 PM)ivantcholakov Wrote: 403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...

It's a free host this is the page :

link with ajax problem
Reply
#16

(07-13-2017, 09:13 AM)pippuccio76 Wrote:
(07-12-2017, 12:19 PM)ivantcholakov Wrote: 403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...
It's a free host this is the page :

link with ajax problem
I change the code of metdod with a value (costant) instead a $_POST value , the problem is the same , but if i visit the link :

link

the method work correctly
Reply
#17

(07-13-2017, 09:44 AM)pippuccio76 Wrote:
(07-13-2017, 09:13 AM)pippuccio76 Wrote:
(07-12-2017, 12:19 PM)ivantcholakov Wrote: 403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...
It's a free host this is the page :

link with ajax problem
I change the code of metdod with a value (costant) instead a $_POST value , the problem is the same , but if i visit the link :

link

the method work correctly

Problem partially solved :

if i set $config['csrf_protection'] = FALSE;


the ajax call work , but is it secure ?

How can i secure the script ?
Reply
#18

(This post was last modified: 07-13-2017, 10:46 AM by Paradinight.)

(07-13-2017, 09:44 AM)pippuccio76 Wrote:
(07-13-2017, 09:13 AM)pippuccio76 Wrote:
(07-12-2017, 12:19 PM)ivantcholakov Wrote: 403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...
It's a free host this is the page :

link with ajax problem
I change the code of metdod with a value (costant) instead a $_POST value , the problem is the same , but if i visit the link :

link

the method work correctly

funny it work for me Big Grin

edit:

ok, i see you changed the site :/
Reply
#19

(This post was last modified: 07-13-2017, 10:52 AM by Paradinight.)

(07-13-2017, 10:44 AM)pippuccio76 Wrote:
(07-13-2017, 09:44 AM)pippuccio76 Wrote:
(07-13-2017, 09:13 AM)pippuccio76 Wrote:
(07-12-2017, 12:19 PM)ivantcholakov Wrote: 403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...
It's a free host this is the page :

link with ajax problem
I change the code of metdod with a value (costant) instead a $_POST value , the problem is the same , but if i visit the link :

link

the method work correctly

Problem partially solved :

if i set $config['csrf_protection'] = FALSE;


the ajax call work , but is it secure ?

How can i secure the script ?

you need to return a new token.

https://www.codeigniter.com/user_guide/l...rgery-csrf

return a json string with the html and the token
Reply
#20

(This post was last modified: 07-13-2017, 11:38 AM by pippuccio76.)

(07-13-2017, 10:52 AM)Paradinight Wrote:
(07-13-2017, 10:44 AM)pippuccio76 Wrote:
(07-13-2017, 09:44 AM)pippuccio76 Wrote:
(07-13-2017, 09:13 AM)pippuccio76 Wrote:
(07-12-2017, 12:19 PM)ivantcholakov Wrote: 403 (Forbidden)

This only you can investigate at your place. Windows, Linux? Check the php file permissions? Something within code (authentication)? Something within .htaccess? Similar complaint at StackOverflow? ...
It's a free host this is the page :

link with ajax problem
I change the code of metdod with a value (costant) instead a $_POST value , the problem is the same , but if i visit the link :

link

the method work correctly

Problem partially solved :

if i set $config['csrf_protection'] = FALSE;


the ajax call work , but is it secure ?

How can i secure the script ?

you need to return a new token.

https://www.codeigniter.com/user_guide/l...rgery-csrf

return a json string with the html and the token

I use form_open() but i don't understand wath i have to do ....
Reply




Theme © iAndrew 2016 - Forum software by © MyBB