コード例 #1
0
<?php

require_once "functions.php";
require_once "../classes/Edit.class.php";
$Edit = new Edit($mysqli);
//kasutaja muudab andmeid
if (isset($_GET["update"])) {
    $Edit->updateContestData($_GET["contest_id"], $_GET["contest_name"], $_GET["name"]);
}
//kas muutuja on aadressireal
if (isset($_GET["edit_id"])) {
    echo $_GET["edit_id"];
    //küsin andmed
    $Edit->{$all_contest} = getSingleContestData($_GET["edit_id"]);
    var_dump($all_contest);
} else {
    //kui muutujat ei ole, ei ole mõtet siia lehele tulla
    header("Location: table.php");
}
?>

<form action="edit.php" method="get">
    <input name="contest_id" type="hidden" value="<?php 
echo $_GET["edit_id"];
?>
">
    <input name="contest_name" type="text" value="<?php 
echo $car->contest_name;
?>
"><br>
    <input name="name" type="text" value="<?php 
コード例 #2
0
ファイル: edit.php プロジェクト: katariinal/3.kodutoo-I-ruhm
<?php

require_once "edit_functions.php";
//kasutaja muudab andmeid
if (isset($_GET["update"])) {
    updateContestData($_GET["contest_id"], $_GET["contest_name"], $_GET["name"]);
}
//kas muutuja on aadressireal
if (isset($_GET["edit_id"])) {
    echo $_GET["edit_id"];
    //küsin andmed
    $all_contest = getSingleContestData($_GET["edit_id"]);
    var_dump($all_contest);
} else {
    //kui muutujat ei ole, ei ole mõtet siia lehele tulla
    header("Location: table.php");
}
?>

<form action="edit.php" method="get">
    <input name="contest_id" type="hidden" value="<?php 
echo $_GET["edit_id"];
?>
">
    <input name="contest_name" type="text" value="<?php 
echo $car->contest_name;
?>
"><br>
    <input name="name" type="text" value="<?php 
echo $all_contest->name;
?>