Hi guys please could you help do this I tried to read about jquery, ajax, json, curl but I just got really lost so I am asking for help to guide me to the right way and thank you so much.
What I want to do is this :
take this from in html
<form method="GET" action="https://exemple.com/.../api/work.php">
<input type="hidden" name="method" value="link"/>
<input type="text" name="params[login]" value="ready" />
</br><input type="text" name="params[pass]" value="download"/></br>
<input type="text" size="80" name="params[link]" placeholder="get ready"/></br>
<input type="submit" formtarget="txt" value="Submit">
</form>
And turn it to this
<form>
<input type="text" size="80" name="params[link]" placeholder="get ready"/></br>
<input type="submit" formtarget="txt" value="Submit">
</form>
<iframe type="hidden" name="txt"></iframe>
I want to validate
– the the first input with name=”method” value=”link”
-the second input with name=”params[login]” value=”ready”
-the third input with name=”params[pass]” value=”download”
to this url https://exemple.com/api/work.php ( This is a different domain “cross domain”) with the GET request
The API that I am using is private I talk to them and they told me that I can share it but I don’t want to share my username and password but I want to share the possibility to check the url using mine the request should be like this.
https://exemple.com/…loadlink%5Blogin%5D=USERNAME¶ms%5Bpass%5D=PASSWORD¶ms%5Blink%5D=LINK
that’s how it should be submitted.
conclusion
I don’t want the visitor the see the url or the 3 inputs they can pnly submit the link they want to check.
Thank you so much I hope someone can guide me to the right way I am so lost now
If you don’t want your password to show, you’ll need to do the actual API call using a server-side language – PHP might be a good one. Doing an HTTP request using it is a simple matter of using
file_get_contents($URL)these days.This means that you will need to pass it the values from the client. Two choices: JavaScript (through AJAX), or a plain old HTTP request.
One thing, though. If the URL structure you’ve given is correct, whoever wrote that API needs to be shot as there is a blatant possibility for CSRF abuse on this.