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

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

opsite 14-09-06 15:32

[php] צריך עזרה בעדכון update כנסו בבקשה :)
 
אוקיי יצרתי דף לעדכון הודעהה מסויימת סתכלו כאן:

http://www.zahi.esg-serv.net/ex/content/view.php

תעשו עריכה תשנו לסתם מה שבא לך ותראו זה לא משנה כלום :(

מה יכול להיות הבעיה הלכתי לפי המדריך שנתנו פה בהוסטס לעדכון ...

הנה הקודים ל 2 הדפים שעשיתי

edit.php
PHP קוד:

<html dir="rtl">

<?php 
include("db.php"); 
    
$id    =    $_GET['id']; 
    function 
edit($id
    { 
        
$query    =    mysql_query("SELECT * FROM `text` WHERE `id`='$id'"); 
        
$result    =    mysql_fetch_array($query); 
        
$id    =    $result['id']; 
        
$img    =    $result['img']; 
        
$title    =    $result['title']; 
        
$content    =    $result['content']; 
        echo 

        <form action=\"update.php\" method=\"post\"> 
        <p align='right'> 
        תמונה : 
        <input type=\"text\" name=\"img\" value=\"$img\" size='23'><br>
        כותרת : 
        <input type=\"text\" name=\"title\" value=\"$title\" size='23'><br>
        מספר אידי : 
        <input type=\'hidden\' name=\'id\' value=$id size='23'><br>
        תוכן ההודעה : 
        <textarea name=\'content\' rows='8' cols='31'>$content</textarea> 
        </p>
        <br><input type=\"submit\" value=\"עדכן\"><br></form>"


        
edit($id); 
?>
<p align="right">&nbsp;</p>

ו update.php
PHP קוד:

<?
require "db.php";     

$id1 $_POST['id'];
$img1 $_POST['img'];
$title1 $_POST['title'];
$content1 $_POST['contnet'];

    
    
$resultID mysql_query("UPDATE text SET id = '$id1', img = '$img1', title = '$title1', content = '$content1' WHERE id = '$id'") or die(mysql_error());
    if (
$resultID == TRUE)
        print 
"נערך בהצלחה!";

?>
<script language="JavaScript">window.location=("view.php");</script>

מה יכולה להיות הבעיה?

תודה רבה לכולם :)

Elad-A 14-09-06 15:53

תנסה אולי ככה:

PHP קוד:


<html dir="rtl"> 

<?php  
include("db.php");  
    
$id    =    $_GET['id'];  
    function 
edit($id)  
    {  
        
$query    =    mysql_query("SELECT * FROM `text` WHERE `id`='$id'");  
        
$result    =    mysql_fetch_array($query);  
        
$id    =    $result['id'];  
        
$img    =    $result['img'];  
        
$title    =    $result['title'];  
        
$content    =    $result['content'];  
        echo 
"  
        <form action='update.php' method='post'>  
        <p align='right'>  
        תמונה :  
        <input type='text' name='img' value='$img' size='23'><br> 
        כותרת :  
        <input type='text' name='title' value='$title' size='23'><br> 
        מספר אידי :  
        <input type='hidden' name='id' value=$id size='23'><br> 
        תוכן ההודעה :  
        <textarea name='content' rows='8' cols='31'>$content</textarea>  
        </p> 
        <br><input type='submit' value='עדכן'><br></form>"
;  
}  
        
edit($id);  
?> 
<p align="right">&nbsp;</p>


update.php

PHP קוד:


<? 
require "db.php";      

$id1 $_POST['id']; 
$img1 $_POST['img']; 
$title1 $_POST['title']; 
$content1 $_POST['contnet']; 
    
$resultID mysql_query("UPDATE text SET id = '$id1', img = '$img1', title = '$title1', content = '$content1' WHERE id = '$id'") or die(mysql_error()); 
    if (
$resultID == TRUE
{
        print 
"נערך בהצלחה!"
echo 
" <script language=\"JavaScript\">window.location=(\"view.php\");</script> ";
}

?>


opsite 14-09-06 17:29

ואייייייייי אחי אתה גדול מהחייםם אשמח לדעת מה הית הבעיה... תודה רבה רבה :)

Elad-A 14-09-06 18:13

בגלל הסלאשים.

opsite 14-09-06 18:19

אוקיי תודה אחי!!!


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

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