Есть такой код:
PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- elseif ($action == 'saveeditnew') {
- $id = (int)$_GET['id'];
- if (!$subject){
- bark("You did not enter a title, please <a href=\"javascript:history.go(-1);\">go back</a>...");
- }
- if (!$text){
- bark("You have not entered (the message), please <a href=\"javascript:history.go(-1);\">go back</a>...");
- }
- bark("The title should be prepared with 3 characters or more, please <a href=\"javascript:history.go(-1);\">go back</a>...");
- }
- bark("The text (message) must be drawn up with 50 characters or more, please <a href=\"javascript:history.go(-1);\">go back</a>...");
- }
- bark("The title has a lot of characters, the maximum allowed 150 characters, please <a href=\"javascript:history.go(-1);\">go back</a>...");
- }
- bark("The text (message) has so many characters, the maximum allowed 5000 characters, please <a href=\"javascript:history.go(-1);\">go back</a>...");
- }
- $updateset[] = "subject = " . sqlesc($subject);
- $updateset[] = "body = " . sqlesc($text);
- $result = sql_query("UPDATE news SET " . implode(",", $updateset) . " WHERE id = " . $id) or sqlerr(__FILE__,__LINE__);
- if ($result){
- stdhead("The process of saving the edited data"); begin_frame("The process of saving the edited data"); stdmsg("Successfully","Your news has been successfully added, now you will be redirected to the page with your news... <META HTTP-EQUIV='refresh' CONTENT='2; url=?action=details&id=".$id."'>"); end_frame(); stdfoot();
- }else{
- stdhead("The process of saving the edited data"); begin_frame("The process of saving the edited data"); stdmsg("Error", "An unknown error occurred...", "error"); end_frame(); stdfoot();
- }
- }