ziedinjsh Posted February 1, 2011 Report Share Posted February 1, 2011 upload.php <?php session_start(); $destination_path = "../avatars/"; $result = 0; $user_photo = $destination_path . basename( $_FILES['avatar']['name']); $avatar = "UPDATE users SET user_photo='$user_photo' WHERE user_email='".$_SESSION['user_email']."'"; if(@move_uploaded_file($_FILES['avatar']['tmp_name'], $user_photo)) { $result = 1; } sleep(1); ?> <script language="javascript" type="text/javascript">window.top.window.stopUpload(<?php echo $result; ?>);</script> Bildi folderā augšupielādē, bet iekš mysql neieliek bildes nosaukumu! Kas par vainu!? Link to comment Share on other sites More sharing options...
briedis Posted February 1, 2011 Report Share Posted February 1, 2011 *facepalm* Kur tiek izpildīts kvērijs? Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 1, 2011 Author Report Share Posted February 1, 2011 tā.. jā, nav, bet kā uztaisīt.. es nevaru izdomāt Link to comment Share on other sites More sharing options...
chizijs Posted February 1, 2011 Report Share Posted February 1, 2011 (edited) mysql_query(..); ? Edited February 1, 2011 by chizijs Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 1, 2011 Author Report Share Posted February 1, 2011 labi. tagad peivieno datubāzei, bet tagad vairs neuploado bildi! kapēc tā!?\ <?php session_start(); include ("dbase.php"); $destination_path = "../avatars/"; $result = 0; $user_photo = $destination_path . basename( $_FILES['avatar']['name']); $user_photo = ($_FILES['avatar']['name']); $mysql = mysql_query("UPDATE users SET user_photo='$user_photo' WHERE user_email='".$_SESSION['user_email']."'"); if(@move_uploaded_file($_FILES['avatar']['tmp_name'], $photo)) { $result = 1; } sleep(1); ?> <script language="javascript" type="text/javascript">window.top.window.stopUpload(<?php echo $result; ?>);</script> Link to comment Share on other sites More sharing options...
nemakuphp Posted February 1, 2011 Report Share Posted February 1, 2011 tev $photo nav definēts Link to comment Share on other sites More sharing options...
briedis Posted February 1, 2011 Report Share Posted February 1, 2011 Reāli nav jēgas palīdzēt šitam keksam. Diezgan bezcerīgs gadījums. Link to comment Share on other sites More sharing options...
Kemito Posted February 1, 2011 Report Share Posted February 1, 2011 briedi, tik traki ir ? nu ja tu iedod definētu mainīgo ar kveriju, tad to vaig izpildīt! t.i - mysql_query($mainigais) or die(mysql_error()) Šitas strādā - "STABILI UN DROŠI!" Link to comment Share on other sites More sharing options...
daGrevis Posted February 1, 2011 Report Share Posted February 1, 2011 briedi, tik traki ir ? nu ja tu iedod definētu mainīgo ar kveriju, tad to vaig izpildīt! t.i - mysql_query($mainigais) or die(mysql_error()) Šitas strādā - "STABILI UN DROŠI!" http://php.lv/f/user/3549-ziedinjsh/page__tab__topics Link to comment Share on other sites More sharing options...
Recommended Posts