Jump to content

phppup

Members
  • Posts

    711
  • Joined

  • Last visited

Posts posted by phppup

  1.  

    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?

  2. 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'>

     

     

     

     

     

  3. 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?

  4. 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?)

     

     

  5. 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!!)

  6. 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.

     

     

  7. 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)

  8. 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

     

  9. 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

  10.  

    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??

  11.  

    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

     

     

  12. 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

  13. 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?

  14. 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?

  15. 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.

  16. 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!)

  17. Didn't know I could do that.  (more info?)

    And then, how would I validate it?  Right now I validate by confirming all characters are numeric. 

    Also, I have a maimum lengh of 10 characters that would be problematic if people start adding dashes and ().

     

     

  18. My DB has fields that primarily record numeric values. 

    I've noticed that a NUMBER in a VARCHAR field is aligned to the right and will hold decimal places, and a

    SMALLINT seems to align left and strip whole numbers to the bare digit (eg.: 4.0 is held to 4).

     

    What's the best way for me to store values, if I want them to hold at least ONE decimal place (so that whole numbers line up EVENLY with fractions:

    1.0

    1.5

    2.0 etc?

     

    Is there a way to "adjust" a setting within MySQL?  Or in the query that pulls the info?

  19. Is there a "PREFERRED METHOD" to handling telephone numbers gathered by a form?

     

    I'm torn between ideas.

     

    I need to collect the numbers, and want to be able to view them as (123)555-1212.

     

    Should I collect them as a 10 digit ONLY string, and strip them into area code, parenthesis, and hyphenated LATER?  Or gather them as 3 seperated input boxes posted to the DB accordingly?

     

    Obviously, entries will have REQUIREMENTS and error messages, so I am focused on the methodology here.  Thanks.

×
×
  • 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.