Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. what do you mean by "can't do anything", you could have a frame auto refeash evey second and have the counter call from the database (or session) the new time remaining.. when that hits zero redirect to another page
  2. try print_r($_POST); whats displayed check the form (again)
  3. i'm a little confused.. $row_rsUser['Percent'] = 117.5% but 108.75 - 117.5% = -19.03
  4. Is $row_rsUser['Percent'] a percentage ? or the normal retail price? as 117.5 is saving more then the cost of the item! Ahh ok, whats was the problem ? also please click solved (if solved)
  5. maybe imap-setflag-full
  6. try this counts to 10 then back to 1 <?php session_start(); //<-- corrected if ($_SESSION['views'] == 10) { unset($_SESSION['views']); } if (isset($_SESSION['views'])) { $_SESSION['views'] = $_SESSION['views'] + 1; }else{ $_SESSION['views'] = 1; } echo "Views:".$_SESSION['views']; ?>
  7. can you echo the $number1 & 2 $retail = ($number1 / $save ); echo "number1 = $number1<br>number2 = $number2<br>"; echo FormatPrice($retail)." save'd $save% (".FormatPrice($number2).")";
  8. check DOM & COM example <?php function SpellCheck($input) { $word=new COM("word.application") or die("Cannot create Word object"); $word->Visible=false; $word->WindowState=2; $word->DisplayAlerts=false; $doc=$word->Documents->Add(); $doc->Content=$input; $doc->CheckSpelling(); $result= $doc->SpellingErrors->Count; if($result!=0) { echo "Input text contains misspelled words.\n\n"; for($i=1; $i <= $result; $i++) { echo "Original Word: " .$doc->SpellingErrors[$i]->Text."\n"; $list=$doc->SpellingErrors[$i]->GetSpellingSuggestions(); echo "Suggestions: "; for($j=1; $j <= $list->Count; $j++) { $correct=$list->Item($j); echo $correct->Name.","; } echo "\n\n"; } } else { echo "No spelling mistakes found."; } $word->ActiveDocument->Close(false); $word->Quit(); $word->Release(); $word=null; } $str="Hellu world. There is a spellling error in this sentence."; SpellCheck($str); ?>
  9. switch the * and / around if (isset($_SESSION['MM_Username'])) { $save = ($number2 / 100); }else{ $save = 1; } $retail = ($number1 * $save );
  10. please note i just updated the above post
  11. try moving the function ie <?php // IntelliCART MX - icPoles // (c)2002. Tim Green. All rights reserved. ob_start(); require_once("./classes/icPoles_IC.php"); ?> <?php session_start(); $_SESSION['Date'] = date('Y-m-d') ."\n"; ?> <?php require_once('Connections/poles.php'); ?> <?php function FormatPrice($price) { $price = preg_replace("/[^0-9\.]/", "", str_replace(',','.',$price)); if (substr($price,-3,1)=='.') { $sents = '.'.substr($price,-2); $price = substr($price,0,strlen($price)-3); } elseif (substr($price,-2,1)=='.') { $sents = '.'.substr($price,-1); $price = substr($price,0,strlen($price)-2); } else { $sents = '.00'; } $price = preg_replace("/[^0-9]/", "", $price); return number_format($price.$sents,2,'.',''); } ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; then just use <?php $english_format_number = number_format($number); $number1 = $row_rsProd['P_Retail_Price']; $number2 = $row_rsUser['Percent']; if (isset($_SESSION['MM_Username'])) { $save = ($number2 * 100); }else{ $save = 1; } $retail = ($number1 / $save ); echo FormatPrice($retail)." save'd $save% (".FormatPrice($number2).")"; ?> any error please post the exact error
  12. tested that and got 02:00:32 create a new file that contains only that code ie test.php <?php $time1 = "06:55:00"; $time2 = "08:55:32"; echo date("H:i:s",(strtotime($time2) - strtotime($time1))); ?>
  13. This should work.. do you know if your in a class could you post the full script (remove passwords etc) or PM it to me or maybe the first 10 lines (mayhelp) <?php $english_format_number = number_format($number); $number1 = $row_rsProd['P_Retail_Price']; $number2 = $row_rsUser['Percent']; if (isset($_SESSION['MM_Username'])) { $save = ($number2 * 100); }else{ $save = 1; } $retail = ($number1 / $save ); echo FormatPrice($retail)." save'd $save% (".FormatPrice($number2).")"; function FormatPrice($price) { $price = preg_replace("/[^0-9\.]/", "", str_replace(',','.',$price)); if (substr($price,-3,1)=='.') { $sents = '.'.substr($price,-2); $price = substr($price,0,strlen($price)-3); } elseif (substr($price,-2,1)=='.') { $sents = '.'.substr($price,-1); $price = substr($price,0,strlen($price)-2); } else { $sents = '.00'; } $price = preg_replace("/[^0-9]/", "", $price); return number_format($price.$sents,2,'.',''); } ?>
  14. Code is fine.. i just tested it as i couldn't see a problem try saving and re-uploading EDIT: i got 00:00:32
  15. the fact is you miss even the basic's.... i am not going to continue this.. good luck
  16. did you add the function FormatPrice($price) { $price = preg_replace("/[^0-9\.]/", "", str_replace(',','.',$price)); if (substr($price,-3,1)=='.') { $sents = '.'.substr($price,-2); $price = substr($price,0,strlen($price)-3); } elseif (substr($price,-2,1)=='.') { $sents = '.'.substr($price,-1); $price = substr($price,0,strlen($price)-2); } else { $sents = '.00'; } $price = preg_replace("/[^0-9]/", "", $price); return number_format($price.$sents,2,'.',''); } remember if your inside a function then your need to place the above code outside of it ie <?php function dostuff() { echo FormatPrice($retail); } //function closes //above code goes here ?>
  17. Owww got to try that.. if that works i owe you one Thorpe
  18. correct but i think the simple one is quicker.. the choice is your
  19. OK this was written on the fly so better test it <?php $english_format_number = number_format($number); $number1 = $row_rsProd['P_Retail_Price']; $number2 = $row_rsUser['Percent']; if (isset($_SESSION['MM_Username'])) { $save = ($number2 * 100); }else{ $save = 1; } $retail = ($number1 / $save ); echo FormatPrice($retail)." save'd $save% (".FormatPrice($number2).")"; function FormatPrice($price) { $price = preg_replace("/[^0-9\.]/", "", str_replace(',','.',$price)); if (substr($price,-3,1)=='.') { $sents = '.'.substr($price,-2); $price = substr($price,0,strlen($price)-3); } elseif (substr($price,-2,1)=='.') { $sents = '.'.substr($price,-1); $price = substr($price,0,strlen($price)-2); } else { $sents = '.00'; } $price = preg_replace("/[^0-9]/", "", $price); return number_format($price.$sents,2,'.',''); } ?>
  20. you copied most of the script random code HERE Add User HERE Infact ALL of your code has be chopped from others scripts and when you paste it in one it fails then you post it an ask why... Gezzz
  21. <?php start_session(); if (isset($_SESSION['views'])) { $_SESSION['views'] = $_SESSION['views'] + 1; }elseif (isset($_SESSION['views']) == 10){ unset($_SESSION['views']); $_SESSION['views'] = 1; } ?>
  22. OK.. get a book and read up on classes php,
  23. try 65\.54\.188\.[0-9]{1,3} more complex 65\.54\.188\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
  24. try <?php session_start(); $_SESSION['size']='large'; unset($_SESSION); session_destroy(); session_start(); echo "Session Size: ".$_SESSION['size']; //this echoes out Session Size: large ?> If you are creating a new session, but want to make sure that there are currently no sessions active by doing session_destroy(); make sure you start the session again using session_start(); or else your session data will not register properly.
  25. try <?php $nDate = mktime(0, 0, 0, $Month, $Day, $Yr); ?> edit: jitesh is nicer
×
×
  • 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.