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 10 of 10
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    article not sending throgh mail()

    Hello, I have a problem with a php script which firstly shows article, and than if user wants to send it to someone else, clicks on a link, which displays a form where this user enters email, name etc of the other user to whom he wants to send the article. Everything's perfect except the part that the article from the database isn't sent to the email ($info .= "Ziņa:\n".stripslashes($_POST['zinja'])."\n"; - this part of $info. is the only which isn't sent, in the email I receive only Ziņa:). Look at the code, hope you can help.

    Code: http://paste.php.lv/3908
    Code without line number: http://paste.php.lv/3908/nonum
    Last edited by keissfootball; 06-13-2006 at 08:28 PM.

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I can't see the accompanying form element for $_POST['zinja'] ! But i think you may have access to $zinja (line 19).
    my mind is on a permanent tangent

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry this wasn't the code version, this is is: http://paste.php.lv/3901
    Last edited by keissfootball; 06-13-2006 at 09:59 PM.

  • #4
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so which bit isn't working in that version? The code you originally quoted doesn't appear, so far as I can see!
    my mind is on a permanent tangent

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The line 91 doesn't work ($info .= "Ziņa:\n $rezultats2[0] \n";) It works on the line 22, when I display the article, but if I want to send it - no result in email message, just a blank field in the place of an article.

  • #6
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    line 10 is part of the problem, along with line 31.

    You aren't pulling anything from the database after you submit the form, as there is no $_GET["vairak"]

    You could try adding it to the action of the form, or passing it as a hidden input,. If using the second method with name 'vairak', you'll have to check the $_POST['vairak'] after the form has been submitted.
    my mind is on a permanent tangent

  • #7
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you want me to change this line

    switch($raksts){
    case "forma": echo"<FORM method=\"POST\" action=\"vairak.php?raksts=sutit&vairak='.$vairak.'\">

    like this?

    It isn't working either, maybe because my results are displayed in cycle?

  • #8
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you currently have:
    Code:
    echo"<FORM method=\"POST\" action=\"vairak.php?raksts=sutit\">
    you'd need that amending to:
    PHP Code:
    echo "<FORM method=\"POST\" action=\"vairak.php?raksts=sutit&vairak=$vairak\"> 
    (slightly different to what you posted.

    see if that works.
    my mind is on a permanent tangent

  • #9
    New Coder
    Join Date
    Jun 2006
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, it didn't work but I tried your second variant, I added extra field:

    <input type=\"hidden\" name=\"zinja\" value=\".$rezultats2[0].\">

    //--> lower

    @$zinja=$_POST['zinja'];

    //--> lower
    $info .= "Ziņa:\n $zinja \n";

    I don't know why I receive .. in the place of an article ?

    Edit: I got it, it's the 2 dots from here value=\".$rezultats2[0].\" but how can I give my variable to the switch part?
    Last edited by keissfootball; 06-14-2006 at 03:25 PM.

  • #10
    Regular Coder
    Join Date
    Sep 2005
    Location
    Liverpool
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can you repost your script again.
    my mind is on a permanent tangent


  •  

    Posting Permissions

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