• Log in or sign up for an account here: https://www.sythe.org/login

Submit FORM something [Need help ASAP!]

d great one

Apprentice
Joined
Nov 4, 2007
Sythe Gold
0
Messages
930
needhelp.jpg


So this is my form.
I need to learn quick how to format my submit button, make it work. Like when I input a data... it will be sent to my email or maybe it will display the stuffs I input.

To give you easy time to help, I don't know PHP. But I know basic c++.
I don't get how to work it.
I tried reading all day for tutorials, but my time has run out. I need to make it work quickly.
So PLEASE (yes, I am begging) somebody help me. Or maybe a quick tutorial will do so I can learn (which would help a lot).

Please consider, I have a deadline to finish and I don't have much time.
Thanks!
 
when the button is clicked... make it run this...

Code:
<?php

//Change these to fit properly
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
//You can add the rest

$to      = '[email protected]';
$subject = 'New User';
$message = $first_name." ".$last_name;
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

then just go to that page, when someone hits the send button, provided you set it up to do what you want, then it'll e-mail everything you want it to, to you. :)
 
I don't get how to run this PHP with the button.
 
Code:
<?php

if (isset($_POST['form'])) {
	$surname = $_POST['surname'];
	$first_name = $_POST['first_name'];
	$initial = $_POST['initial'];
	$address = $_POST['address'];
	$contact_number1 = $_POST['contact_number1'];
	$contact_number2 = $_POST['contact_number2'];
	$contact_number3 = $_POST['contact_number3'];
	$emailaddress = $_POST['email_address'];
	$product_number1 = $_POST['product_number1'];
	$product_number2 = $_POST['product_number2'];
	$product_number3 = $_POST['product_number3'];
	$product_number4 = $_POST['product_number4'];
	$comments = $_POST['comments'];
	
	$layout = "Mr. ".$first_name." ".$initial." ".$surname." who lives at ".$address." which can be reached on ".$contact_number1." who's e-mail address is ".$emailaddress." has the product number ".$product_number1." and says ".$comments."
	
	$to      = '[email protected]';
	$subject = 'New User';
	$message = $layout
	$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

	mail($to, $subject, $message, $headers);
}
else {
	echo "<form name=\"form\" action=\"#\" method=\"post\">
		<b>Family Name</b> <input type=\"text\" name=\"surname\" value=\"\"><br>
		<b>First Name</b> <input type=\"text\" name=\"first_name\" value=\"\"><br>
		<b>Middle Name Initial</b> <input type=\"text\" name=\"initial\" value=\"\"><br>
		<b>Home Address</b> <input type=\"text\" name=\"address\" value=\"\"><br>
		<b>Contact Number</b> <input type=\"text\" name=\"contact_number1\" value=\"\"><br>
		<b>Contact Number</b> <input type=\"text\" name=\"contact_number2\" value=\"\"><br>
		<b>Contact Number</b> <input type=\"text\" name=\"contact_number3\" value=\"\"><br>
		<b>Email Address</b> <input type=\"text\" name=\"email_address\" value=\"\"><br>
		<b>Product Number</b> <input type=\"text\" name=\"product_number1\" value=\"\"><br>
		<b>Product Number</b> <input type=\"text\" name=\"product_number2\" value=\"\"><br>
		<b>Product Number</b> <input type=\"text\" name=\"product_number3\" value=\"\"><br>
		<b>Product Number</b> <input type=\"text\" name=\"product_number4\" value=\"\"><br>
		<b>Comments</b> <textarea></textarea><br>
		<input type=\"submit\" value=\"Submit\"><input type=\"reset\" value=\"Restart\">";
}
?>

Give that a shot :)
 
Runescape Gamblingrunescape gambling
Back
Top