Jump to content

Post variables to remote URL


zwadmin

Recommended Posts

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

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. ");
	}

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.