Jump to content

pulpfiction

Members
  • Posts

    1,210
  • Joined

  • Last visited

Posts posted by pulpfiction

  1. Are you looking for somthing like thisDim d As Date d = Now Response.Write(d) Response.Write("<BR>") Response.Write(d.ToShortDateString) Response.Write("<BR>") Response.Write(d.ToLongDateString)OUTPUT:4/27/2006 12:04:17 PM4/27/2006Thursday, April 27, 2006

  2. I tried a simple HTML page somthing like this (browser: IE6)<html><body bgcolor=Gray></body></html>Changing <body bgcolor=Grey>I seem to get somthing like green. How come???

  3. In the bolded statement, next and set fo=nothing needs a space<%dim fs,fo,xset fs=Server.CreateObject("Scripting.FileSystemObject")set fo=fs.GetFolder("c:\")for each x in fo.files'Print the name of all files in the test folderResponse.write(x.Name & "<br />")nextset fo=nothingset fs=nothing%> Try this..<%dim fs,fo,xset fs=Server.CreateObject("Scripting.FileSystemObject")set fo=fs.GetFolder("c:\")for each x in fo.files'Print the name of all files in the test folderResponse.write(x.Name & "<br />")nextset fo=nothingset fs=nothing%>

  4. When I tried this code I did not have any problem getting values from the form, it seems to get and display the values I entered in the form, when all the info is correct..This is what i got with your code.Here's what you entered:Name: aEmail: a@yahoo.comAddress: aCity: aState: aaZip: 12345

  5. Hi, I dont think so this will work, when you write Value="java script:return variableName"then it will display the whole text "java script:return variableName" in the list.

  6. This javascript function will check if the email is in the correct format (validates email addr). I guess this is what you are looking for..function test(src) { var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$"; var regex = new RegExp(emailReg); return regex.test(src); }

  7. Hashing is the best way to encrypt the password, as it cannot be reversed. Salt is nothing but to make the input for hashing a little different.Say if 2 ppl give the same password then it will generate the same hash value, this gives a chance for attack. but when you add "salt" to the password then the input for hashing will be different and so the hash o/p will be different even if the password may be same, but this process needs salt to be stored in the DB for future login verfication. MD5 and SHA1 are two of that hashing algorithms, abd SHA1 is considered a little more secure..I think hashing alone will do, but if you need higher security then use salt technique.HTH

  8. yeah i missed that part, saw it just now. isnt it just a comparision of doing the same job as the PHP code but using javascript. that wont be needed if you are using PHP alone.....

  9. Thats wierd, the article i provided seems to have the code in php.. how come i dont see any javascriptThis is the code in that article...<?php// ... do some form handling, like validation, filtering, etc$password = $_POST['password'];// Generate a random salt$salt = substr(md5(uniqid(rand(), true)), 0, 5);// Hash password$secure_password = md5($salt . md5($password));// Store password AND hash in database// ...?><?php// ... do some form handling, like validation, filtering, etc$username = $_POST['username'];$password = $_POST['password'];// Get user from database$user = getUser($username);// Compare passwordif ($user->password != md5($user->salt . md5($password))) { die ('Wrong username or password!');}// ... user entered correct password, do something?>

  10. Oh i didnt know that you are going to use client side scripting (javascript), then i guess its not gonna work, but anything you do on the client side can be viewed by the user, so its better you do it with PHP. there was a discussion in our forum abt ways to hide javascript code from the client, you may get a idea from it.

×
×
  • Create New...