URL Request Without redirecting page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iris
Forum Newbie
Posts: 18
Joined: Wed Sep 10, 2008 4:25 am

URL Request Without redirecting page

Post by iris »

I ve no idea of a way to Call a page that sends SMS through url parameters

http://www.sendsms.com/send.php?usernam ... r=phonenum

When the page is called from a processing page it sends the messages in the mess parameter.

The problem now is, i would like to send SMS to more than one recipient calling from a loop of phone numbers but the first request takes me away from the processing page cos i m using header("location: http://www.sendsms.com/send.php?usernam ... r=phonenum") to send the message.

how can it be done without redirecting from the processing page

Note: The SMS page "www.sendsms.com/send.php" is a third party page i pay for and i have no access to its contents
pl_towers
Forum Newbie
Posts: 12
Joined: Tue Jan 27, 2009 12:59 pm

Re: URL Request Without redirecting page

Post by pl_towers »

I had a similair issue once, i used the file_get_contents() function, worked for me.
iris
Forum Newbie
Posts: 18
Joined: Wed Sep 10, 2008 4:25 am

Re: URL Request Without redirecting page

Post by iris »

I had a similair issue once, i used the file_get_contents() function, worked for me.

Pls, can you explain how you used it in code i realy need it urgently. i have tried similar things but it does nt seem to work.

Thanks.
pl_towers
Forum Newbie
Posts: 12
Joined: Tue Jan 27, 2009 12:59 pm

Re: URL Request Without redirecting page

Post by pl_towers »

in your while() loop instead of using header("location: http://www.google.com") use file_get_contents("www.google.com")

the file_get_contents() will call the page and return its content, which will in your case send a message at the same time.

If you still have issues post your code and ill add it in
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: URL Request Without redirecting page

Post by susrisha »

have you tried doing the same using curl?? Its a lot better than redirecting the user to the page. You can have multiple curl executions and then get the result and display / do whatever you want with the returned page contents. try posting your code and i will get the proper code for the curl execution.
Post Reply