Jump to content

doh85

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

doh85's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. current reg ex : /price\['$from:\S*\s=\s(\S*);/ I want to extend this so not only will it find whats in the $from variable, but to also use the $to variable aswell. Many thanks in advance.
  2. if($ns_cb->targetCurrency == 'USD') { $usd_base_rate = '1'/$ns_cb->value; } $eq = number_format($usd_base_rate*$ns_cb->value,2); echo $eq $ns_cb->value is currently = 0.9940. But this gets updated every day. I keep getting division by zero for this problem here, any help?
  3. doh85

    Reg Ex Help

    Dude, thank you so much. Cheers
  4. doh85

    Reg Ex Help

    You have been a lifesaver. Cheers man. Any help with the final thing, the last dash right at the very bottom?
  5. doh85

    Reg Ex Help

    That has worked a treat, thank you very much. I have one more slight issue, "price['KPW:CUR'] = -99;" this one has not shown up. I have checked the original file to see. This currency is currently unavaliable. How would i go about editing the code to still pull the value of this even if the rate is -99? I have formatted the outputs to be displayed like so: echo $country_code[$i].' - '; echo $rate[$i].' <br/> '; At the very bottom its showing just a '-', how would i go about removing it, it must mean that the value is empty or something like that?
  6. doh85

    Reg Ex Help

    Line 33: preg_match("~price['([^:]+):CUR'] = ([\d\.]+)~", $content[$i], $matches);
  7. doh85

    Reg Ex Help

    $content = file_get_contents(**URL**'); if ($content !== false) { $content = explode(";", $content); $count = count($content); for ($i = 1; $i < $count; ++$i) { echo $content[$i]; } } else { echo "Fail"; }
  8. doh85

    Reg Ex Help

    PM'd you the code
  9. doh85

    Reg Ex Help

    Would it be possible to put this to use in an example please?
  10. doh85

    Reg Ex Help

    I am gathering some data from a website to do with currencies. I have managed to strip out the rates into this format. price['AFN:CUR'] = 45.17 The rates are all structured like this, however i want them to be structured like this, but stored in 2 separate variables. So for example: echo $country_code[$i]; // AFN echo $rate[$i]; // 45.17 AFN 45.17 Any help would be greatly appreciated.
  11. <? $ct_qty = 0; $subTotal = 0; for ($i = 0; $i < $numItem; $i++) { extract($cartContent[$i]); $productUrl = "index.php?c=$cat_id&p=$pd_id"; $subTotal += $pd_price * $ct_qty; ?> <div class="cart-item"> <div class="item"><a href="<?php echo $_SERVER['PHP_SELF'] . "?action=delete&cid=$ct_id"; ?>"><img src="images/remove.png" alt=""></a><a href="<?php echo $productUrl; ?>"><?php echo $pd_name; ?></a></div> <div class="item-price"><?php echo displayAmount($pd_price); ?></div> <div class="item-quantity"> <input maxlength="3" name="txtQty[]" type="text" id="txtQty[]" size="5" value="<?php echo $ct_qty; ?>" class="box" onKeyUp="checkNumber(this);" /> <input name="hidCartId[]" type="hidden" value="<?php echo $ct_id; ?>" /> <input name="hidProductId[]" type="hidden" value="<?php echo $pd_id; ?>" /> </div> <div class="item-total"><?php echo displayAmount($pd_price * $ct_qty); ?></div> </div> Basically this generates items in a shopping cart. I want to count all of the qtys in the input field and then add them together to have a overall number of items. <input maxlength="3" name="txtQty[]" type="text" id="txtQty[]" size="5" value="<?php echo $ct_qty; ?>" class="box" onKeyUp="checkNumber(this);" /> This is the line of code that the qty is entered into. How would i do this, im kinda a noob with php. Any help is much appreciated.
  12. This is Invision Power Board 1.2, i dnt really want to do a reinstall or anything so, please could someone help me out! When i go to start a new topic i get this: [code] Fatal error: Call to undefined function: show_form() in /home/dohdesi/public_html/forum/sources/Post.php on line 418[/code] and on line 418 is [code]$post_functions->show_form(&$this);[/code] and then when i want to reply to a topic it says [code] Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/dohdesi/public_html/forum/sources/lib/post_reply_post.php on line 910[/code] and on line 910 it says [code]?>[/code] What should i do to resolve the problem? Would aprreciate any help!
  13. When i go to start a new topic i get this: [code] Fatal error: Call to undefined function: show_form() in /home/dohdesi/public_html/forum/sources/Post.php on line 418 [/code] and on line 418 is [code]$post_functions->show_form(&$this);[/code] and then when i want to reply to a topic it says [code] Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/dohdesi/public_html/forum/sources/lib/post_reply_post.php on line 910 [/code] and on line 910 it says [code]?>[/code] What should i do to resolve the problem? Would aprreciate any help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.