הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 23-11-06, 15:50   # 1
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

בעיה בקוד למומחים !

זה דף שממנו עורכים משתמשים מהניהול של המערכת שאני בונה , בדף ניהול בוחרים את המשתמש ולוחצים על submit מהפקודה <form> .
שזה שולח לדף של העריכה של המשתמש שבחרתי זה מראה לי :
Database INSERT Error
זה לא בעיה בדף שאני בוחר משתמש כי בדף שאני בוחר משתמש יש אפשרות שמוחקת משתמש והיא עובדת על אותו עיקרון ..
מה הבעיה בקוד ?

PHP קוד:
<?
  session_start
();

  include 
"../affconfig.php";
  include 
"../lang/$language";

  if(!
aff_admin_check_security())
  {
    
aff_redirect('index.php');
    exit;
  }
        
      
  
mysql_connect($server$db_user$db_pass) or die ("Database CONNECT Error (line 18)"); 
  
$errorMsg '';
  
  if(
$_POST['commited'] == 'yes')
  {
    
// check
    
if($_POST['password'] == '')
      
$errorMsg .= AFF_SI_PWDMISSING.'<br>';
      
    if(
$_POST['clientemail'] == '')
      
$errorMsg .= AFF_SI_EMAILMISSING.'<br>';
      
    if(
$errorMsg == '')
    {
      
mysql_db_query($database"UPDATE affiliates SET pass = '".$_POST['password']."', company = '".$_POST['clientcompany']."', payableto = '".$_POST['clientpayableto']."', title = '".$_POST['clienttitle']."', firstname = '".$_POST['clientfirstname']."', lastname = '".$_POST['clientlastname']."', email = '".$_POST['clientemail']."', street = '".$_POST['clientstreet']."', town = '".$_POST['clienttown']."', county = '".$_POST['clientcounty']."', country = '".$_POST['clientcountry']."', postcode = '".$_POST['clientpostcode']."', website = '".$_POST['webpage']."', phone = '".$_POST['clientphone']."', fax = '".$_POST['clientfax']."' WHERE refid = '".$_POST['edit']."'"
        or die (
"Database INSERT Error (line 7)");
      echo 
"<p align=center><font color=#009900>".AFF_D_CHANGED."</font></p>";
    }
  }
  
  
$result mysql_db_query($database"select * from affiliates where refid = '".$_REQUEST['edit']."' ORDER BY id DESC") or die ("Database INSERT Error (line 19)"); 

  if(
$errorMsg != '')
     echo 
"<p align=center><font color=#ff0000>$errorMsg</font></p>";

  if (
mysql_num_rows($result)) 
  {
    while (
$qry mysql_fetch_array($result)) 
    {
      print 
"<form action=adetails.php method=post ENCTYPE=multipart/form-data>
        <p><font face=verdana><small> </small></font><font face=verdana><small></small></font></p>
        <font face=verdana><small>
        <div align=center> 
          <p> 
          <table border=0>
            <tr> 
              <td width=170>Affiliate ID: </td>
              <td width=152>"
.$_SESSION['aff_valid_user']."</td>
            </tr>
            <tr> 
              <td>Password: </td>
              <td> 
                <input type=password name=password value=\"$qry[pass]\">
              </td>
            </tr>
            <tr> 
              <td>Company: </td>
              <td> 
                <input type=text name=clientcompany value=\"$qry[company]\">
              </td>
            </tr>
            <tr> 
              <td>Title: </td>
              <td> 
                <select name=clienttitle>
                  <option value=Mr>Mr</option>
                  <option value=Mrs>Mrs</option>
                  <option value=Miss>Miss</option>
                  <option value=Ms>Ms</option>
                  <option value=Dr>Dr</option>
                </select>
              </td>
            </tr>
            <tr> 
              <td>First Name: </td>
              <td> 
                <input type=text name=clientfirstname value=\"$qry[firstname]\">
              </td>
            </tr>
            <tr> 
              <td>Last Name: </td>
              <td> 
                <input type=text name=clientlastname value=\"$qry[lastname]\">
              </td>
            </tr>
            <tr> 
              <td>Email: </td>
              <td> 
                <input type=text name=clientemail value=\"$qry[email]\">
              </td>
            </tr>
            <tr> 
              <td>Street: </td>
              <td> 
                <input type=text name=clientstreet value=\"$qry[street]\">
              </td>
            </tr>
            <tr> 
              <td>Town: </td>
              <td> 
                <input type=text name=clienttown value=\"$qry[town]\">
              </td>
            </tr>
            <tr> 
              <td>County/State: </td>
              <td> 
                <input type=text name=clientcounty value=\"$qry[county]\">
              </td>
            </tr>
            <tr> 
              <td>Country: </td>
              <td> 
                <select name=clientcountry class=dropdown value=\"$qry[country]\">
                  <option value=AF>Afghanistan 
                  <option value=AL>Albania 
                </select>
              </td>
            </tr>
            <tr> 
              <td>Postcode/Zip: </td>
              <td> 
                <input type=text name=clientpostcode value=\"$qry[postcode]\">
              </td>
            </tr>
            <tr> 
              <td>Web Site Address: </td>
              <td> 
                <input type=text name=webpage value=\"$qry[website]\">
              </td>
            </tr>
            <tr> 
              <td>Phone Number: </td>
              <td> 
                <input type=text name=clientphone value=\"$qry[phone]\">
              </td>
            </tr>
            <tr> 
              <td>Fax Number: </td>
              <td> 
                <input type=text name=clientfax value=\"$qry[fax]\">
              </td>
            </tr>
            <tr> 
              <td height=37 colspan=2 valign=top> 
                <center>
                  <input type=hidden name=commited value=yes>
                  <input type=submit name=Submit>
                </center>
              </td>
            </tr>
          </table>
          <p></p>
        </div>
        </small></font> 
      </form>
    
      </p>"
;
    }
  }
  
?>
הבעיה כאן :
PHP קוד:
      mysql_db_query($database"UPDATE affiliates SET pass = '".$_POST['password']."', company = '".$_POST['clientcompany']."', payableto = '".$_POST['clientpayableto']."', title = '".$_POST['clienttitle']."', firstname = '".$_POST['clientfirstname']."', lastname = '".$_POST['clientlastname']."', email = '".$_POST['clientemail']."', street = '".$_POST['clientstreet']."', town = '".$_POST['clienttown']."', county = '".$_POST['clientcounty']."', country = '".$_POST['clientcountry']."', postcode = '".$_POST['clientpostcode']."', website = '".$_POST['webpage']."', phone = '".$_POST['clientphone']."', fax = '".$_POST['clientfax']."' WHERE refid = '".$_POST['edit']."'"
        or die (
"Database INSERT Error (line 7)"); 

Last edited by forils; 23-11-06 at 15:52..
  Reply With Quote
ישן 23-11-06, 17:40   # 2
RS324
תודה על תרומתך.
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 3,173

RS324 לא מחובר  

ברור שמשהו פה לא בסדר.. למה אתה צריך לעשות INSERT אם אתה בעצם עורך משתמש ?
  Reply With Quote
ישן 23-11-06, 21:50   # 3
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

אין INSET בקוד!
זה UPDATE
  Reply With Quote
ישן 23-11-06, 22:41   # 4
Tomer
Whatever
 
Tomer's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 7,039
שלח הודעה באמצעות MSN אל Tomer Send a message via Skype™ to Tomer

Tomer לא מחובר  

תגיד, אתה בטוח שהקוד שלך ? כי לפי השאלות האחרות שלך אתה לא בדיוק יודע PHP.
__________________
תומר
  Reply With Quote
ישן 23-11-06, 22:51   # 5
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

חלק שלי ואני עכשיו לומד בידיוק PHP ?
  Reply With Quote
ישן 23-11-06, 23:07   # 6
Tomer
Whatever
 
Tomer's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 7,039
שלח הודעה באמצעות MSN אל Tomer Send a message via Skype™ to Tomer

Tomer לא מחובר  

"חלק"? אתה מתכוון שורה אחת של include? כי כל הקוד שם 100% לא שלך.
__________________
תומר
  Reply With Quote
ישן 24-11-06, 12:52   # 7
HBK
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Aug 2006
הודעות: 343

HBK לא מחובר  

ציטוט:
נכתב במקור על ידי forils צפה בהודעה
חלק שלי ואני עכשיו לומד בידיוק PHP ?
מה שמתחיל ללמוד PHP לא יודע כבר sessinon
  Reply With Quote
ישן 24-11-06, 17:00   # 8
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

חבר שלי עזר לי בזה, בחוץ מי זה יש שם מלא שלי !
  Reply With Quote
ישן 24-11-06, 17:02   # 9
-VladK-
הוסטסניון
 
-VladK-'s Avatar
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
גיל: 34
הודעות: 2,182

-VladK- לא מחובר  

למה אתם רבים? .... ולמה שלא תביא את השגיאה שמופיעה לך כדי שנוכל לעזור?
  Reply With Quote
ישן 24-11-06, 17:19   # 10
forils
Permanently Banned
 
מיני פרופיל
תאריך הצטרפות: Apr 2006
הודעות: 368

forils לא מחובר  

הבאתי
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


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

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