Current location: Hot Scripts Forums » Programming Languages » PHP » php edit image


php edit image

Reply
  #1 (permalink)  
Old 09-09-09, 05:49 AM
hemi hemi is offline
Wannabe Coder
 
Join Date: Aug 2009
Posts: 117
Thanks: 15
Thanked 0 Times in 0 Posts
php edit image

my problem is the following code is not editing my image
-------------------------------------------------------------------------------------------------
PHP Code:

if($_REQUEST['id'])

{    
if(
$file=="")
{
$vars='uploads/';

$file=$vars.basename($_FILES['images']['name']);
move_uploaded_file($_FILES['images']['tmp_name'],$file);
}
$result=mysql_query("select * from category where id=$_REQUEST[id]");
if(
$result)
if(
mysql_num_rows($result))
extract(mysql_fetch_assoc($result),EXTR_PREFIX_ALL,'msg');
if(
$images=="")
{
        
$file=$msg_images;
}    
$vars='uploads/';
$result=mysql_query("select * from category where id='$_REQUEST[id]'");
if(
$result)
if(
mysql_num_rows($result))
    
$var=mysql_fetch_array($result);
        if(isset(
$_POST['submit']))
        {
            
$title=$_POST['title'];
            
$rupees=$_POST['rupees'];
            
$location=$_POST['location'];
            
            
$description=$_POST['description'];
            
$email=$_POST['email'];
//echo"update category set title='$title',rupees='$rupees',images='$file',location='$location',email='$email',description='$description' where id={$_REQUEST['id']}"; 
$result=mysql_query("update category set title='$title',rupees='$rupees',location='$location',email='$email',description='$description' where id={$_REQUEST['id']}");        
if(
$result)
{
    
    
//echo"SELECT id FROM category where email='$email'& title='$title'& rupees='$rupees' & location='$location' & desrciption='$description'";
    
$res=mysql_query("SELECT id FROM category where id=$_REQUEST[id]");
    
$var=mysql_fetch_array($res);
header("Location:sale2.php?id=$var[id]");
  
}
else
{
    echo 
"problem";
}

}

}
$resu=mysql_query("select * from category where id='$_REQUEST[id]'");
if(
$resu)
if(
mysql_num_rows($resu))

    
$v=mysql_fetch_array($resu);
    
$titl=$v['title'];
            
            
$locatio=$v['location'];
            
$rupe=$v['rupees'];
            
$descriptio=$v['description'];
            
$emai=$v['email'];
            
$hob=$v['hobbies'];
$img=$v['images'];
$imgg=$v['image'];
show_form($titl,$locatio,$descriptio,$rupe,$emai,$img,$imgg);
function 
show_form($titl,$locatio,$descriptio,$rupe,$emai,$img,$imgg)
{



echo
"
 
<form method='POST' action='editsale.php' name='form1' enctype='multipart/form-data'  >

 
 
 
  <tr> <td> <table align=center border=1 bgcolor=F7F5F4 height=200 width=100%>
  
 
  
  
<tr><td> Posting Title   
<input type='text' name=title value='
$titl' size='30' maxlength='70'>

PRICE (INR)  
 <input type='text' name='rupees' value='
$rupe' size='10' maxlength='70'>
 
Specific Location    
 <input type='text' name='location' value='
$locatio' size='30' maxlength='70'></td></tr>
 
 <div class='row'>
 <br>
<tr><td>        <div><span class='req'>Reply to: </span></div>
              
<div>
        <input style='color: rgb(170, 170, 170);' tabindex='1' class='req df' id='FromEMail' name='email' size='30' value='
$emai' maxlength='60' type='text'>
        
    <br>
                
<br>    </div>
            
    </div>

        <br clear='all'>
 
 </td></tr>
  

<tr><td> Post description <br> 
  <textarea  name='description' cols=140 rows=10  value='
$descriptio'>$descriptio</textarea></td></tr>

<input type ='hidden'name='id' value='
$_REQUEST[id]'>
<tr><td>    <input type='submit' name='submit' value='update' ></td></tr></table>"
;


<
tr><td>upload: <input type='file' name='images' value=''>






   <
img src='$img' width=70 height=70></td></tr>
  
  <
tr><td>upload: <input type='file' name='image' value='$var[image]' >






   <
img src='$imgg' width=70 height=70></td></tr>

/*

actually there will be a image, i inserted into datebase
now when i say edit a new image it is not doing it plase hlp me

Last edited by wirehopper; 09-09-09 at 07:37 AM. Reason: PHP tags
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
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 On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP or PHP which is better? nepala The Lounge 9 07-14-10 06:48 AM
Pull full size image using PHP conundrum8 Script Requests 3 01-23-09 10:35 PM
PHP POST? {} Image Template Help jadedbat PHP 3 08-06-06 03:49 PM
Output A Text Page As Image, Via PHP... w2n Script Requests 11 01-05-06 12:53 PM
PHP with a 'JavaScript-ish' Image Display Cypris PHP 1 07-03-04 04:05 AM


All times are GMT -5. The time now is 11:56 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.