Results 1 to 40 of 40

Thread: submit button

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    53

    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

  2. #2
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    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.

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    53
    that didn't work
    thanx anyway though
    Platty rules

  4. #4
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    what do you mean it didnt work? what happened? what errors?

  5. #5
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  6. #6
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    Oh, silly me

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    53
    it came up saying the page cannot be displayed
    Platty rules

  8. #8

    Thread Starter
    Member
    Join Date
    Jun 2002
    Posts
    53
    if you could put in some " and then show me I would be really greatful
    Platty rules

  9. #9
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    do you want it in 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

  10. #10
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    I added the qoute, in my code. But It seems like you dont even have PHP setup.

  11. #11
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  12. #12
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  13. #13
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  14. #14
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    can you show me the whole code please, because I am kinda new to this whole PHP thing....thanx

  15. #15
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  16. #16
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  17. #17
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  18. #18
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  19. #19
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  20. #20
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  21. #21
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  22. #22
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  23. #23
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  24. #24
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  25. #25
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  26. #26
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    Just use my code for testing purposes.

  27. #27
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  28. #28
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Perhaps your host does not provide support for the mail() funtion?

  29. #29
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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>

  30. #30
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    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

  31. #31
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    what happened to your post count scoutt

    I leave for 6 months and you lose like 2500 posts

  32. #32
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    VBF had a massive crash, and the DB was royally fooked, alot of people lost accounts and posts.

  33. #33
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Yeah, i've noticed a few

    DaoK, wralston, scouut, DavidHooper


    a few more that i haven't seen as well

  34. #34
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    Originally posted by da_silvy
    what happened to your post count scoutt

    I leave for 6 months and you lose like 2500 posts
    yeah while everyone was getting posts I decided to go backwards. don't know why they haven't returned my regular posts, I told them twice. oh well life goes on, just not here.
    Just Imagine what you can do with the power of php.

    257 Tutorials and counting.
    529 Snippets and growing.

    Add yours today @
    SnippetLibrary.com

  35. #35
    Member
    Join Date
    Jun 2002
    Location
    Delaware
    Posts
    33
    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

  36. #36
    Lively Member scoutt's Avatar
    Join Date
    Aug 2002
    Posts
    84
    what directory?
    Just Imagine what you can do with the power of php.

    257 Tutorials and counting.
    529 Snippets and growing.

    Add yours today @
    SnippetLibrary.com

  37. #37
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    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();
    ?>

  38. #38
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    are you trying to upload a file to your server or send email?

  39. #39
    Fanatic Member Gimlin's Avatar
    Join Date
    Dec 2001
    Location
    Hell
    Posts
    734
    it is trying to send an email

  40. #40
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    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
  •  



Click Here to Expand Forum to Full Width