Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: PHP redirect script doesn't work...

  1. #1
    Join Date
    Aug 2004
    Posts
    544
    Rep Power
    0

    Default Form Mailer Problems...

    The php redirect script for my form-mailer not working...pulled the example off a site and almost every other site has the same example but it just not working for me...

    PHP Code:
    <?
      $email 
    $_REQUEST['email'] ;
      
    $message $_REQUEST['message'] ;

      
    mail"yourname@example.com""Feedback Form Results",
        
    $message"From: $email);
      
    header"Location: http://www.example.com/thankyou.html" );
    ?>
    I keep getting error msgs like these...
    Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxx/xxx/xxx/xxx/nameoffile.php:10) in /xxx/xxx/xxx/xxx/xxx/nameoffile.php on line 16

    What do I do?
    Last edited by erbag; Dec 3, 2005 at 05:50 PM.
    Follow the pxJunkie:
    Twitter || Tumblr || Blogger || Buzz || Flickr

  2. #2
    Join Date
    Aug 2004
    Posts
    544
    Rep Power
    0

    Exclamation

    While waiting for a reply I went searching and did some dabbling...I final did this put this code at the extreme top of the page and eliminated it from the previous code I posted...and it worked.
    PHP Code:
    <?php
    header
    ("location:http://site.com/dir/subdir/mypage.html");
    ?>
    I actually want to add some more things to the txt that will be recieved via e-mail. Like: Making it says it from an e-mail account, without the user typing one in and probly a likkle tag at the bottom of the e-mail that may say something like "This e-mail powered by XXXX"

    How do I do that?
    Follow the pxJunkie:
    Twitter || Tumblr || Blogger || Buzz || Flickr

  3. #3
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    Quote Originally Posted by erbag
    While waiting for a reply I went searching and did some dabbling...I final did this put this code at the extreme top of the page and eliminated it from the previous code I posted...and it worked.
    PHP Code:
    <?php
    header
    ("location:http://site.com/dir/subdir/mypage.html");
    ?>
    I actually want to add some more things to the txt that will be recieved via e-mail. Like: Making it says it from an e-mail account, without the user typing one in and probly a likkle tag at the bottom of the e-mail that may say something like "This e-mail powered by XXXX"

    How do I do that?
    instead of just passing the message as supplied as you do, consider editing

    Code:
    $message = "$message\n\nThis message powered by XXXX";

  4. #4
    Join Date
    Aug 2004
    Posts
    544
    Rep Power
    0

    Default

    I figure \n means new line...?
    Thanx...tried it and it worked! Solved one part of the equation...having custom e-mail that it comes from now is the next challenge and how to lose the 'MSG TITLE' if I wanted to...
    Last edited by erbag; Dec 3, 2005 at 06:57 PM.
    Follow the pxJunkie:
    Twitter || Tumblr || Blogger || Buzz || Flickr

  5. #5
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    Quote Originally Posted by erbag
    I figure \n means new line...?
    Thanx...tried it and it worked! Solved one part of the equation...having custom e-mail that it comes from now is the next challenge and how to lose the 'MSG TITLE' if I wanted to...
    what do u mean by that?

  6. #6
    Join Date
    Aug 2004
    Posts
    544
    Rep Power
    0

    Default

    The new line I figured out by dabbling with what u gave me...

    What am I saying...I'm playing around with the code I posted earlier and so...I want to not have the user put in a 'userzemailaddress@email.com' but have one that says from 'myfixedemaildummy@email.com' regardless where it comes from. The name of the person I would still keep and the 'title' of the msg I want to lose...

    hope u get me...
    Follow the pxJunkie:
    Twitter || Tumblr || Blogger || Buzz || Flickr

  7. #7
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    still dont get u, if only because what you seem to want to do sounds too simple to be a problem.

    first if u want to use a fixed email instead of one given by the user, then dont include email as a field in your form and in the script where you place the user's email just put the email that you want.

    As for the title of the message, are you talking about the subject. IM confused

  8. #8
    Join Date
    Aug 2004
    Posts
    544
    Rep Power
    0

    Default

    sorry that I am confusing you...but you pretty much have it. Don't want the user to give me an e-mail just their name. Used an hidden field called 'email' with a pre-set value but it doesn't come in the msg, coz I not sure how else to modify the php code...the subject...I want to rid myself of uf I can. Can I?

    --------------------------------------
    I did some more modifications and I got rid of the 'subject'. It looks something like this, take a look.
    PHP Code:
    <?
      $email 
    $_REQUEST['email'] ;
      
    $message $_REQUEST['message'] ;
      
    $message $message\\nThis msg brought to yo by XXXX;
      
    mail"yourname@example.com""",
        
    "From: $email"$message );
     
    ?>
    Last edited by erbag; Dec 5, 2005 at 10:08 AM.
    Follow the pxJunkie:
    Twitter || Tumblr || Blogger || Buzz || Flickr

  9. #9
    Join Date
    Aug 2004
    Posts
    544
    Rep Power
    0

    Default

    Neva mind...I got!!!! Thnx again!!!
    Follow the pxJunkie:
    Twitter || Tumblr || Blogger || Buzz || Flickr

  10. #10
    Join Date
    Jun 2004
    Posts
    296
    Rep Power
    0

    Default

    Quote Originally Posted by erbag
    Neva mind...I got!!!! Thnx again!!!
    you should tell us ur fix, for the betterment of those who might be following this thread . Well that would be the forum-etiquette thing to do

Posting Permissions

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