memome Posted July 25, 2007 Share Posted July 25, 2007 Let me start off by saying the script below does work. However once the script is submitted and passes all the setting to my providers' URL to initiate a sms text message. As I stated the script works fine however the output is just a white screen on my providers page (as my script submitted the url). I am looking for a way to redirect users to a different page then the post Any help would be greatly appreciated <?php // Constant Information(Make sure to edit only things between "" or else this may effect the program.) $companyid = "id"; //Company ID $password = "passwoprd"; // PASSWORD $userid = "userid"; // User ID $providerurl = "https://provider.com"; // provider url format of the url provider. if (isset($_POST['submit'])){ $tosend = trim($_POST['tosend']); $message = trim($_POST['message']); $senderid = trim($_POST['sendid']); header ("Location: {$providerurl}CompanyId={$companyid}&UserId={$userid}&Password={$password}&Msisdn={$tosend}&MessageText={$message}&OasText={$senderid}"); } ?> <style type="text/css"> <!-- .style1 {color: #FFFFFF} --> </style> <div align="center"></div> <form name="form1" method="post" action=""> <table width="399" border="0"> <tr> <th width="209" height="24" scope="col"><div align="left" class="style1"><span class="style1">Recipient: </span></div> <label></label></th> <th width="180" scope="col"><input name="tosend" type="text" id="tosend" value="1AREACODENUMBER" size="40"></th> </tr> <tr> <th height="24" scope="col"><div align="left" class="style1">Message:</div></th> <th scope="col"><label> <input name="message" type="text" id="message" size="40" /> </label></th> </tr> <tr> <th height="24" scope="col"><div align="left" class="style1">Sender ID:</div></th> <th scope="col"><label> <input name="sendid" type="text" id="sendid" size="40"> </label></th> </tr> </table> <label> <input type="submit" name="submit" id="submit" value="Send Message" /> </label> <label> <input type="reset" name="clear" id="clear" value="Clear Form" /> </label> </form> Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 25, 2007 Share Posted July 25, 2007 It looks like you're missing a ? in between the page and the parameters you're putting into the URL for your header redirect. Don't know if that will solve your problem or not, but that's the only thing I can comment on. BTW: What do the {}s do? Quote Link to comment Share on other sites More sharing options...
memome Posted July 25, 2007 Author Share Posted July 25, 2007 again the script works, but the ending page is: http://myprovider/setting/$companyid}&UserId={$userid}&Password={$password}&Msisdn={$tosend}&MessageText={$ the script works as it generates a message however what the user sees is just a white page with the address bar filled in. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 25, 2007 Share Posted July 25, 2007 What does this do? header ("Location: $providerurl?CompanyId=$companyid&UserId=$userid&Password=$password&Msisdn=$tosend&MessageText=$message&OasText=$senderid"); Quote Link to comment Share on other sites More sharing options...
memome Posted July 25, 2007 Author Share Posted July 25, 2007 that submits my text message to my SMS HTTP API ..however I still want the script to post there, however my SMS provider does not have any screen that displays message sent (the message does send), I was looking for something a little more pretty Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 25, 2007 Share Posted July 25, 2007 That wasn't a "I don't know what this does so please explain it" question. That was me giving you different code and you running it to see if it fixes it. Quote Link to comment Share on other sites More sharing options...
memome Posted July 25, 2007 Author Share Posted July 25, 2007 I tried and got a 403 on my provider page HTTP Status 403 - type Status report message description Access to the specified resource () has been forbidden. Apache Tomcat/4.1 I don't think the provider offers any ability to check message status, thats why I wanted to redirect to a page of my own. Quote Link to comment Share on other sites More sharing options...
soycharliente Posted July 25, 2007 Share Posted July 25, 2007 I tried fixing the URL because it looks malformed. I don't have any more suggestions. Sorry. Quote Link to comment Share on other sites More sharing options...
stlewis Posted July 25, 2007 Share Posted July 25, 2007 Unfortunately, if you're POSTing to a server/page that you don't have editing control over, there's no way for you to initiate a redirect from that page. The problem is that once you've posted, you've left your original script, so nothing you write in that script can cause a redirect after you post. If you can't edit the page that your information gets posted to, then I'm afraid you're SOL. Quote Link to comment Share on other sites More sharing options...
memome Posted August 1, 2007 Author Share Posted August 1, 2007 Yes but can I submit in the background? Quote Link to comment Share on other sites More sharing options...
mrjcfreak Posted August 1, 2007 Share Posted August 1, 2007 Yes, the answer you want is AJAX. There is a seperate forum for it, but the easiest and painless way of doing it is using a Javascript like mootools to 'ajaxify' the form. (AJAX is the thing behind all the pages with forms that have throbbers and update without refreshing the whole page....) Another option is to add a target="sms" to your form tag, and then use javascript to close that window or write a message to it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.