Need simple variable transfer

dannygoh

Verified User
Joined
Feb 9, 2004
Messages
391
Location
Malaysia
I like to create a simple php form that capture

domain name
username
password

on successful, i will redirect to DA login page with their own domainname.com:2222 and prefill their username and password

thanks in advanced.
 
You could put the following into a single file:

PHP:
<?php

if ($_POST['username']) {
?>
<html>
<body onLoad="javascript:document.forms[0].submit()">
<form action="http://www.<? echo $_POST['domain'] ?>:2222/CMD_LOGIN" name="form" method="post">
  <input type="hidden" name="username" value="<? echo $_POST['username'] ?>">
  <input type="hidden" value="<? echo $_POST['password'] ?>" name="password">
  <input type="submit">
</form>
</body>
</html>
<?
//form has been submitted.
} else {
//no submission detected, show login page.
?>
<form name="form1" method="post" action="<? echo $_SERVER['PHP_SELF'] ?>">
  <p>user:
    <input type="text" name="username">
    <br>
    pass:
    <input type="password" name="password">
    <br>
    domain: http://www.
    <input type="text" name="domain">
    :2222</p>
  <input type="submit">
</form>
<? } ?>

HTH :)
 
Back
Top