Jump to content
Larry Ullman's Book Forums

DeeDee

Members
  • Posts

    26
  • Joined

  • Last visited

Posts posted by DeeDee

  1. Hello

    I have two requests that I need advice and help on.

     

    1. I am trying to code a textfield only input that only accept characters instead of integers and special characters.

     

    I was thinking of using ereg shown here.

               if (!ereg($letters, $Myname)) {
                   echo Letters only required';
               }
    

    Is there a better way of comparing characters using utf-8 or ASCII using one if statement rather than using separate if statements for integers and special characters.

     

    2. I am trying to code a method that would update the date into a via button. So far I have coded this, however it is not working

     

    <html>
       <head>
       </head>
       <body>
    <?php
    $submit = $_POST['submit'];
       if($submit){
          for ($i = 40; $i < 100; $i++) {
               $i = time() + ($i * 24 * 60 * 60);
       }
    }
    echo 'Next Week: ' . date('Y-m-d', $i) . "\n";
    ?>
    <form>
      <input type="submit" name="submit" value="update"/>
      </form>
       </body>
    </html> 
    
    

     

    Some advice is grateful

     

    Thank you

×
×
  • Create New...