| Autor | Zpráva | ||
|---|---|---|---|
| Sonda Profil * |
#1 · Zasláno: 1. 1. 2014, 02:55:30
Zdravím, jsem začátečník.
Tak jsem něco udělal podle webu. mám tu 4 soubory db.inc.php edit.php edit_data.php edit_form.php db.inc.php <?
mysql_connect("localhost","XXX","YYY");
mysql_select_db("ZZZZ");
?>edit.php <?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: název_vašeho_souboru.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
opentable("název vaší stránky");
?>
<table border=1>
<tr>
<td align=center>Form Edit Employees Data</td>
</tr>
<tr>
<td>
<table>
<?
include "db.inc.php";//database connection
$order = "SELECT * FROM Tabulka
where IDD='$id'";
$result = mysql_query($order);
$row = mysql_fetch_array($result);
?>
<form method="post" action="edit_data.php">
<input type="hidden" name="id" value="<? echo "$row[IDD]"?>">
<tr>
<td>Břídil</td>
<td><input type="text" name="player" size="20" value="<? echo "$row[player]"?>"></td>
</tr>
<tr>
<td>Odepisuje</td>
<td><input type="text" name="odepisuje" size="40" value="<? echo "$row[odepisuje]"?>"></td>
</tr>
<tr>
<td>Kód</td>
<td><input type="text" name="kod" size="40" value="<? echo "$row[kod]"?>"></td>
</tr>
<tr>
<td>Přispěl</td>
<td><input type="text" name="prispel" size="40" value="<? echo "$row[prispel]"?>"></td>
</tr>
<tr>
<td>Level</td>
<td><input type="text" name="level" size="40" value="<? echo "$row[level]"?>"></td>
</tr>
<tr>
<tr>
<td>Skype</td>
<td><input type="text" name="skype" size="40" value="<? echo "$row[skype]"?>"></td>
</tr>
<tr>
<td align="right">
<input type="submit"
name="submit value" value="Edit">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<?
closetable();
require_once THEMES."templates/footer.php";
?>edit_data.php <?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: název_vašeho_souboru.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
opentable("název vaší stránky");
?>
<?
include "db.inc.php";
$order = "UPDATE data_employees
SET player='$player', odepisuje='$odepisuje', kod='$kod', prispel='$prispel', level='$level', skype='$skype'
WHERE
IDD='$id'";
mysql_query($order);
header("location:edit.php");
?>
<?
closetable();
require_once THEMES."templates/footer.php";
?>edit_form.php <?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: název_vašeho_souboru.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
opentable("název vaší stránky");
?>
<table border=1>
<tr>
<td align=center>Form Edit Employees Data</td>
</tr>
<tr>
<td>
<table>
<?
include "db.inc.php";//database connection
$order = "SELECT * FROM Tabulka
where IDD='$id'";
$result = mysql_query($order);
$row = mysql_fetch_array($result);
?>
<form method="post" action="edit_data.php">
<input type="hidden" name="id" value="<? echo "$row[IDD]"?>">
<tr>
<td>Břídil</td>
<td><input type="text" name="player" size="20" value="<? echo "$row[player]"?>"></td>
</tr>
<tr>
<td>Odepisuje</td>
<td><input type="text" name="odepisuje" size="40" value="<? echo "$row[odepisuje]"?>"></td>
</tr>
<tr>
<td>Kód</td>
<td><input type="text" name="kod" size="40" value="<? echo "$row[kod]"?>"></td>
</tr>
<tr>
<td>Přispěl</td>
<td><input type="text" name="prispel" size="40" value="<? echo "$row[prispel]"?>"></td>
</tr>
<tr>
<td>Level</td>
<td><input type="text" name="level" size="40" value="<? echo "$row[level]"?>"></td>
</tr>
<tr>
<tr>
<td>Skype</td>
<td><input type="text" name="skype" size="40" value="<? echo "$row[skype]"?>"></td>
</tr>
<tr>
<td align="right">
<input type="submit"
name="submit value" value="Edit">
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<?
closetable();
require_once THEMES."templates/footer.php";
?>No a v databázi mám tohle: 1 IDD int(11) Ne Žádná AUTO_INCREMENT 2 player varchar(111) utf8_general_ci Ne Žádná 3 odepisuje varchar(111) utf8_general_ci Ne Žádná 4 kod varchar(111) utf8_general_ci Ne Žádná 5 prispeno varchar(111) utf8_general_ci Ne Žádná 6 level int(111) Ne Žádná 7 skype varchar(111) utf8_general_ci Ne Žádná no a když už jsem to vše nahrál na web a dal jsem edit a změnil informace, tak jsem dal uložit, ale žádná změna, nic to neudělalo. Už jsem zoufalý, protože hledám celou dobu na internetu a nemůžu nic najít. Prosím pomoc :( |
||
| Davex Profil |
#2 · Zasláno: 1. 1. 2014, 18:02:57
To vypadá na problém s vypnutým
register_globals. Řešení: Nejčastější potíže s PHP (FAQ) » Nefungují proměnné z formuláře nebo z URL (vypnuté register globals).
|
||
|
Časová prodleva: 12 let
|
|||
0