By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 1,990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

PHP Script - How to track courier service using tracking number from my website.

aveeva
P: 32
I need like,

http://www.trackcourier.in/

The customer chooses selected courier service and enters tracking id then clicks its redirect to the appropriate courier service website.

eg: If tracking id 12345 the redirect link should be https://www.fedex.com/apps/fedextrac...&cntry_code=in

How to do for India courier services?

My code:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML>
  2. <html>  
  3. <body>
  4.  
  5. <form action="#" method="post">
  6. Select Courier :
  7. <select name="courier">
  8.   <option value="">--Please choose an option--</option>
  9.   <option value="professional_courier">Professional Courier</option>
  10.   <option value="india_post">India Post</option>
  11. </select>
  12.  
  13. Trackingid: <input type="text" name="trackingid"><br>
  14. <input type="submit">
  15.  
  16. </form>
  17.  
  18.  
  19.  
  20. <?php 
  21. if (!empty($_POST)): header("Location: https://www.tpcindia.com/Tracking2014.aspx?id=".$_POST["trackingid"]."&type=0&service=0");
  22. endif;
  23. ?>
  24.  
  25. </body>
  26. </html>
  27.  
Now I have added only one courier service, how can i add more than one courier service URL
1 Week Ago #1
Share this Question
Share on Google+
1 Reply


aveeva
P: 32
Final Code :

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML>
  2. <html>  
  3. <body>
  4.  
  5. <form action="#" method="POST">
  6. Select Courier :
  7. <select name="courier">
  8.   <option value="">--Please choose an option--</option>
  9.   <option value="professional_courier">Professional Courier</option>
  10.   <option value="india_post">India Post</option>
  11. </select>
  12.  
  13. Trackingid: <input type="text" name="trackingid">
  14. <input type="submit">
  15.  
  16. </form>
  17.  
  18. <?php
  19. if(isset($_POST['courier']))
  20. {
  21.     if(isset($_POST['professional_courier']))
  22.     {
  23.         if (!empty($_POST)): header("Location: https://www.tpcindia.com/Tracking2014.aspx?id=".$_POST["trackingid"]."&type=0&service=0");
  24.     }
  25.  
  26.     else(isset($_POST['india_post']))
  27.     {
  28.         if (!empty($_POST)): header("Location: https://www.dhl.com/en/express/tracking.html?AWB=".$_POST["trackingid"]."&brand=DHL");
  29.     }    
  30. }
  31. ?>
  32. </body>
  33. </html>
  34.  
Any help, Thanks.
1 Week Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.