I have a PHP engine login page which i want to sign in using another PHP file without me physically inputting the details on that page, so i should be able to run a PHP file and sign into another login page on my server
-
If it's a HTTP authentication, use cURL with options
CURLOPT_HTTPAUTHandCURLOPT_USERPWD -
simply have your other PHP file post the required login credentials to your login page's action url
-
I'm confused, I don't know if I really understood your question! But if it's the case, just send the details of your login form through a post method. And in this other page you'll just check if the login & password are good and start a session for this user!
-
without me physically inputting the details on that page
sounds like XSRF :P
Just duplicate the login page with the exact same form actions, method and input names and name it whatever you want and host it on your server. Does that answer the question?
rzlines : I have a whole php component installed on my server, i want to automate the process of logging in to that system without changing those PHP files so my code will work with future versions of the PHP component -
Assuming this php login page is part of the same site, then should it not just be a case of setting the required session variables / cookies from your other php file? This seems pretty straightforward to me.
(Note that the above would assume that your other php file has some kind of login process - if it does not, then just set the post action to the url of the php login page).
-
i suggest you give us more detailed information to enable us help you better. because we can't seem to get a full understanding of what you really want to achieve.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.