...

View Full Version : Help on redirect on submit



itsmeyousaid
07-25-2007, 12:48 PM
Here is my script that submits a url string to invoke a text message.


<?php
// Constant Information(Make sure to edit only things between "" or else this may effect the program.)
$companyid = "sendpassword"; //sendpassword
$password = "password"; // PASSWORD
$userid = "myid"; // User ID
$providerurl = "https://myproviderurl"; // 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>

The script works fine as it is, however once submitting (send message) the url is posted and user is left at a white screen. My question is how can I still submit the url string to my provider while redirect to a "message sent" page. Any ideas would be greatly appreciated

rafiki
07-25-2007, 12:51 PM
header ("Location: $providerurl&CompanyId=$companyid&UserId=$userid&Password=$password&Msisdn=$tosend&MessageT ext=$message&OasText=$senderid");

itsmeyousaid
07-25-2007, 01:00 PM
Isn't the link you posted already in my script?

rafiki
07-25-2007, 01:10 PM
you are using {} in your script, and missed out an &, you should only use {} if your using an array like
{$row['URL']}&amp;text={$_POST['msg']}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum