Jump to content

Logging into admin panel via the URL


alirulez

Recommended Posts

Hi

 

Im new to PHP, so please bear with me

 

The problem I have is that I need my PHP script to go to the following URL if certain conditions are met. I do this through the following code

 

header("Location: http://localhost/admin/system/payment/payments/?action=Endorse&payments[" . $realPaymentId . "]");

 

The code works fine, if I am logged onto the admin panel in the first place. (http://localhost/admin)

When im not logged on, the code gets to the log-on screen and no further.

 

What I was hoping to do was to insert the username and password on the above header location somehow, so that when the link is initiated, the log-in is automatically processed, and the 'Endorse Payment' function is activated.

I do not know how to insert the login details on the above URL. Im not even sure if its possible.

 

Id be grateful if you could point me in the right direction

Link to comment
https://forums.phpfreaks.com/topic/201138-logging-into-admin-panel-via-the-url/
Share on other sites

You NEVER, NEVER, NEVER (yes, I'm shouting) want to put a username & password into a URL. That will get you into a lot of trouble.

 

You can use sessions to store the information, or put the username & password into a database and pass the row ID in the url.

 

Ken

Hi

 

thanks for your note. I understand the security risk involved in placing my username and password in the URL, but I know that the link will only be activated once a return URL is received from a custom payment gateway, and as such no human will see it.

 

Your idea of managing the login through session ids, or by database returns is great, but I have no idea how to implement.. Sorry I'm very new to this.

 

I'll be grateful for any more help

 

alirulez

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.