How to script to logon servers using id and password

Hey..
I am new in scripting.. I know a little bit of scripting.. I am facing some problem.. I need to create a script using which I may log on to a server (e.g. ftp) with ID and password.. thus copy a particular file to a local dir.. the commands required to do that I do know.. I am able to do it manually.. Can any one please inform me in detail how may I do it using a script?? the problem i am facing is the input of username and password using the script.. and secondly how may I run or execute a script at a particular time every day.. actually I need to copy a file using ftp everyday at 4PM.. and I need to do it using script.. please help me to do that..

With thanks and regards
AL MAMUN MAHBUB

Not sure why you did not google this, but something like follows is what you are looking for,

#!/bin/sh
HOST='ftp.users.qwest.net'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'

ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0

taken from, Using ftp in a shell script