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 4 of 4

Thread: help plz

  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    help plz

    K i have no idea what's wrong with this. Everything seems to work fine.

    Code:
    <?php
    
    $to = "emopwns@gmail.com";
    $subject = "Subject";
    $txt = "IP:" .{$_SERVER["REMOTE_ADDR"]};
    
    mail($to,$subject,$txt);
    ?>
    it comes out parse error on line 5, plz help

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,146
    Thanks
    2
    Thanked 333 Times in 325 Posts
    The actual parse error message probably contains information on what is wrong (it should have been something like - Parse error: parse error, unexpected '{' in C:\Program Files\Apache Group\Apache2\htdocs\yourfile.php on line 5), but the { and } surrounding the variable are only used when a variable is contained within a double-quoted string, which it is not in this code.

    Edit: We only see what you post. To receive the best help, always post actual code and actual error messages. Anything else just turns this into a 20 question guessing game and causes wild goose chases.
    Last edited by CFMaBiSmAd; 01-05-2007 at 03:55 AM.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's no unexpected { or whatever. Just the simple

    Code:
    Parse error: parse error in c:\program files\easyphp1-8\www\aimqueef.php on line 5

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Did you read CFMaBiSmAd's post about the brackets not being needed unless inside double quotes?
    PHP Code:
    <?php

    $to 
    "emopwns@gmail.com";
    $subject "Subject";
    $txt "IP:" $_SERVER["REMOTE_ADDR"];

    mail($to,$subject,$txt);
    ?>
    Try that.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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