Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help on redirect on submit

    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}&MessageT ext={$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

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    PHP Code:
    header ("Location: $providerurl&CompanyId=$companyid&UserId=$userid&Password=$password&Msisdn=$tosend&MessageT ext=$message&OasText=$senderid"); 

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Isn't the link you posted already in my script?

  • #4
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    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']}


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •