Sign in to follow this  
Followers 0
bundyxc

Asking for a variable once?

5 posts in this topic

Is there a way to just ask the user for a variable ONCE? I need to save their login data.. is there a way to do this? Maybe I could save it to a textfile, and read? Any thoughts?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites



Is there a way to just ask the user for a variable ONCE? I need to save their login data.. is there a way to do this? Maybe I could save it to a textfile, and read? Any thoughts?

im not sure quite what to do as you can guess but how does html use its remember me type things for when you log in, could be a usefull for you??

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

$file = FileExists ("c:\first.txt")
if $file = 0 then
inputbox("Question", "Enter variable")
_FileCreate("c:\first.txt")
endif

Looks if file.txt exists, if it does then it will return if not it will ask for their input.

You can use _filewriteline() to write the variable to the text and use _filereadline() to retrieve it

Edited by TheTex

Share this post


Link to post
Share on other sites

im not sure quite what to do as you can guess but how does html use its remember me type things for when you log in, could be a usefull for you??

If a webpage is remembering something, it's obviously not just HTML, seeing as how HTML can't do that. They would have to be using javascript/php/etc.

$file = FileExists ("c:\first.txt")
if $file = 0 then
inputbox("Question", "Enter variable")
_FileCreate("c:\first.txt")
endif

Looks if file.txt exists, if it does then it will return if not it will ask for their input.

You can use _filewriteline() to write the variable to the text and use _filereadline() to retrieve it

Thanks, I'll give it a shot.


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites

Look at Iniwrite and Iniread functions. They will allow you to easily store several values in the same file.

Also, to keep from storing a password as plain text, you may wish to use _StringEncrypt to encrypt / decrypt the string before storing.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0