1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

PHP Validation Script

Discussion in 'Programming' started by [GV]AnarchY, Sep 22, 2014.

  1. #1
    Hi,
    Would be a great help if someone could help me here. I've got basically everything I need completed. I've got SQL data base up. I've got form that I fill out and adds ID to database Its a simple PHP validation script that validates a customer ID based off of their input. You can see demo here http://192.185.52.231/~okcorp/outpost_server/chat.php. The working script is below:

    <?PHP
    if($_GET["inputid"] == "0" && $_GET["value"] == "TEST")

    {
    echo "lz_validate_input_result(true,0);";
    exit();
    }
    else
    {
    echo "lz_validate_input_result(false,0);";
    exit();
    }
    ?>

    "TEST" needs to be replaced with ID from database.

    if($_GET["inputid"] == "0" is required in order for a TRUE response from server so it can validate customer ID. I'm sure this is easy. Anyone can help me by modifying my code would be huge help!
     
    [GV]AnarchY, Sep 22, 2014 IP
  2. digdan

    digdan Active Member

    Messages:
    21
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    83
    #2
    1) It helps to have formatting. Pastebin could help.
    2) Use an IDE that tells you whats a string and whats a functions. It appears that lz_validate_input_result looks like a function, but you are encapsulating it as a string, which would echo the literal name of the function and not its results.
     
    digdan, Sep 22, 2014 IP
  3. [GV]AnarchY

    [GV]AnarchY Well-Known Member

    Messages:
    599
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    130
    #3
    its a Custom Field Validation using livezilla. The only instructions they give are here https://www.livezilla.net/faq/en/?fid=input-validation I need to be able to import custom ID's from database. I have code below will display the id's

    <?php
    $con=mysqli_connect("localhost","user","pass","client_data");
    // Check connection
    if (mysqli_connect_errno()) {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }

    $result = mysqli_query($con,"SELECT * FROM data");

    while($row = mysqli_fetch_array($result)) {
    echo $row['clientid'];
    }

    mysqli_close($con);
    ?>

    I actually turned it into a function . From link below you can see id's 105 and 106 being displayed.
    http://www.partoutpost.com/client/data/display_new.php


    source for display_new.php is
    <?php include("client_id.php"); ?>
    <?php clientid(); ?>
     
    [GV]AnarchY, Sep 22, 2014 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    What exactly are you trying to do? Show some result based on which ID given by the user? (ie, if the user provides "105" then you'll show whatever is registered on "105" from the database?)
    First thing you'd need for that is a WHERE-clause in the query...
     
    PoPSiCLe, Sep 22, 2014 IP
  5. Krellen

    Krellen Greenhorn

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    18
    #5
    I'm also having a hard time understanding what you're trying to accomplish exactly. Are you just trying to provide a TRUE/FALSE answer if an ID is valid (exists in your database)?
     
    Krellen, Sep 22, 2014 IP