alirulez Posted May 9, 2010 Share Posted May 9, 2010 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 More sharing options...
kenrbnsn Posted May 9, 2010 Share Posted May 9, 2010 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 Link to comment https://forums.phpfreaks.com/topic/201138-logging-into-admin-panel-via-the-url/#findComment-1055259 Share on other sites More sharing options...
alirulez Posted May 9, 2010 Author Share Posted May 9, 2010 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 Link to comment https://forums.phpfreaks.com/topic/201138-logging-into-admin-panel-via-the-url/#findComment-1055318 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.