#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    London, England
    Posts
    64
    Rep Power
    15
    I want to check for blank spaces in an input box. Here is the code I'm working with but I'm not sure of the correct syntax:

    <?
    if ($Location == " ")
    {
    echo "<p>The filename contains invalid characters (blank spaces)</p>";
    die;}
    ?>

    I think I need to replace == (equals) with contains.. but I don't know the syntax for that.

    Thanks for any advice.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    You probably want to use regular expressions:

    if (ereg ("[[:space:]]", $Location)) {
    &nbsp;&nbsp;&nbsp;die ( ... );
    }

Similar Threads

  1. The Soothingly Seamless Setup of Apache, SSL, MySQL, and PHP
    By guest in forum Development Articles
    Replies: 631
    Last Post: January 13th, 2004, 04:41 PM
  2. validation - checking for alpha and numeric
    By leeolive in forum HTML Programming
    Replies: 0
    Last Post: November 4th, 2003, 08:04 AM
  3. postgresql installation help
    By lightyears in forum PostgreSQL Help
    Replies: 3
    Last Post: November 2nd, 2003, 06:38 PM
  4. Error checking/ validation for international address inputs
    By aalspach in forum HTML Programming
    Replies: 0
    Last Post: September 10th, 2003, 11:14 PM
  5. libtool-1.3.4_4 and bash settings
    By wacko_cracko in forum BSD Help
    Replies: 2
    Last Post: May 16th, 2003, 12:30 PM

IMN logo majestic logo threadwatch logo seochat tools logo