|
-
Aug 11th, 2002, 08:38 AM
#1
Thread Starter
Member
submit button
How do I make a submit button that will e-mail text directly to me and not bring up Outlook Express or Msn?
 Platty rules 
-
Aug 11th, 2002, 09:01 AM
#2
Fanatic Member
This should do it.
PHP Code:
<?php
if(isset($_REQUEST[submit])) {
mail("[email protected]", "My Subject", "Line 1\nLine 2\nLine 3");
}
Else {
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="Submit" name="submit" value="Send Mail">
</form>
<?php
}
?>
Last edited by Gimlin; Aug 11th, 2002 at 11:20 AM.
-
Aug 11th, 2002, 10:12 AM
#3
Thread Starter
Member
that didn't work
thanx anyway though
 Platty rules 
-
Aug 11th, 2002, 10:15 AM
#4
Fanatic Member
what do you mean it didnt work? what happened? what errors?
-
Aug 11th, 2002, 10:49 AM
#5
Lively Member
you forgot some " Gimlin 
also you can't make a sumbit button send anyhting. it is the form that gets sent. tell us what error you get if any.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 11th, 2002, 11:09 AM
#6
Fanatic Member
Oh, silly me
-
Aug 11th, 2002, 12:57 PM
#7
Thread Starter
Member
it came up saying the page cannot be displayed
 Platty rules 
-
Aug 11th, 2002, 12:58 PM
#8
Thread Starter
Member
if you could put in some " and then show me I would be really greatful
 Platty rules 
-
Aug 11th, 2002, 01:31 PM
#9
Lively Member
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 12th, 2002, 04:00 PM
#10
Fanatic Member
I added the qoute, in my code. But It seems like you dont even have PHP setup.
-
Aug 12th, 2002, 04:26 PM
#11
Lively Member
yeah if it says page not found then it does sound like you need php.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 12th, 2002, 05:01 PM
#12
Member
Can you show me it in php please, and then i will try it...I am really struggling to find the code..
My Site
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 12th, 2002, 07:36 PM
#13
Lively Member
uhh that code is in php.
try this in a new file called phpinfo.php
<?php
phpinfo();
?>
tell us what it displays?
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 13th, 2002, 07:15 PM
#14
Member
can you show me the whole code please, because I am kinda new to this whole PHP thing....thanx
-
Aug 13th, 2002, 08:37 PM
#15
Lively Member
you are joking right? the whole code to what, to the code that is listed above? did you try waht I suggested????
you better read some more if you think there is more code.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 14th, 2002, 04:16 PM
#16
Member
i don't understand what you mean by
uhh that code is in php.
try this in a new file called phpinfo.php
<?php
phpinfo();
?>
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 14th, 2002, 04:28 PM
#17
Lively Member
because you said Can you show me it in php please, and then i will try it...I am really struggling to find the code and I was telling you that it is in php what Gimlin showed you. that my boy is php.
add this into a file. which means open notepad and copy this
<?php
phpinfo();
?>
into it and then save it as phpinfo.php make sure it doesn't have a .txt after it.
then upload it to your server and see if you can run it. tell us what it says when you do run it.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 14th, 2002, 09:01 PM
#18
Member
i understand what it does now, and I do have php support. I got it working, and it does everything it is supposed to except send the actual e-mail....you may have seen my other post...but this is the script I have...
<?php
$comment = stripslashes($comment);
$YourEmail = "[email protected]";
if (!$name) {echo "You must enter your name,<BR>Please go back and make corrections.<BR> Thank you"; } else {
if(!$email == "" && (!strstr($email,"@") || !strstr($email,"."))) {echo "You must enter a VALID Email Address,<BR> Hit the back button and enter your email address."; } else {
if (!$email) {echo "Email Field was empty, please enter your email."; } else {
if (!$comment) {echo "You must leave a comment.<BR>Go back and enter your comment"; } else {
if (!$fav_script) {echo "Choose your Favorite Script"; } else {
PRINT "<FONT SIZE=-1 face=verdana>";
PRINT "$name, Thank-you very much!!";
PRINT "<HR>";
PRINT "<B>Information Sent Via Email:</b>";
PRINT "<br><BR>";
PRINT "Name: $name";
PRINT "<BR>";
PRINT "Email: $email";
PRINT "<BR>";
PRINT "Favorite Scripting Technology: $fav_script";
PRINT "<BR>";
PRINT "Comments:$comment";
PRINT "<HR>";
PRINT "<B><a href=http://www.php50.com/circusmijit13>PLEASE CLICK HERE, To get back on our Site</a>";
PRINT "<hr>";
PRINT "</b></body>";
PRINT "</html>";
mail("$email", "Thanks For Your Email", "
Thank-you $name,
\nYou filled out our E-mail Form.\nThe Information that was submitted was:
\nName:$name\nEmail:$email\nFavorite Scripting Technology: $fav_script
Comment: $comment\n\nRegards,\nNick\nwww.realgoodhosting.com");
mail("$YourEmail", "Email Form Result", "
From: $name,
\n$name filled out our E-mail Form.\nThe Information that was submitted was:
\nName:$name\nEmail:$email\nFavorite Scripting Technology: $fav_script
Comment: $comment\n\nRegards,\nWebMaster\nwww.realgoodhosting.com");
}
}
}
}
}
?>
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 15th, 2002, 07:34 AM
#19
Lively Member
to many if's and else's. don't worry about checking for syntax and other stuff until you actually have the email sending. then after that you can add what ever you want.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 15th, 2002, 08:38 AM
#20
Member
yeah....but why won't the actual e-mail send?...I can't figure it out
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 15th, 2002, 09:56 AM
#21
Lively Member
what version of php are you running?
are you submitting from a form to that script?
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 15th, 2002, 12:35 PM
#22
Member
i have no clue i just look at other people's scripts and then design my own by looking at the script....
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 15th, 2002, 02:33 PM
#23
Lively Member
you have to know how they work before you start taking other peoples scripts apart.
the reason it doesn't send any emials is becuase you didn't suplly it with one.
it makes a big difference if you tell us what version of php you are running?
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 15th, 2002, 02:42 PM
#24
Member
i think it is 3...it said 1.0.3 or something.....and i did supply it with an e-mail address...i typed it in at $YourEmail = "[email protected]"
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 15th, 2002, 02:46 PM
#25
Lively Member
yeah you typed in "$YourEmail = "[email protected]""
but it was looking for $email
also there is no version 1.0.3 for php.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 15th, 2002, 06:12 PM
#26
Fanatic Member
Just use my code for testing purposes.
-
Aug 17th, 2002, 07:14 PM
#27
Member
What is you problem?...i said i wasn't sure and it was something like 1.0.3.....and i used the script you gave me, and yes, I do have php support
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 17th, 2002, 11:43 PM
#28
Conquistador
Perhaps your host does not provide support for the mail() funtion?
-
Aug 18th, 2002, 08:49 AM
#29
Member
is there a way to find out if it does like the php one?
<html>
<marquee behavior="alternate" width=50%> This is a test </marquee>
-
Aug 18th, 2002, 12:02 PM
#30
Lively Member
and like I said, did you run phpinfo() in that script I gave you? that will tell you everythign that is on your server that you are allowed to run. don't say yeah it ran because you would have seen all that stuff.
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 19th, 2002, 02:29 AM
#31
Conquistador
what happened to your post count scoutt 
I leave for 6 months and you lose like 2500 posts
-
Aug 19th, 2002, 06:47 AM
#32
Fanatic Member
VBF had a massive crash, and the DB was royally fooked, alot of people lost accounts and posts.
-
Aug 19th, 2002, 06:57 AM
#33
Conquistador
Yeah, i've noticed a few 
DaoK, wralston, scouut, DavidHooper
a few more that i haven't seen as well
-
Aug 19th, 2002, 09:37 AM
#34
Lively Member
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 19th, 2002, 09:51 AM
#35
Member
i found the directory and now, how do I put that into my script?
sendmail_from:
[email protected]
sendmail_path:
/usr/sbin/sendmail -t -i
-
Aug 19th, 2002, 09:53 AM
#36
Lively Member
Just Imagine what you can do with the power of php.
257 Tutorials and counting.
529 Snippets and growing.
Add yours today @
SnippetLibrary.com
-
Aug 19th, 2002, 11:10 AM
#37
Fanatic Member
Are you running this on your computer or on a server?
If on server, which server?
If at home, what server software are you using, example: apache, IIS, PWS etc.
Find out what version of PHP you are using. Do this by what scoutt said.
<?php
phpinfo();
?>
-
Aug 19th, 2002, 04:53 PM
#38
Conquistador
are you trying to upload a file to your server or send email?
-
Aug 19th, 2002, 04:57 PM
#39
Fanatic Member
it is trying to send an email
-
Aug 20th, 2002, 01:42 AM
#40
Conquistador
whoops, wrong thread
i think he's posted another one like this regarding uploads :/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|