הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   [PHP] מה הבעיה בקוד הבא ? (https://hosts.co.il/forums/showthread.php?t=44351)

חיים 26-04-07 22:35

אתה בטוח ששינית במסד עצמו את השדה update ל-updote?

Gold-System 26-04-07 22:41

1000%!
Updote לא updote

BlueNosE 26-04-07 22:44

PHP קוד:

<?
error_reporting 
(E_ALL);
include 
"config.php"
if ( !isset(
$_POST['messege']) ) {
$query mysql_query("SELECT * FROM msg LIMIT 0,1"); 
$con mysql_fetch_array($query);
$msg $con['Updote'];
echo 
"
<html> 
<head>
<form action='messege.php' method='POST'> 
<div align='center'> 
<textarea name='messege'>$msg</textarea> 
<input type='hidden' value='1' name='xds' />
<input type='submit' value='עדכן תיבה'>
</form> 
</html>
"
;
}

else {
$update $_POST['messege'];
mysql_query("UPDATE msg SET Updote = '{$update}'");
}
?>


Gold-System 26-04-07 22:47

קבל מה הבעיה, בלונוס -
http://goldsystem.co.il/Panel/messege.php

Eran-s 26-04-07 22:50

בקובץ CONFIG עשית DEFINE?

Gold-System 26-04-07 22:53

PHP קוד:

<?Php 
      mysql_connect
('localhost',ftft_msg,'******'); 
      
mysql_select_db("ftft_msg"); 
?>


Eran-s 26-04-07 23:17

לא שמת את שם המשתמש במרכאות

Gold-System 26-04-07 23:19

אוקיי, תיקנתי,
עדיין - לא שומר את הנתונים בתיבה.

Eran-s 26-04-07 23:30

תשים or die(mysql_error()) לשאילתת עדכון

Tomer 26-04-07 23:31

מתחיל להמאס לי,

PHP קוד:

<?php
ob_start
();
require_once(
"config.php");

if (!
$_POST) {

  
$sql mysql_query("SELECT `Updote` FROM `msg`") or die(mysql_error());
  
$r mysql_fetch_array($sql);
  
$msg $r['Updote'];

  echo <<<HTML
    <html> 
    <head>
    <form action='message.php' method='POST'> 
    <div align='center'> 
    <textarea name='messege'>
{$msg}</textarea> 
    <input type='submit' value='עדכן תיבה'>
    </form> 
    </html>
  HTML;
  
} else {

  $message = mysql_escape_string($_POST
['message']);
  
  $sql = mysql_query("UPDATE `msg` SET `Updote`='$message'") or die(mysql_error());
header("Location: message.php");

}
?>

תנסה את זה, רשמתי את זה עכשיו.


כל הזמנים הם GMT +2. הזמן כעת הוא 02:18.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ