Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    121
    Plugin Contributions
    0

    Default Re: How to use MoveNext();

    Some companies will let you use an API which will allow you to display the details in your orders history page which is more complex, but overall a nice feature to have. You will likely need to have an account with the shipping company though.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: How to use MoveNext();

    Design75, thank you for correcting that, especially for those not familiar with PHP "construct" (spelling... )

    Regarding application of this method of shipping info I still think this method of uri rewrite to obtain tracking info off of the web address regardless of who is asking is a less than desirable solution... The request should be posted to the next page which should validate that the request came from a ZC (customer) "user" otherwise, you may find the destination uri to be abused by other "visitors". Further if the input is not properly protected "upon receipt" may be open to other "trouble".
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    May 2008
    Location
    United States
    Posts
    490
    Plugin Contributions
    1

    Default Re: How to use MoveNext();

    mc12345678 worked perfect thank you! You are talented my friend wish I was able to code like that!

    Going to play around with it right now it echos to the top of the page as follows:

    This order shipped in 3 boxes: Package 0: Click to Track Package 1: Click to Track Package 2: Click to Track

    Is there a way to make Package count start at 1 not 0?

    Regarding application of this method of shipping info I still think this method of uri rewrite to obtain tracking info off of the web address regardless of who is asking is a less than desirable solution... The request should be posted to the next page which should validate that the request came from a ZC (customer) "user" otherwise, you may find the destination uri to be abused by other "visitors". Further if the input is not properly protected "upon receipt" may be open to other "trouble".
    The input is protected by Google reCAPTCHA and the following:

    PHP Code:
      if (!empty($order_number) && ctype_digit($order_number) && preg_match('/^[0-9]{8}+$/'$order_number) && $error==false) { 
    So basically only a valid 8 digit order number (which is randomly generated at the time of order) is accepted otherwise nothing happens you receive an error to enter an 8 digit number, is that good?

  4. #4
    Join Date
    May 2008
    Location
    United States
    Posts
    490
    Plugin Contributions
    1

    Default Re: How to use MoveNext();

    Trying to redirect before echoing so I can format the results nicely on a new page, but it's not working. I think the output needs to be put into variables before doing this right?

    PHP Code:
    $order_number=$_POST['order_number'];
      
    $track_rs $db->Execute("SELECT tracking_number FROM fulfill_tracking WHERE order_number = " . (int)$order_number);
      if (
    $track_rs ->RecordCount() == 1) {
        
    $track_num $track_rs ->fields['tracking_number'];
    header('Location: http://example.com/' $track_num);
      } elseif (
    $track_rs ->RecordCount() > 0) {
        
    $track_num = array();
        while(!
    $track_rs->EOF) {
          
    $track_num[] = $track_rs ->fields['tracking_number'];
          
    $track_rs->MoveNext();
        }
          
    zen_redirect(zen_href_link(FILENAME_TRACKING'action=multiple_packages'));

    echo 
    'This order shipped in ' sizeof($track_num). ' box' .(sizeof($track_num) != 'es' '') . ':';
    echo 
    "\n";
    foreach (
    $track_num as $key => $val) {
      echo 
    'Package ' $key ':  <a href="http://example.com/' $val '">Click to Track</a>';
      echo 
    "\n";
    }
      
      } else {
          
    $messageStack->add('tracking'ENTRY_ORDER_NUMBER_ERROR3);


 

 

Similar Threads

  1. Replies: 14
    Last Post: 12 Apr 2016, 02:47 PM
  2. v139h How to reset an object after using MoveNext()?
    By Cyberkiller in forum General Questions
    Replies: 6
    Last Post: 30 Mar 2012, 05:27 PM
  3. Basic query question with MoveNext
    By delia in forum Contribution-Writing Guidelines
    Replies: 2
    Last Post: 12 Jan 2010, 05:20 PM
  4. How can I use Multiple mods that use same files?
    By sfklaas in forum General Questions
    Replies: 1
    Last Post: 8 May 2009, 10:27 PM

Posting Permissions

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