no. you can't mix the html and php just like that.
You need 3 sections:
1) a html file. This should contain your form that you want to get the details from.
Quote:
<TD><normalfont><B>User Name:</B></normalfont></TD>
<TD><INPUT TYPE="TEXT" NAME="$username" SIZE=25 MAXLENGTH=25>
</TD>
</TR>
<TD><normalfont><B>Password:</B></normalfont></TD>
<TD><INPUT TYPE="PASSWORD" NAME="$password" SIZE=25 MAXLENGTH=15> </TD></TR>
<TD><normalfont><B>Email:</B></normalfont><br>
<smallfont>Please enter a valid email address. You can choose to hide it below in the preferences section.</smallfont></TD>
<TD><INPUT TYPE="TEXT" NAME="$email" SIZE=25 MAXLENGTH=50>
</TD>
</TR>
|
is sort of right but you do not use $password in a form like this you just use name="password" that is all.
Then you need a submit button with the action pointing to your php script script.
2. Php Script.
call this process.php or whatever you want.
it gets the info from the above script (this is email and password). The values that email holds (ie what was typed in) is now held in $email.
You can do now what ever you want with these variables in the script, add them to a database etc whatver.
3. Sending a form off.
If you want to sign someone up for the everyone.net email account then what you have next appears ok
Quote:
PostToHost("www.everyone.net","/whatever/signup2.php","everyonename=".urlencode($username). "&everyoneemail=".urlencode($email)."&everyonepass word=".urlencode($password)."");
function PostToHost($host, $path, $data_to_send) {
$fp = fsockopen($host,80);
fputs($fp, "POST $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
fputs($fp, "Connection: close\n\n");
fputs($fp, $data_to_send);
while(!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
|
(this should be just a section of your process.php script or whatever you call it.
Of course, everyone.net will need more fields in their signup process, to find out view the source of their webpage. (p.s. i still don't think it will necessary work as they will have referer checking on it but you can try).
That is all there is to it.
p.s.
i think you need to do a bit of reading about how basic form processing in php works so you can understand how the advanced stuff does (which some of this is). There are loads of good tutorials on this sort of thing,
www.hotscripts.com is a good place to find lots of them, it will almost certainly help.