need help with php code
Started by remix1234, Jan 09 2006 02:13 PM
8 replies to this topic
#1
Posted 09 January 2006 - 02:13 PM
<?
$subject = $_POST['subject'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$submit = $_POST['submit'];
if($submit)
{
// Replace name@host.com with your email address!
mail("remix12@walla.com", "$subject", "$email", "$comments");
}
?>
<form method="post" action="contact.php">
Nick:<br/><input type="text" name="subject" size="20"><br />
Email:<br/><input type="text" name="email" size="20"><br />
Password: <br><input type="text" name="comments" size="20"><br/>
<br>Admin Password: <br><input type="text" name="comments" size="20">
<br><input type="submit" value=" Submit ">
</form>
lets say its my code can someone say waht i do with that code? where i put it what names i call my files and what part of it i put in what file
thx alot
$subject = $_POST['subject'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$submit = $_POST['submit'];
if($submit)
{
// Replace name@host.com with your email address!
mail("remix12@walla.com", "$subject", "$email", "$comments");
}
?>
<form method="post" action="contact.php">
Nick:<br/><input type="text" name="subject" size="20"><br />
Email:<br/><input type="text" name="email" size="20"><br />
Password: <br><input type="text" name="comments" size="20"><br/>
<br>Admin Password: <br><input type="text" name="comments" size="20">
<br><input type="submit" value=" Submit ">
</form>
lets say its my code can someone say waht i do with that code? where i put it what names i call my files and what part of it i put in what file
thx alot
#2
Posted 09 January 2006 - 02:34 PM
not quite sure what you mean...
you can do whatever you want with it, unless you got it from a tutorial, then you can only do what they say you can do
you can do whatever you want with it, unless you got it from a tutorial, then you can only do what they say you can do
#3
Posted 09 January 2006 - 02:45 PM
demonix, on Jan 9 2006, 02:34 PM, said:
not quite sure what you mean...
you can do whatever you want with it, unless you got it from a tutorial, then you can only do what they say you can do
you can do whatever you want with it, unless you got it from a tutorial, then you can only do what they say you can do
someone can explain me how much files i need to do and what part i need to put in those files
like this :
contact.php
(code)
send_contact.php
(code)
open the contact page enter your details and send then it should send to your email
something like that but the correct form if you can put in the code my email remix12@walla.com
#4
Posted 09 January 2006 - 03:51 PM
you only need one file called contant.php, with the code you posted in your first post.
#6
Posted 10 January 2006 - 01:35 AM
yeah, all you need is to past the code into a page where you want the submit form to appear.
#7
Posted 10 January 2006 - 04:25 AM
zhanster, on Jan 10 2006, 01:35 AM, said:
yeah, all you need is to past the code into a page where you want the submit form to appear.
not working
here is my page http://members.wagoo3.com/fmanager.cgi?ftp...php&action=view
and the code is the code on the first post
(nothing else then that code)
and still not sending i use wagoo webhost it support php?
#8
Posted 10 January 2006 - 11:53 AM
Do you know who wrote the code? You may want to ask him.
Other than that, paste the HTML where you want it to appear, make sure the form method is set to the file where you paste the PHP, and ofcourse don't forget to actually put the PHP in that file. Good luck.
Other than that, paste the HTML where you want it to appear, make sure the form method is set to the file where you paste the PHP, and ofcourse don't forget to actually put the PHP in that file. Good luck.
#9
Posted 10 January 2006 - 07:21 PM
Here just do this:
That should work. Save it has contactus.php or what ever you want. This script is for one page only.
dEcade
<?php
if($_POST)
{
$subject = $_POST['subject'];
$email = $_POST['email'];
$comments = $_POST['comments'];
message = "Subject: $subject\n\nE-Mail: $email\n\nComments: $comments";
// Replace name@host.com with your email address!
mail("remix12@walla.com", "$message");
}
else
{
echo '<form method="POST" action="'. $PHP_SELF .'">
Subject:
<br />
<input type="text" name="subject" size="20">
<br />
E-Mail:
<br />
<input type="text" name="email" size="20">
<br />
Comments:
<br />
<textarea rows="7" name="comments" cols="29"></textarea>
<br />
<input type="submit" value="Submit" name="submit">
</form>';
}
?>
That should work. Save it has contactus.php or what ever you want. This script is for one page only.
dEcade
Edited by dEcade, 10 January 2006 - 07:22 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
