News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

PHP cURL'ing or javascript: need someone to help build a login for work portal

Started by rcane, January 19, 2023, 09:42:02 AM

Previous topic - Next topic

rcane

In my work portal at work there is a single text field area where some command-line things are done. 

I can learn to scrape the data for the relevant text.

I'm just having a booger of a time building my first login, so I can automate some things by running a php page that logs in, makes a few command line entires, and then dumps it all to a result I can comb through.

I know it's do-able, as I've seen some 3rd party apps that function by doing this.


But, I can't give someone my credentials to log in (policies), so the only one can do is see the page source and give some guidance.

Q1: which is the better way to go?  cURL or javascript?  or, does it not matter?


I'm willing to PayPal some $ in this learning event too.  I'd be paying for a course or tutorial anyway as I learn more skills.


Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rcane

Quote from: Kindred on January 19, 2023, 03:06:47 PMwhy not use ssi_login?

Wha?

Ok, I went and found ssi_login() in the manual. 

The page is a little thinner than I had hoped for.  It mentions "outside SMF", but I'm not sure it means what I hope it means.  It sounds like it's limited to the domain you're on and not some external site that you'd access with a username/password.

Do you know of any examples for using it "outside"?

vbgamer45

Its going to depend on how the page is coded. But if it is a login page with a session/cookie you need to store it and use it for future requests

curl_setopt($ch, CURLOPT_COOKIEJAR, $curlCookiefile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $curlCookiefile);
https://electrictoolbox.com/php-curl-cookies/
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

rcane

See, your brains are up *here*, and mines is.......right........down............*(there)*.

I've only tried on curl session before and it wasn't to a login type of environment, so I would not call that experience with it.

Since I don't know for certain if it uses a session/cookie I would think it prudent to presume it does.


All that said, how does ssi_login() help this process?
What part of the curl process does it replace or refine?

vbgamer45

If is not an SMF based site then it doesn't matter.

Basically any login system uses a session/cookie so it doesn't have to ask for your login on each page request.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rcane


Advertisement: