Results 1 to 12 of 12

Thread: Dealing with passwords

Hybrid View

  1. #1
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Re: Dealing with passwords

    Hi!

    Why don't you put the method as post and also keep it hidden ?
    I am refering to: <form action="dbaseadmin.php?method=add" method="post">

    PHP Code:
    <form method="post" action="dbaseadmin.php">
    <
    input type="hidden" name="method" value="add">
    ...
    your other fields
    ...
    </
    form
    Thanks!
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  2. #2
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Red face Re: Dealing with passwords

    Hi!

    You can try this thing..its a one single file solution if you like it:

    PHP Code:
    <?php
    if (isset($_POST[method]))
    {
            
    // MySQL Database Host
            
    $dbhost "localhost";
            
    //MySQL Database Name
            
    $dbname "somedb";
            
    // MySQL Database Username
            
    $dbuser "someuser";
            
    // MySQL Database Password
            
    $dbpass "somepass";

            
    // Connect to db
            
    $connection mysql_connect($dbhost$dbuser$dbpass) or die(mysql_error());
            
    $db mysql_select_db($dbname$connection);

            
    // Check its add then do add
            
    if ($_POST[method] == "add")
            {
                    
    //put add code here
                    //..do some coding
                    // you always exit using exit(); from here or can continue
            
    }
            
            
    // Check its del then do del
            
    If ($_POST[method] == "del")
            {
                    
    //put delete code here
                    
    $sql "DELETE FROM blogs WHERE number='$id'";
                    
    mysql_query($sql) or die(mysql_error());
                    
    // you always exit using exit(); from here or can continue
            
    }
    }
    ?>

    <b class="skill">Add Entry:<br /><br /></b>
    <form action="dbaseadmin.php" method="post">
            <input type="hidden" name="method" value="add">
            <p>Username: <input name="user" type="text" size="25" maxlength="25" /></p>
            <p>Password: <input name="pass" type="password" size="25" maxlength="25" /></p>
            <p>Date: <input name="date" type="text" size="25" maxlength="30" /></p>
            <p>Title: <input name="title" type="text" size="40" maxlength="40" /></p>
            <p>Text:</p><p><textarea name="text" cols="65" rows="14"></textarea></p>
            <p><input name="Submit" type="submit" /><input name="Reset" type="reset" /></p>
    </form>
    <hr />
    <b class="skill">Delete Entry:<br /><br /></b>
    <form action="dbaseadmin.php" method="post">
            <input type="hidden" name="method" value="delete">
            <p>Username: <input name="user" type="text" size="25" maxlength="25" /></p>
            <p>Password: <input name="pass" type="password" size="25" maxlength="25" /></p>
            <p>ID #: <input name="id" type="text" size="12" maxlength="10000" /></p>
            <p><input name="Submit" type="submit" /><input name="Reset" type="reset" /></p>
    </form>
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  3. #3

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: Dealing with passwords

    I feel sooooooooooooo stupid right now. I had all my functions but never had a method that actually started everything.

Posting Permissions

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



Click Here to Expand Forum to Full Width