Chintu da's Forum Posts

  • <?php

    // Allow from any origin

    if (isset($_SERVER['HTTP_ORIGIN'])) {

    // Decide if the origin in $_SERVER['HTTP_ORIGIN'] is one you want to allow, and if so:

    header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");

    header('Access-Control-Allow-Credentials: true');

    header('Access-Control-Max-Age: 86400'); // cache for 1 day

    }

    // Access-Control headers are received during OPTIONS requests

    if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {

    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))

    header("Access-Control-Allow-Methods: GET, POST, OPTIONS");

    if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))

    header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");

    exit(0);

    }

    // Database connection details

    $servername = "localhost";

    $username = "id22078763_db";

    $password = "Db@user5";

    $dbname = "id22078763_store";

    // Create connection

    $conn = new mysqli($servername, $username, $password, $dbname);

    // Check connection

    if ($conn->connect_error) {

    die("Connection failed: " . $conn->connect_error);

    }

    // Check if the request method is POST

    if ($_SERVER["REQUEST_METHOD"] == "POST") {

    // Get the score and player name from the POST data

    $score = $_POST['score'];

    $playerName = $_POST['playerName'];

    // Check if the player exists

    $sql = "SELECT id FROM users WHERE name = ?";

    $stmt = $conn->prepare($sql);

    $stmt->bind_param("s", $playerName);

    $stmt->execute();

    $result = $stmt->get_result();

    if ($result->num_rows > 0) {

    // Player exists, update their score

    $updateSql = "UPDATE users SET score = ? WHERE name = ?";

    $updateStmt = $conn->prepare($updateSql);

    $updateStmt->bind_param("is", $score, $playerName);

    $updateStmt->execute();

    echo "Score updated successfully";

    } else {

    // Player doesn't exist, insert a new record

    $insertSql = "INSERT INTO users (name, score) VALUES (?, ?)";

    $insertStmt = $conn->prepare($insertSql);

    $insertStmt->bind_param("si", $playerName, $score);

    $insertStmt->execute();

    echo "New record created successfully";

    }

    $stmt->close();

    }

    // Close the database connection

    $conn->close();

    ?>

    On Sql I have

    users table

    in this table

    name and score

    and im trying to post score

    getting error

    i dont know what's going wrong

    Tagged:

  • i face as same

  • Android And Windows Devices Text works properly As Center.

    But ios devices not

    Tagged:

  • drive.google.com/file/d/1KrWNQYMKwjN_-BiKuazLAEkYlyVDt2R-/view

    can you suggest me

    right way please

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ah Bro your Right,

    but How can i Compare with sprite.letter

    compare 2 values

    sprite.letter = LayoutA

    create Object

    like that ?

  • I have 3 Text In Layout2

    so i want to Create object is stored in another layout

    with comparing same values

    example image -

    Tagged:

  • So I Want To Connect Rest Api To My Construct Project

    SO I NEED TO MAKE SOME CHANGES INTO PROJECT USING VS CODE

    HOW TO DO THAT

    I installed Both Plugins Into My Construct Editor And VsCode Also

    Thanx Construct Users

    Tagged:

  • yes bro, i help you

    Can you record Video Or Image For Understand Better.

  • You can use local storage for , storing items.

  • You do not have permission to view this post

  • object follow border or edges on sprite

    i found example in example browser

    editor.construct.net

  • if Have many projects export

    for each project i do

    Menu > Project > Export > HTML >

    So Any shortcut Key Available For

    Direct HTML Options

    its too Lengthy When i Export 20+ Projects

    Tagged:

  • did you check

    Construct editor Examples

    i found example as same related that your idea

    in

    construct editor examples

    check it out

    editor.construct.net

  • You can found eraser in sprite editor

  • can you make video for reference

    and what size of sprite you importing in editior