Jump to content


Photo

Could Someone Please Tell Me Which Language Should I Use !

ajax php jquery

  • Please log in to reply
6 replies to this topic

#1 FrozenHeart1992

FrozenHeart1992

    Newbie

  • New Members
  • Pip
  • 4 posts

Posted 17 November 2012 - 07:52 AM

hi guys please could you help do this i tried to read about jquery , ajax , json 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>
<iframe type="hidden" name="txt"></iframe>

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

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 Xaotique

Xaotique

    Advanced Member

  • Members
  • PipPipPip
  • 558 posts
  • LocationPennsylvania, United States
  • Age:21

Posted 17 November 2012 - 10:32 AM

So you want the form to submit to an off-site webpage, but you don't want the user to see this?

If that's correct, you would want to use PHP and make the request server-side. You could use Javascript to show the data without having to refresh or whatever, but it can't call to another domain for security reasons.

Note that this can cause them to ban your IP if you seem to be spamming them. Some servers are automated to ban or temporarily ban when you request too often. You can bypass some of these with curl. Also, change the hostname (with a big list of them) and you can avoid this a bit. Also, using a proxy can help, but it could also cause it to be slow and if a proxy goes down it will be a failed return.

If I'm wrong, please explain better.

#3 FrozenHeart1992

FrozenHeart1992

    Newbie

  • New Members
  • Pip
  • 4 posts

Posted 18 November 2012 - 08:22 AM

@Xaotique thank you for your replay you are right that's what i want to do , 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[login]=USERNAME&params[pass]=PASSWORD&params[link]=LINK
that's how it should be submitted
you said that i can use curl could you please explain more i will be so glad :)

#4 FrozenHeart1992

FrozenHeart1992

    Newbie

  • New Members
  • Pip
  • 4 posts

Posted 18 November 2012 - 08:23 AM

So you want the form to submit to an off-site webpage, but you don't want the user to see this?

If that's correct, you would want to use PHP and make the request server-side. You could use Javascript to show the data without having to refresh or whatever, but it can't call to another domain for security reasons.

Note that this can cause them to ban your IP if you seem to be spamming them. Some servers are automated to ban or temporarily ban when you request too often. You can bypass some of these with curl. Also, change the hostname (with a big list of them) and you can avoid this a bit. Also, using a proxy can help, but it could also cause it to be slow and if a proxy goes down it will be a failed return.

If I'm wrong, please explain better.



@Xaotique thank you for your replay you are right that's what i want to do , 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[login]=USERNAME&params[pass]=PASSWORD&params[link]=LINK
that's how it should be submitted
you said that i can use curl could you please explain more i will be so glad :)

#5 Xaotique

Xaotique

    Advanced Member

  • Members
  • PipPipPip
  • 558 posts
  • LocationPennsylvania, United States
  • Age:21

Posted 18 November 2012 - 11:23 AM

Well, I can't really explain everything to you since there's quite a bit. You'll have to make sure to have curl configured with your webserver though, so you can use PHP to call the external pages.

As always, php.net: http://php.net/manual/en/book.curl.php

Attached File  Scrape.php   66.87KB   2 downloads
Here's an old file I used to scrape. Hopefully you can learn by example. You'll have to add some of your own code to it if you do copy it if you want to hold a login open or whatever. I used it for a personal script and I needed it to close each time.

More help than php.net probably would be to just Google it. There's so many people that have asked questions about it. I'm sure something will come up from stackoverflow and you'll get examples of whatever you need.

#6 FrozenHeart1992

FrozenHeart1992

    Newbie

  • New Members
  • Pip
  • 4 posts

Posted 18 November 2012 - 11:55 AM

Well, I can't really explain everything to you since there's quite a bit. You'll have to make sure to have curl configured with your webserver though, so you can use PHP to call the external pages.

As always, php.net: http://php.net/manual/en/book.curl.php

Attached File  Scrape.php   66.87KB   2 downloads
Here's an old file I used to scrape. Hopefully you can learn by example. You'll have to add some of your own code to it if you do copy it if you want to hold a login open or whatever. I used it for a personal script and I needed it to close each time.

More help than php.net probably would be to just Google it. There's so many people that have asked questions about it. I'm sure something will come up from stackoverflow and you'll get examples of whatever you need.


Thank you so much you are the best :)

#7 Xaotique

Xaotique

    Advanced Member

  • Members
  • PipPipPip
  • 558 posts
  • LocationPennsylvania, United States
  • Age:21

Posted 18 November 2012 - 05:50 PM

Thank you so much you are the best :)

You're welcome. (:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com