FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Need help with a submit form

 


andy26
hi could someone please give me the code or help me out here as i need a form such as name and your embeded video code for the inputs then i want these forms to be able to submit to my webspace. as im wanting it so people can come on my site and submit there youtube video code so that i can then copy and past the code onto my site.

thank you in advance
{name here}
You will need to make a form, and a PHP, Perl, or ASP script to intercept the data, interpret it and store it. You need to learn how to script.
minik
This is my attempt. It is written in PHP and should send the data to your email address.

submit.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Submit</title>
</head>

<body>
<form id="" name="" method="post" action="add.php">
  <p>Name:<br />
    <input type="text" name="textfield" />
</p>
  <p>Your embed video code:<br />
 
    <textarea name="textarea" cols="50" rows="10"></textarea>
  <p>
    <input type="submit" name="Submit" value="Submit" />
 
</form>
</body>
</html>


and

add.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Thanks</title>
</head>

<body><?php
$email = $HTTP_POST_VARS[email];
$mailto = "email@address"; //change this to your own email address
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Information:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
?>

YOUR THANKYOU MESSAGE HERE
</body>


</html>
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.