Jump to content

php / html link to POST to URL


LeatherSportb

Recommended Posts

Howdy,

 

I am trying to setup a single sign on type link on my website for a web mail client.

 

For security it is recommended to use the POST method to avoid sending the user name and password in the URL

 

I need to figure out how to make the 'My Mail' html link POST a URL like this:

 

http://server.com/atmail.php?username=username&password=password&pop3host=domain.com&LoginType=xp&Language=english

 

I have read that curl can do this, see http://www.alt-php-faq.org/local/55/#id55

 

But I have no idea how to make that work with my site and link.

 

This new code / link needs to replace the current link which is:

 

<span><a href="<?= $site['url'] ?>mail.php?mode=inbox"><?= _t('_My Mail') ?></a><?=' '.$sNewLet;?></span>

 

I can make this work without using POST like this:

 

<span><a href="<?= $site['url'] ?>mail/atmail.php?username=username&password=password&pop3host=domain.com&LoginType=xp&Language=english"><?= _t('_My Mail') ?></a><?=' '.$sNewLet;?></span>

 

But that is very insecure. You can see the user name and password just by mousing over a link, and it shows up in browser history.

 

I will be using a hash of the password, but you can still copy / paste the link and it will work.

 

Can anyone help me figure this out?

 

Thank you.

 

Link to comment
https://forums.phpfreaks.com/topic/149345-php-html-link-to-post-to-url/
Share on other sites

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.