Jump to content

Recommended Posts

i want to send a request to a website

 

i mean i want a php script to open a website in background

dont want user to see website

 

& i dont want to use iframe or get_file content etc..

bcoz after 30-40 request server give me Error :(

 

& i am trying curl

any fast way to do it ???

i just want to open the website which user give me

 

& also i want something to protect the script from posting same request again & again 

i already added captcha

but still while my code is working on backgroung user didnt see it so they press submit button again & again :(

 

i want so show something like working or loading image in website while the script is being execute

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/
Share on other sites

You need to be more specific with your terms and with your writing of English. Have no idea what all you want to do.

 

1 - you can't open a "website" with the user not being able to see it. What's the point if the user can't see it?

 

2 - Any fast way to do WHAT? User Curl? Finish the project?

 

3 - How does this user "give you a website"? What do you mean?

 

People will probably not respond to you until you make some kind of sense here.

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/#findComment-1510944
Share on other sites

Still have no idea what you want

 

i am using API of a website which allow me to do some task i want to do that task as fast as possible

 

but after 33 contenious server give me

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at admin@abc.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

 

so i want a fast script to submit data given by user & also want to prevent user from this error

 

the only option i can think of is limiting user submit limit to 30 or to 33 to prevent user from the error

 

any better suggestion ?

i limiting is not a good solution :(

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/#findComment-1511069
Share on other sites

The fastest and best way is using curl.

If your host is too slow get a faster one.

If the api is too slow use something else.

i think my api script is slow & the website whose api m using

cant handel alot of contentious  request :(

 

so i have to do something like sending first 30 request firstly & then after some gap maybe 2-5 second have to send another 30 request

or something like that & while request id being send i have to slow user something like "loading........ " or something like that so they dont send same request again & again

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/#findComment-1511070
Share on other sites

 

i think my api script is slow & the website whose api m using

cant handel alot of contentious  request

 

Sure they can be limiting the amount of requests, could act like a ddos attack and take their server down.

 

 

i limiting is not a good solution

I certainly feel it is.

 

First of all why are you doing 60+ api requests a single page load.

Lower the amount per page and create yourself a pagination to get the next set of results their api

Think about what you are doing, a person has to wait a long time and load piles of information they may never even look at. Not to mention your server has to do this each user visiting every page.

 

You can cache the api results and then show your local data if exists first...otherwise connect to api for fresh data

In circumstances like this where the api service has limits ,slow or even down times.....I cache the json responses

 

Other possible ways would be to use a lazy loader with jquery/ajax loading content as a person scrolls the page.

Ever see sites with more...more...more...

Is others that click a button for more

Yet is others that load as you scroll down the page.

 

I will give yet another solution, don't use their api and instead use their feeds. Looks like they show 34 at a time.

Create a feed parser to display latest data or make a feed aggregator.

Keep hitting the feeds in a timely manner and store the data a database

Now you can show as many as desire without going overboard and not have these issues.

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/#findComment-1511080
Share on other sites

sorry but i cant use feed

i have to use the  API

is there is any way to pause the task ?

i mean suppose user send 100 request

 

so can we code a script which will send first 30 request then after 5 second send another 30 then after 5 second another 30 & soo on ..........

 

& script will work in background & while it is working user will get a loading image or a message "please wait" or something like that

 

 

 

a person i know already did it

but he lost his script & he dont have time to code again same thing

 

so i know it is possible i tried to contact him but he is not comming online so he didnt saw my message

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/#findComment-1511088
Share on other sites

In php using delay or sleep would hang the page until entire script completed.

Possible in javascript and why said to use a lazy loader with jquery or combination javascript and ajax

i dont know jquery or javascript or ajax....

 

& ok i will search about delay or sleep

 

& can you help me in showing loading image while the script is working ??

 

i want to clear everything from page just want to show a loading or please wait message until script complete its work

Link to comment
https://forums.phpfreaks.com/topic/296110-how-to/#findComment-1511198
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.