zwadmin Posted July 11, 2008 Share Posted July 11, 2008 I am in a situation where I need to post 3 variables via a login form ($email, $password, $domain) to a remote URL (http://domain.com/login.php). The tricky part for me is that the remote URL “http://domain.com” is determined by what the user types in the domain field ($domain). Does anyone have a snippet of code that would work or maybe a suggestion of a function to use that could get this working? Link to comment https://forums.phpfreaks.com/topic/114321-post-variables-to-remote-url/ Share on other sites More sharing options...
ag3nt42 Posted July 11, 2008 Share Posted July 11, 2008 if i understand your boggle correctly.. I use a similar method on one of my web apps.. but when the users first install the application... I take the server input information I collect and toss it into a config.php file that I create on the fly and then include into all my other scripts... kinda like making global variables... then I can use them wherever in the code... something liek this: ///////////////////////// //* CREATE CONFIG.PHP *// ///////////////////////// $Cpath = "../config.php"; $Cinfo = "<?php".PHP_EOL."\$dbusername='".$dbUsername."';".PHP_EOL."\$dbpassword='".$dbPassword."';".PHP_EOL."\$dblocation='".$dblocation."';".PHP_EOL."\$dbname='".$dbname."';".PHP_EOL."\$tblpre='".$tblPre."';".PHP_EOL."\$dbport='".$dbport."';".PHP_EOL.PHP_EOL."\$domain='".$domain."';".PHP_EOL."\$sPath='".$sPath."';".PHP_EOL."?>"; $config = fopen($Cpath,"w"); if(fwrite($config,$Cinfo)) { $Cfile="True"; fclose($config); } else { echo("ERROR!:[unable to Generate Configuration File]<br />"); echo("Please verify that the Lotus directory is writable. "); } Link to comment https://forums.phpfreaks.com/topic/114321-post-variables-to-remote-url/#findComment-587865 Share on other sites More sharing options...
craygo Posted July 11, 2008 Share Posted July 11, 2008 in order to do what you want, you would have to either 1 have a quick form to ask the user for the domain, then show the form for the username and password, or 2 use javascript to get the value from the field and put it into the url. Ray Link to comment https://forums.phpfreaks.com/topic/114321-post-variables-to-remote-url/#findComment-587870 Share on other sites More sharing options...
ag3nt42 Posted July 11, 2008 Share Posted July 11, 2008 why would you need to collect info for the users domain just to send that same information to their domain?? how would know if they have the code in place on the other side to collect that info? j/w Link to comment https://forums.phpfreaks.com/topic/114321-post-variables-to-remote-url/#findComment-587872 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.