Question Http Post to a php file

Webstyles

New member
Joined
Jan 25, 2010
Messages
2
Location
South Africa
Programming Experience
Beginner
Hi

I would like help with writing a http POST function that will pass global variables as the value for fields in a php file.

Thank you in advance.
PHP:

below is the php file code:
PHP:
<html>
<?php

if(!$_POST['login']) {
exit;
}

$user = $_POST['user'];
$pass = $_POST['pass'];
$port = $_POST['port'];
$domain = $_POST['domain'];

if($domain=="Server 1 Name"){$domain="Server 1 IP";}
if($domain=="Server 2 Name"){$domain="Server 2 IP";}
if($domain=="Server 3 Name"){$domain="Server 3 IP";}


$port == "2083" || $port == "2096" ? $pre = "https://" : $pre = "http://";
?>
<body onLoad="setTimeout('document.forms[0].submit();',10)">
<form action="<?php echo "".$pre."".$domain.":".$port."/login/"; ?>" method="post">
<input type="hidden" name="user" value="<?php echo $user; ?>">
<input type="hidden" name="pass" value="<?php echo $pass; ?>">
</form>
</body>
</html>
 
Back
Top