Dzięki doszedłem już do tego jak zrobić to z avatarem.
Zastanawiam się teraz jak zrobić aby po naciśnięciu przycisku zamiast odświeżała się strona odświeżył się tylko opis i obok niego wyskoczył napis Dodano lub coś w tym stylu. Da się to jakoś zrobić?
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: ustaw_o_sobie.php
| Author: eDan
+--------------------------------------------------------+
| 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/licen... 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";
include LOCALE.LOCALESET."edit_profile.php";
include LOCALE.LOCALESET."user_fields.php";
if (!iMEMBER) { redirect("index.php"); }
$user_data = $userdata;
if (isset($_POST['update_profile'])) { require_once INCLUDES."update_o_sobie.php"; }
require_once INCLUDES."bbcode_include.php";
opentable2('O SOBIE');
echo "<form name='inputform' method='post' action='".FUSION_SELF."' enctype='multipart/form-data'>\n";
echo "<input type='hidden' name='user_password' maxlength='20' class='textbox' style='width:200px;' />";
echo "<table cellpadding='0' cellspacing='0' border='0'>";
echo "<tr height='100'>";
echo "<td width='160' valign='top'>";
echo "</td>";
echo "<td valign='top' style='padding: 0px 0px 0px 8px;' width='400'>";
$profile_method = "input";
$result2 = dbquery("SELECT * FROM ".DB_USER_FIELDS." WHERE field_group='6' GROUP BY field_group");
while($data2 = dbarray($result2)) {
$result3 = dbquery("SELECT * FROM ".DB_USER_FIELDS." WHERE field_group='6' ORDER BY field_order");
if (dbrows($result3)) {
if ($data2['field_group'] == 6) {
echo "";
}
while($data3 = dbarray($result3)) {
if (file_exists(LOCALE.LOCALESET."user_fields/".$data3['field_name'].".php")) {
include LOCALE.LOCALESET."user_fields/".$data3['field_name'].".php";
}
if (file_exists(INCLUDES."user_fields/".$data3['field_name']."_include.php")) {
include INCLUDES."user_fields/".$data3['field_name']."_include.php";
}
}
}
}
echo "<center><input type='hidden' name='user_hash' value='".$user_data['user_password']."' />\n";
echo "<input type='submit' name='update_profile' value='".$locale['424']."' class='button' />";
echo "</form>\n";
echo "</center></td>";
echo "</tr>";
echo "</table>";
closetable2();
require_once THEMES."templates/footer.php";
?> Kliknij i zaczekaj na załadowanie kodu ...
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| Filename: update_o_sobie.php
| Author: eDan
+--------------------------------------------------------+
| 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/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
if (!iMEMBER || !isset($_POST['user_hash']) || $_POST['user_hash'] != $user_data['user_password']) { redirect("index.php"); }
$error = ""; $db_values = ""; $set_avatar = "";
$result = dbquery("SELECT * FROM ".DB_USER_FIELDS." WHERE field_group='6' ORDER BY field_order");
if (dbrows($result)) {
$profile_method = "validate_update";
while($data = dbarray($result)) {
if (file_exists(LOCALE.LOCALESET."user_fields/".$data['field_name'].".php")) {
include LOCALE.LOCALESET."user_fields/".$data['field_name'].".php";
}
if (file_exists(INCLUDES."user_fields/".$data['field_name']."_include.php")) {
include INCLUDES."user_fields/".$data['field_name']."_include.php";
}
}
$result = dbquery("UPDATE ".DB_USERS." SET user_name='".$user_data['user_name']."' ".$db_values." WHERE user_id='".$user_data['user_id']."'");
redirect("ustaw_o_sobie.php?update_o_sobie=ok");
} else {
echo "<div style='text-align:center'><strong>".$locale['412']."</strong><br />\n".$error."<br />\n</div>\n";
}
?>
Kliknij i zaczekaj na załadowanie kodu ...
Edytowane przez Szapko dnia 12.07.2009 19:35:17
|