User Profile

Collapse

Profile Sidebar

Collapse
wwolfson
wwolfson
Last Activity: Sep 14 '07, 07:03 PM
Joined: Jun 17 '07
Location: London
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • wwolfson
    replied to Regular Expression Problem
    in PHP
    I'm really sorry, this is starting to annoy me now.
    Still not working!
    please could someone check this out and tell me wats wrong:

    [CODE=php]
    function validate_date($ date)
    {
    $test = strtotime($date );
    if( !$test )
    {
    return false;
    }
    date('d-M-Y', $test);
    }
    [/CODE]

    Code:
    $date = $_POST['date'];
    [CODE="php"]...
    See more | Go to post

    Leave a comment:


  • wwolfson
    replied to Regular Expression Problem
    in PHP
    But will this work if the form is

    02-Sep-2003
    i.e. the month in words and not numbers

    ??

    Thanks.
    See more | Go to post

    Leave a comment:


  • wwolfson
    replied to Regular Expression Problem
    in PHP
    still no luck, any more ideas anyone?
    sorry.
    william.
    See more | Go to post

    Leave a comment:


  • wwolfson
    replied to Regular Expression Problem
    in PHP
    Sorry, I have tried using preg_match() but it makes no difference and I do not see how strtodate will help me in any way.

    I am using this as a validator to keep dates in the form 13-Sep-2007.

    Thanks.
    See more | Go to post

    Leave a comment:


  • wwolfson
    started a topic Regular Expression Problem
    in PHP

    Regular Expression Problem

    Hiya all,

    I'm trying to validate a date in php to be in the form 12-Sep-2006 for example. However, for some reason the following regex wont work.
    [CODE=php]
    function validate_date($ date)
    {
    if (ereg("^([012]?\d|3[01])-([Jj][Aa][Nn]|[Ff][Ee][bB]|[Mm][Aa][Rr]|[Aa][Pp] [Rr]|[Mm][Aa][Yy]|[Jj][Uu][Nn]|[Jj][u]l|[aA][Uu][gG]|[Ss][eE][pP]|[oO][Cc] |[Nn][oO][Vv]|[Dd][Ee][Cc])-(19|20)\d\d$", $date))
    {...
    See more | Go to post

  • wwolfson
    started a topic Unterminated String Literal Error

    Unterminated String Literal Error

    Hiya,

    Im trying to embed some Javascript into some xhtml which is embedded into a php file.

    The line causing a problem is this:
    [code=html]<form id=\"deletetopi c\" name=\"deleteto pic\" method=\"post\" action=\"delete _topic.php\" onsubmit=\"conf irm('Are you sure you want to this topic?\n\n + Please note all posts will be lost!');\">[/code]

    However,...
    See more | Go to post
    Last edited by pbmods; Sep 8 '07, 07:22 PM. Reason: Added CODE tags.

  • wwolfson
    replied to MySQL and PHP Security
    thanks i will give it a try.
    See more | Go to post

    Leave a comment:


  • wwolfson
    started a topic MySQL and PHP Security

    MySQL and PHP Security

    Hiya all,
    I am currently building a forum for a website I have made. However, one thing is bothering me. It seems that (although I dare try) if you input sql into the form fields, it would be possible to delete all my tables and run sql commands.
    What can I do to prevent this??
    On my registration page, all the fields have validation such that it is impossible to enter an SQL query but on a forum when the possible response can...
    See more | Go to post

  • wwolfson
    started a topic Validating Forum inputs
    in PHP

    Validating Forum inputs

    Hiya all,

    I've just built a simple forum thanks to "thescript - someone gave me a link to a very good tutorial.

    My problem now is this, how do I validate a textarea, which is saved in a mySQL database, such that users can't just input sql and bring down my database - i was thinking along the lines of just looking for quotation marks and then producing an error if any quotation marks are found.
    This means...
    See more | Go to post

  • wwolfson
    replied to Building a forum
    in PHP
    thanks that article was very good and ive now got a working forum.

    Looking at a a way of doing validation now, will post again if i have troubles.
    Thanks a lot!
    See more | Go to post

    Leave a comment:


  • wwolfson
    started a topic Building a forum
    in PHP

    Building a forum

    Hiya all,

    Im trying to build a forum for a website ive made.
    It now allows users to log in by a link to a mySQL database but thats about it.

    I was using a book on php and mysql but the chapter on forums goes way over my head - anyone know any links or any information that can help me at least start this web forum?

    thanks,
    William.
    See more | Go to post

  • wwolfson
    replied to Simple Problem With Variable Scope
    in PHP
    THANKS a lot for your help, but it still didn't work.
    Found a way round it though:
    [code=php]
    <?php

    //start a session
    session_start() ;

    //$GLOBALS['errors'] = NULL;

    $firstname = $_POST["firstname"];

    //validate fields
    function validate_firstn ame($firstname)
    {


    if (ereg("^[A-Z][a-z]+", $firstname))
    ...
    See more | Go to post
    Last edited by Atli; Jun 18 '07, 07:23 PM. Reason: Added [code] tags, please use [code] tags when posting code!

    Leave a comment:


  • wwolfson
    started a topic Simple Problem With Variable Scope
    in PHP

    Simple Problem With Variable Scope

    This is my code:
    [code=php]
    <?php

    //start a session
    session_start() ;

    $errors = NULL;

    $firstname = $_POST["firstname"];

    //validate fields
    function validate_firstn ame($firstname)
    {
    global $errors;

    if (ereg("^[A-Z][a-z]+", $firstname))
    {
    return true;
    }
    else
    {
    $errors =...
    See more | Go to post
    Last edited by pbmods; Jun 17 '07, 11:40 PM. Reason: Added CODE tags.
No activity results to display
Show More
Working...