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

    Join Date
    Feb 2001
    Posts
    130
    Rep Power
    14

    Hiding Javascript Tables/arrays?


    Hi,

    I'm using Javascript arrays to dynamically check if a username is already taken or not. The probelm is, if you do a view source, the entire table is visible (created from PHP/mySQL) is there a way to hide the array? I can't put it into a .js because of the dynamic array creation.

    Any ideas?

    Statik
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Posts
    5
    Rep Power
    0
    I don't understand your problem... could you explain in more detail?
  4. #3
  5. No Profile Picture
    Do you like PHP like ME?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    St. George, Utah, of the USA
    Posts
    67
    Rep Power
    13
    if your using a Mysql database it should not appear on the page. But if u made it that way just save all the database stuff in a a mysql extension file, and check if the user name is taken or not using php. I don't see another way out of it.
    You know your a web programmer when you see a '$' and think of PHP rather than money.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    130
    Rep Power
    14
    The problem: I wanted to check the username to see if it is already used, at the time of entry, not after submit. So I was using <ON CHANGE> to run a check of the entered username against an array of current usernames.

    This works fine in practice, but If you do a view-source, you get to see all the usernames. This is a potential security hole. If I can't hide this array, I have to return to checking the usernames after submit.
  8. #5
  9. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Oct 2001
    Location
    New Zealand
    Posts
    1,774
    Rep Power
    24
    Run the checking in a hidden layer/iframe then the user wont be able to see the code. You can essentially run the check as if it was a form submission, reloading a CGI script again and again when the change happens.

IMN logo majestic logo threadwatch logo seochat tools logo