Page 5 of 5 FirstFirst 12345
Results 41 to 48 of 48

Thread: PHPLock

  1. #41
    Join Date
    Jan 2007
    Posts
    190
    Tokens
    0

    Default

    Cool thank you i will read the code when i get time and learn some thing from it.

  2. #42
    Join Date
    Jan 2007
    Posts
    190
    Tokens
    0

    Default

    Sorry to 2 posted but could not edit my other post :S

    Dentafrice dose not work i have a look at the code typed to fix it but i am stumped.

  3. #43
    Join Date
    Apr 2007
    Location
    GTA: SA
    Posts
    337
    Tokens
    0

    Default

    This is an addon to what Dentafrice posted. It's so you can make licences/serials.

    I am a newbie at PHP, it's only quick, and I've not been learning long. I've made the SQL too.

    PHP Code:
    <?php
    include "config.php";
    if (
    $_POST[enter]) {
    $serial1 $_POST[serial1];
    $serial2 $_POST[serial2];
    $serial3 $_POST[serial3];
    $serial4 $_POST[serial4];
            
    $query mysql_query("INSERT INTO serial (serial1, serial2, serial3, serial4) VALUES('$serial1','$serial2','$serial3','$serial4')");
            echo 
    "Serial has been made. The serial is ".$serial1."-".$serial2."-".$serial3."-".$serial4."";
            
    }
    else
    {
    echo (
    "<form method=\"POST\">
    Serial1: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"serial1\"><br />
    Serial2: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"serial2\"><br />
    Serial3: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"serial3\"><br />
    Serial4: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"serial4\"><br />
    <input name=\"enter\" type=\"submit\" value=\"Submit\">
    </form>"
    );
    }
    ?>
    Save that as add.php

    the SQL is

    PHP Code:
    CREATE TABLE `serial` (
    `
    idint(11NOT NULL auto_increment,
    `
    serial1varchar(4NOT NULL default '',
    `
    serial2varchar(4NOT NULL default '',
    `
    serial3varchar(4NOT NULL default '',
    `
    serial4varchar(4NOT NULL default '',
    PRIMARY KEY (`id)
    ) TYPE=MyISAM; 
    If it doesn't work I'll try and fix. IT HAS NO SECURITY. So a good idea would be to delete the file from your site when you've added a licence, then re upload to a hidden location when you want to add another. But, it can only hold 4 characters in each, not enough for SQL injection?

    I'll try making something so you can edit the licence/serial.

    I've been learning for like 3 days, looking at tuts etc, and I can remember a lot, but usually get errors.

    Xotuako
    Last edited by Xotuako; 13-05-2007 at 07:53 AM.
    I wont be on so much this week - but I'll be on. :8

  4. #44
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    Or just use HTAccess on the directory...

    Very usefull DF and Xblahblah-cant-remember-your-name
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  5. #45
    Join Date
    Apr 2007
    Location
    GTA: SA
    Posts
    337
    Tokens
    0

    Default

    Quote Originally Posted by Jaffa Cakes! View Post
    Or just use HTAccess on the directory...

    Very usefull DF and Xblahblah-cant-remember-your-name
    Lol, thanks. It works I think, I don't have SQL on my bad host (good ones upgrading), but form works etc. Just can't find sql.

    This is a good way to remember my name. In Spain, for short text they use an X as ch. So you'd pronounce my name Cho-too-ah-koh Or Cho-too-ah-ko
    I wont be on so much this week - but I'll be on. :8

  6. #46
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    It was just something simple, why make serials in its own table, each license has a field for a key:

    `key` text NOT NULL,

    AKA serial.

  7. #47
    Join Date
    Apr 2007
    Location
    GTA: SA
    Posts
    337
    Tokens
    0

    Default

    Quote Originally Posted by Dentafrice View Post
    It was just something simple, why make serials in its own table, each license has a field for a key:

    `key` text NOT NULL,

    AKA serial.
    Hmm, I suppose so. Good idea. I might work on it, and edit things to make it better, I dunno.

    If I do will you help me when I get stuck? You're a much better coder than me, so you'd know what to do
    I wont be on so much this week - but I'll be on. :8

  8. #48
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Sure

    add me on msn

    hxfname at live . com

Page 5 of 5 FirstFirst 12345

Posting Permissions

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