Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. hmmm, it shouldn't be removing the "\n", but rather escaping it...e.g. "\n" becomes "\\n". How are you viewing the value stored in the database? Through the browser? If so, it may be interpreting a new line, which would not be visible execpt in "source view".
  2. Variables are not persistent between page loads. In other words, after the page is sent to the browser, all variables are destroyed, losing their value. You must put the value of "$values" from the first script either in a session variable or in a hidden form field and retrieve it in the second script.
  3. yeah...notepad doesn't recognize "\n" as a new line...it must be "\r\n" (or maybe just "\r", but I don't think so) for notepad to recognize it.
  4. use stripslashes. When a POST var has quotes in it, single or double, depending on your php.ini settings, php will add a backslash before them. You can remove them using the stripslashes function. Echo out our username and password variables to see what php sees to verify. http://www.php.net/stripslashes
  5. try removing the "silencers" from the file write functions and see if they are giving any errors: $fp = fopen ($path, 'a+'); fwrite($fp, $str); fclose($fp); chmod ($path,0777); Also, are you viewing the contents of the file in your browser or in a text editor (vi, gedit, wordpad, etc)?
  6. Zend framework has a pretty good module for working with PDFs... http://framework.zend.com/manual/en/zend.pdf.html
  7. Use stripslashes on the server side.... echo stripslashes($_POST['form_field_with_a_quote_in_it']); http://www.php.net/stripslashes
  8. Have you tried giving the styles that will not apply the "important" attribute? http://www.w3.org/TR/REC-CSS2/cascade.html#important-rules #plinks { background: url(../images/bg-menu.png); height: 34px; !important padding-top: 1px !important; color: #FFFFFF !important; font-family: verdana; font-weight: bold; font-size: 12px !important; text-decoration: none !important; }
  9. Not sure what you mean...but I'm going to assume that you are doing this: <input type=hidden name=something value=what you want to pass with spaces> The solution is to put quotes around your tag attributes (which happens to be the proper way)... <input type="hidden" name="something" value="what you want to pass with spaces"> If you are already doing this...then post some code, cause you've given us just slightly more than no information to help you.
  10. use str_pad... for ($i = 0; $i < 1000; $i++) { echo str_pad($i, 3, "0", STR_PAD_LEFT); }
  11. Your mysql connection is failing for whatever reason...use error checking: change $result = mysql_query($conn, $query); to $result = mysql_query($conn, $query) or die(mysql_error()); and it will print out the error. Do the same for your mysql_query call.
  12. if (!in_array($regstatus, $options)) { $html .= ' <option value="' . $regstatus . '" selected="selected">' . $regstatus . '</option>'; } If the value isn't in the array that contains the current values, then it specifically adds that one to the drop down using the above if statement...hence the use of an array...it makes checking to see if it exists easier.
  13. That's because when you call mysql_fetch_array outside of your loop it's retrieving the first row... $p_result = mysql_query("SELECT * FROM payment WHERE client_number='" . $ro['client_number'] . "'") or die(mysql_error()); $ptotal = 0; while ($p_ro = mysql_fetch_assoc($p_result)) { echo 'Payment on ' . $p_ro['date'] . ' of ' . $p_ro['payment'] . '<br />'; $ptotal += $p_ro['payment']; } echo 'Total payments: ' . $ptotal;
  14. $_GET['action'] http://www.php.net/manual/en/reserved.variables.php#reserved.variables.get
  15. Attachments are a pain...it's much easier to use something where all that's taken care of... http://phpmailer.codeworxtech.com/
  16. Unit testing.... http://www.phpunit.de/
  17. Force your users to always enter the date in the same format, then use mysql's str_to_date function... http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_str-to-date Or, use php's date functions if you choose. Either way, strtotime is unreliable at best with changing date formats... Using your format (xx.xx.yyyy) as an example, it can only guess what "1.11.2007" is...November 1st, or January 11th? Users may not always use the same format by default, so you have to force them to.
  18. If you format your arrays in a more readable manner, it's much easier to see your errors: if ($PassRateRequestPackageSummary) { $request['RateRequestPackageSummary'] = array( 'TotalWeight' => array( 'Value' => 22.0, 'Units' => 'LB' ), 'TotalInsuredValue' => array( 'Amount' => $total, 'Currency' => 'USD' ), 'PieceCount' => $quan // there was an error here ); } else { $request['PackageCount'] = 1; $request['Packages'] = array( 0 => array( 'Weight' => array( 'Value' => 22.0, 'Units' => 'LB' ), 'InsuredValue' => array( 'Amount' => $total, 'Currency' => 'USD' // error here as well ) ) ); }
  19. The implementation he is referring to does not use javascript to show the price...it requires a page submit (at least for me) to update the price per filter.
  20. If your php install has the mysql functions available, then it was compiled with the mysql client library. This means that the mysql client code is available to it. All of the php mysql functions relate to a function in the mysql client library. What this means is that it's not going to the database to do the escaping...it's just calling the client library. The reason, I think, a connection is required is so that the mysql library knows what encoding to use (some characters may be escaped slightly differently), and possibly so it knows what version of MySQL you are inserting to (although I can't think of a good reason why it would matter).
  21. A notice isn't an error, it's just php letting you know something. In this case, as is the case with all "undefined indexes" it means that you are trying to access an element in an array that doesn't exist... $foo = array(); $foo['bar'] = 'a string'; // No notice generated echo $foo['bar']; // "Undefined index" Notice generated because 'baz' doesn't exist echo $foo['baz']
  22. Most likely they take the total area of the filter (WxL), along with a modifier for the thickness, and compute the price that way. So, if the total area is 100 in^2 (10 in x 10 in), with a thickness of 2 inches, and the standard price for a 2 inch thick filter is 25 cents per square inch, the final price would be .25 * 100 = $25. Although there are a lot of different ways...maybe they have a general price for size ranges. Maybe they have some fat guy on the other end that sees the request and makes up a number.
×
×
  • 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.