check string length server-side

Ask a Question related to Macromedia Flash Flashcom, Design and Development.

  1. #1

    Default check string length server-side

    Hi guys,

    how do i check the string length server-side?

    I am using the date object to gather the current date.

    [q]
    var d = new Date();
    var mm = d.getMonth()+1;
    var yy = d.getFullYear();
    var dd = d.getDate();
    [/q]
    month is returned as "2" which is correct
    but i need to be able to check for a single char so that i can add a leading
    zero before it is submitted to the database. This is also required for day.

    thanks
    Paul


    [djdomain] Guest

  2. Similar Questions and Discussions

    1. Need to know the length of Server side Informationobject
      Hi, I am doing some programming to get the bandwidth of all the Streams on the Server Side. I am using Server Side Api's. I am using...
    2. string length
      how do you find the length of a string in php?? there seems to be every command under the sun in the manual to operate on strings but not one for...
    3. Controls with a client side onLoad function or seting a cursor server side
      Is there any way to create a web control that calls a client side onLoad function? Its diffucilt since you are not able to access the form or...
    4. a string length problem
      I am using Director 8 on Chinese version Windows system,a double-byte system. and I have a problem about the length of chinese character string ,...
    5. How to get length of string? length() problems
      Simplified a bit, I'm parsing HTML documents to get sentences e.g. my $html = get($URL); # remove all HTML TAGs...blah blah blah @sentences =...
  3. #2

    Default Re: check string length server-side

    I'm no PHP programmer but I think using simple logic it will be a simple fix.

    1) check to make sure the number is below 10 e.g. <10
    2) if this is true append a 0 at the end

    I don't know what code is required but that's the logic behind it. If you've had some experience with PHP you might be able to do it.
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139