/    Sign up×
Community /Pin to ProfileBookmark

Autosend a form using php code

I need to automatically log into a webpage but I need to use PHP to do this. I can do this in Javascript but doing so will let people see my username/password :

function log_in(){
var f = document.forms[0];
f.action = “http://www.mysite.com/log_in.asp“;
f.target = “form_target”;
f.li_mn.value = myloginname;
f.li_pwd.value = “password”;
f.submit();
setTimeout(“myfunc();”,2500);
}

How do I do the same thing but using PHP?

Thanks,

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@HellspireSep 20.2004 — Why dont you just add an .htaccess file for connection???
Copy linkTweet thisAlerts:
@llamatronauthorSep 20.2004 — It's a good idea but it's not entirely approriate for my particular scenario. I really need the PHP equivalent of the Javascript function listed but I'm new to PHP so any pointers helpful. Thanks.
Copy linkTweet thisAlerts:
@Bootsman123Sep 20.2004 — Cookies and/or sessions.
Copy linkTweet thisAlerts:
@llamatronauthorSep 21.2004 — Thanks, but is anybody able to convert the Javascript snippet to PHP? It would be really helpful to this newbie if somebody could.

Thanks,
Copy linkTweet thisAlerts:
@Paul_JrSep 21.2004 — If I understand what you want, [url=http://www.webdeveloper.com/forum/showthread.php?s=&threadid=44876]This thread[/url] might be of some help.
Copy linkTweet thisAlerts:
@diamondsSep 21.2004 — what are you using it for?
Copy linkTweet thisAlerts:
@llamatronauthorSep 22.2004 — I just want to be able to retrieve a list of people who are online at any time and display it as a list. But I need to be logged in to do this. I now have the code to display who is online.

I have several friends who would find this feature useful so I would like a way to log on without revealing my password in the html source or having the hassle of them having to log on each time they want to check.

Thanks Paul Jr, that does pretty much do what I want and I will take that as an "accepted answer".

Thanks.
×

Success!

Help @llamatron spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...