gnetuk Posted March 22, 2012 Share Posted March 22, 2012 Hi all This is a new one for yas. I want people to send SMS /TXT from my site. I got the form working fine. but it re-directs to the site that povides the sms ?????? how do i call up the prosess automaticlay without diverting from my form/orSITE heres my code <?php if(isset($_POST['submit'])) { $name = $_POST['name']; $msg = $_POST['msg']; header("Location: https://www.smsfun.com.au/api/login.php?mobile=44775080062265&password=100256&send_to=$name&message=$msg&send=1"); echo "User Has submitted the form and entered this phoneNO : <b> $name </b>"; echo "<br>User Has submitted the form and entered this MESSAGE : <b> $msg </b>"; } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="name"><br> <input type="text" name="msg"><br> <input type="submit" name="submit" value="SEND"><br> </form> zthis works Im thinking mabee opening the page and closing it may need a scipt can anyone help all the best gnetuk. Link to comment https://forums.phpfreaks.com/topic/259512-how-do-you-call-a-web-page-and-get-a-result-without-the-page-to-be-seen/ Share on other sites More sharing options...
Adam Posted March 22, 2012 Share Posted March 22, 2012 I would ensure it's not against the ToS first, but you could use cURL to send the HTTP request in the background. http://php.net/manual/en/book.curl.php Link to comment https://forums.phpfreaks.com/topic/259512-how-do-you-call-a-web-page-and-get-a-result-without-the-page-to-be-seen/#findComment-1330305 Share on other sites More sharing options...
gnetuk Posted March 23, 2012 Author Share Posted March 23, 2012 Thanks adam, but i dont understand cURL. Do you have a php script i could use for runnign the prosess in the background then closes the window quickly apart from the form the only code i have is there API witch is . https://www.smsfun.com.au/api/login.php?mobile=44567892265&password=<<YOURPASSWORD>>&send_to=<<TO_NUMBER_INTL_FORMAT>>&message=<<MESSAGE>>&send=1 My form works for the acutual funchtion of sending SMS/TXT messages. but as i say i dont want it to re-dirrect to the smsfun. site try it out http://gnetuk.net/gsms.php Link to comment https://forums.phpfreaks.com/topic/259512-how-do-you-call-a-web-page-and-get-a-result-without-the-page-to-be-seen/#findComment-1330541 Share on other sites More sharing options...
gnetuk Posted March 23, 2012 Author Share Posted March 23, 2012 Thanks adam, but i dont understand cURL. Do you have a php script i could use for runnign the prosess in the background then closes the window quickly apart from the form the only code i have is there API witch is . https://www.smsfun.com.au/api/login.php?mobile=44567892265&password=<<YOURPASSWORD>>&send_to=<<TO_NUMBER_INTL_FORMAT>>&message=<<MESSAGE>>&send=1 My form works for the acutual funchtion of sending SMS/TXT messages. but as i say i dont want it to re-dirrect to the smsfun. site try it out http://gnetuk.net/gsms.php the responce and joobs that come up are my account information i wanted to bypass that and have it go back to my page. Thanks adam, but i dont understand cURL. Do you have a php script i could use for runnign the prosess in the background then closes the window quickly apart from the form the only code i have is there API witch is . https://www.smsfun.com.au/api/login.php?mobile=44567892265&password=<<YOURPASSWORD>>&send_to=<<TO_NUMBER_INTL_FORMAT>>&message=<<MESSAGE>>&send=1 My form works for the acutual funchtion of sending SMS/TXT messages. but as i say i dont want it to re-dirrect to the smsfun. site try it out http://gnetuk.net/gsms.php Link to comment https://forums.phpfreaks.com/topic/259512-how-do-you-call-a-web-page-and-get-a-result-without-the-page-to-be-seen/#findComment-1330542 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.