Jump to content

phppup

Members
  • Posts

    895
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by phppup

  1. It does NOT work!! I just cut and pasted it AGAIN. Change the size in CSS, and nothing happens!
  2. I am recording orders for the sale of items. People can order cases by the WHOLE or HALF quntity. Thus, 1.0, 1.5,2.0, 2.5 etc. I didn't initially realize that DECIMAL and FLOAT were COLUMN TYPES in their own right, I mistakenly thought they were OPTIONS for the INT values. So, at this point, I suppose I can use EITHER the DECIMAL (or FLOAT for this instance, although still shakey as I've heard accuracy is an issue) or TINYINT with number_formatting to get the result I want and still be following the proper protocols.
  3. How do I edit the code that "rythemton" mentioned if I'm not writing an array. All the data is coming from a form. I seem to get into trouble whenever there are ARRAYS that are ITEMIZED in the code rather than having values coming from a form or a table.
  4. I have the code so that onClick of a submit button, a new window opens with information. Now I want to move to a new window in the SAME browser, what is the code for that, so that it functions as if an <a href> tag were clicked?
  5. I am having trouble using INCLUDE in my HTML. I know I've used it before, so I don't understand where my problem is coming from. I created a simple HTML file named ok.htm, it has ONE line that says HI. For testing, I actually added a second line for it to INCLUDE ITSELF: <!--#include virtual="ok.htm" --> It didn't work in itself, or any other HTML pages. What am I doing wrong on my local machine?
  6. I have a table with a 3 buttons and want to control the button size uniformly thru CSS. My code below isn't working. Where have I gone wrong? <html> <head> <style type="text/css"> input[type=button] { width: 20em; } </style> </head> <table> <input type='button'>
  7. Thank you DAVID! Over-simplification EXPLAINS things perfectly; especially to those of us who might not truly realize WHAT were ASKING or WHY others think it's a problem. Now I not only got my answer, but ALSO understand the importance of the sections. PS: can you elaborate on the ISSET. I know it's the brief version of an IF, but it's caused me problems in the past. I have SANITATIoN and VALIDATION on my input fields, and the rest are dropdown menus. Is there a way to put the "mysql_real_escape_string" is a loop to cover all the variables, or do they need to be sanitized individually?
  8. This has to have been one of the MOST educating of 'simple questions' that I've ever asked in the forum. Good exchanges and loads of good info. I personally use HTML strict figuring I'd like to KNOW it's correct than go with the browsers assumptions. I'll leave this one open til tomorrow, in case anybody else wants to chime in. (not sure, can it still be posted into after it's marked solved?)
  9. I think i got way more than i bargained for with this one! LOL I'd better MARK it SOLVED before the gloves come out!
  10. Psycho... thanks for all the help! In reality, I will probably ONLY occasionally require ONE decimal place. And realistically, it will present itself when the INPUT contains the halved-value. In those instances where the .5 is present, it sort of takes care of itself. So is the number_format still recommended? If so, why? (i AM learning!!)
  11. Let me try to make this a little more clear: My code looks something like this: //section ONE apples = $POST ['apples'] donuts =$POST['donuts'] SQL= blah blah blah //section TWO INSERT (apples, donuts) VALUES ($apples, $donuts) etc Is "section ONE" necessary to have in my script, or is redundant since the values are indicated in my results statement? Some have said it's UNNECESSARY because the same info is being stated in section TWO, and others have indicated that it is "proper protocol" to aid in the scripts processing.
  12. The field will ONLY be holding numeric values that are either whole values (with trailing zeros desired) 1.00, 2.00, 3.00, etc Or havles: 1.50, 2.50, 3.50 etc. But when queries are used, I want the values to line up evenly (the zeros on the whole numbers resolve this) 1.00 1.50 2.00 2.50 etc. for that, I just NEED THE CODE format that goes into the CREATE TABLE function. If there are alternative solutions, I will have to c onsider them. Is there a way to edit the results of a statement that asks SQL= SELECT qty FROM mytable so that the results are not 1 1.5 2 2.5 etc.? Note: there are too many columns to use VARCHAR (which would provide the desired result)
  13. Yes. I know this is NOT a Javascript forum (but I've been so engaged with learning PHP's abilities that I don't have time to join a JS group.. LOL) I have a page with several "submit buttons" on it to handle several scripts. <input type="button" onClick=do this or do that value="WHATEVER i decided to write> Because my buttons have different VALUES (submit, yabba dabba dooo, etc) the resulting buttons are different widths. The problem: I want them all to be uniform. I know I can style them INDIVIDUALLY to be the same size, but the real question is whether there's a single way to style them ALL through one script? Can they be styled by TYPE (to say; make ALL "button" this size, or can this only be done by NAME) It's probabaly already taken me longer to find the answer than if I'd just modify each button seperately, buy curiousity is obsessive. LOL
  14. Can someone five me the correct code or format to use that will allow my TINYINT columns to carry TWO decimal places when creating my table? I have a script for creating the table and columns, but only recently learned that I need to ADD the TWO decimal place FUNCTION in order to get whole dollar values to display WITH the trailing zeros (ie.:2.00). I don't expect to need any values greater than xxx.xx in my columns, I'm just not clear on how to get the desired script when running the initial CREAT script. Thanks
  15. I understand that I can place my HTML code outisde of my PHP tags and have it publish, OR i can put it inside the PHP tags and ECHO every line. Am I correct in thinking that either will provide the same result? Is there an advantage to one method over the other??
  16. My code looks something like this: //section one apples = $POST ['apples'] donuts =$POST['donuts'] SQL= blah blah blah //section two INSERT (apples, donuts) VALUES ($apples, $donuts) etc Is "section one" necessary to have in my script, or is redundant since the values are indicated in my results statement? I need clarification from people who know this stuff well. Thanks
  17. And given my example of a ONE (or possibly two) place decimal, is there a benefit to using FLOAT versus DECIMAL?
  18. Didn't realize that, but YES, primarily 2 local counties; and CERTAINLY all USA. But thank you, as it's always beneficial to have knowledge like this to draw on.
  19. Can someone clear up my confusion about FLOAT. I have data in a TINYINT field that displays whole numbers WITHOUT any decimal places. This does not format very nicely when there are ALSO decimalled values to be echoed: 1 1.5 2 2.5, etc. It can be a little confusing. The only way I've thought of to resolve the issue (if you know another, please share) is to add a decimal place to get: 1.0 1.5 2.0 2.5 etc. But I am unclear on WHERE to put the commands to get this result. Does it go into the actual DB? Or into my PHP script? Please help with a detailed example. Thanks
  20. CanI put one INCLUDE statement INSIDE of another INCLUDE statement?
  21. if I have a form written in HTML, can I simple place the HTML inside the PHP tags to create the PHP file, or do I need to ECHO each and every line within the PHP in order for it to be published correctly?
  22. I was thinking more like: $areacode + $prefix + $lastfour = $_POST[telenumber'] Are my mechanics running backwards? This way the DB would have everything as desired in one field.
  23. Ohhh, these thoughts just run through my head as I sleep. But will it work? Can I set a function so that my UPDATE form will NOT execute after a certain DATE (or even a time of day?) I'm thinking something along the lines of: $time=timestamp if $time>19:00 echo" You need to make changes before 7:PM"; else (UPDATE... yadda yadda yadda) Yes, i know this is worse than a rough draft, but will it work? Is it acceptable methodology?
  24. OK. Is this code tested? Looks similar to what I was envisioning if I decide to allow input1 as area code, input2 as pre-fix, and input3 as last four digits. Then just put them together and $POST all three as one string (i can do that, can't i????) Thanks for the help.
  25. But willl JavaScript be able to validate in a similar manner? Thought I was better validating with JS first to lower the requirements of the server (which has the PHP)? (too much reading... people write stuff in tutorials, then you come here and discover it was all wrong... geesh) (i wonder if it's more frustrating for the newbies OR the pros!)
×
×
  • 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.