#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    1
    Rep Power
    0

    Could Someone Please Tell Me Which Language Should I Use


    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="(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 (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.

    exemple.com/...loadlink[login]=USERNAME&params[pass]=PASSWORD&params[link]=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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    165
    Rep Power
    18
    Please post in appropriate forums. Javascript would be much more suitable of a forum
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    165
    Rep Power
    18
    well just consider what your trying to do. Youneed to request a page from an API while passing a GET variable. However without telling us much about the api i cant really guide you. Most API will reply with XML. Now i am assuming this API came with documentation as well but maybe not.

    Now to communicate with api especially if you dont want your user to know your using this api then you need to use a server side language most likely PHP or ASP. I prefer PHP. Now i am assuming the API is responding with an XML document so we will use PHP SimpleXML extension as it is well simple.
    PHP Code:
    $USERNAME="";
    $PASSWORD="";
    $LINK="";
    $apiUrl="exemple.com/...loadlink[login]=$USERNAME&params[pass]=$PASSWORD&params[link]=$LINK";
    $xml simplexml_load_file($apiUrl); 
    This will request and load the url specified to it as a resource loaded into $xml. The simplexml extension can then be used to parse values from this data

IMN logo majestic logo threadwatch logo seochat tools logo