Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: refresh issue

  1. #1
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    basically i had a php script i had downloaded and tried to add it to my own existing html form. the script i downloaded worked fine.

    PHP Code:
    <?php
    if ($submit) { // if the form was sent do the following

    if($Fname && $phone && $email && $message ) { // if all field are filled-in send email
    mail("thefuzmixman@yahoo.com","$phone","$message","From: $Fname <$email>") or die("email error");
    echo 
    "Message Sent"// if all went well, display message was sent
    } else {
    echo 
    "All fields must be filled in!<BR>"// if not all were filled in, display error message
    }
    // end php submission code
    ?>
    when i added this information, i changed the variables to suit my own needs, but the script no longer worked. i found that i needed to add 2 hidden fields
    Code:
    <input type="hidden" name="mailTo" value="myaddress@domain.com">
    <input type="hidden" name="Subject" value="Comment from Domain.com">
    and viola... problem solved. also i didnt specify an action for the form. in the downloaded version there wasnt one either, however i used this.....
    Code:
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    another thing that was messed up was the mail() variable order.
    When i used "mailto/message/xheaders" it was sending the message body as the subject and nothing as a message. lol..

    when i used "mailto/subject/message/xheaders" everything was fine. so i supposed one should not tamper with order here.
    Last edited by thefuzmixman; 04-16-2004 at 05:40 AM. Reason: resolved problem

  • #2
    New Coder
    Join Date
    Apr 2004
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ***removed***

    Secondly, put the PHP code block at the top of the file

    Thirdly, check for $_POST['submit'], not just $submit

    zigo
    Last edited by firepages; 04-15-2004 at 02:56 PM.

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    zigo86 , continue with replies like that and your stay at CF will we short if not sweet , this is a help forum with users of ALL abilites and all are welcome , if you simply forgot the smiley in your post which would have put it in a different light I apologise , else ... well then I don't
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    did i tick that person off..? lol. ok then. well all i got was the second thing. something about globals? yea a friend sent me to a page, but i didnt get it. But i mean if the original script does work (uploaded it, tested it, and got an email)

    about the php code being atop the html, that wasn't how it was in the script.

  • #5
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Welcome here thefuzmixman !

    There is no need to remove your initial post after the problem (or whatever it was) is solved. It would be nicer to leave it on and maybe point out how you solved it, so that other people possiby could learn something from it, or so that other people probably might point out some stuff you could optimize or whatever.
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #6
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    aw.. im sorry. i didnt really even think about that. I'll remember that in future posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •