PHP Developers Network
http://forums.devnetwork.net/

Help with get request in Json format
http://forums.devnetwork.net/viewtopic.php?f=13&t=144808
Page 1 of 1

Author:  sjuaq [ Thu Nov 30, 2017 6:43 am ]
Post subject:  Help with get request in Json format


Author:  requinix [ Thu Nov 30, 2017 7:20 am ]
Post subject:  Re: Help with get request in Json format

Are you familiar with Javascript? Ever used things like if statements?

Author:  sjuaq [ Thu Nov 30, 2017 12:52 pm ]
Post subject:  Re: Help with get request in Json format


Author:  requinix [ Fri Dec 01, 2017 2:48 am ]
Post subject:  Re: Help with get request in Json format

You can't do a JSON request to their site.

Make a PHP script on your site
Syntax: [ Download ] [ Hide ]
<?php

if (isset($_GET["email"])) {
        header("Content-Type: application/json");
        readfile("https://api.stopforumspam.org/api?json&email=" . urlencode($_GET["email"]));
} else {
        http_response_code(400);
}

then call that (with the email) in your AJAX.

Author:  sjuaq [ Fri Dec 01, 2017 3:43 pm ]
Post subject:  Re: Help with get request in Json format

Thanks

Author:  VladSun [ Mon Dec 04, 2017 5:15 am ]
Post subject:  Re: Help with get request in Json format

Huh, passthru() ? Isn't it supposed to have a local command as a string parameter? I doubt it has a .

And I strongly advice people to use for getting remote content, instead of relying on unsafe file open calls.

Author:  VladSun [ Mon Dec 04, 2017 5:38 am ]
Post subject:  Re: Help with get request in Json format


Author:  requinix [ Mon Dec 04, 2017 5:42 am ]
Post subject:  Re: Help with get request in Json format


Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/