franknu Posted April 16, 2007 Share Posted April 16, 2007 What is the best way to do this. I am not getting any display here... echo"<input name=\"Picture1\" type=\"file\" value=\"".$row['Picture1']."\" >"; it is Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/ Share on other sites More sharing options...
boo_lolly Posted April 16, 2007 Share Posted April 16, 2007 well, your type is 'file'. your code is fine. Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230429 Share on other sites More sharing options...
franknu Posted April 16, 2007 Author Share Posted April 16, 2007 well how do i show values in the field them because if i dont, it will delete the values when i update the code Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230441 Share on other sites More sharing options...
boo_lolly Posted April 16, 2007 Share Posted April 16, 2007 you have to add a string AFTER your input tag. Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230446 Share on other sites More sharing options...
franknu Posted April 16, 2007 Author Share Posted April 16, 2007 can u get me an examples Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230455 Share on other sites More sharing options...
boo_lolly Posted April 16, 2007 Share Posted April 16, 2007 echo"<input name=\"Picture1\" type=\"file\" value=\"{$row['Picture1']}"\">{$row['Picture1']}\n"; Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230470 Share on other sites More sharing options...
per1os Posted April 16, 2007 Share Posted April 16, 2007 You want the picture to display in the input box? That is kind of absurd. This is what you would need to do: <?php echo '<input name="Picture1" type="file" value="" /><img src="' . $row['Picture1'] . '" />'; ?> That way the image will display next to the box. It is impossible to get it to display as the value. Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230474 Share on other sites More sharing options...
franknu Posted April 16, 2007 Author Share Posted April 16, 2007 my problem is that i want people to update the pictures and if the values doent show it meant that they will have to uodate pictures every time that they make changes to the pages here is my code IF ($moved1=true and $moved2=true and $moved3=true and $moved4=true and $moved5=true and $moved6=true) : $query="UPDATE business_info SET BusinessName= ('$_POST[businessName]'), `Slogan`=('$_POST[slogan]'), Business_Address = ('$_POST[business_Address]'), Tel=('$_POST[Tel]'), Website= ('$_POST[Website]'), Email = ('$_POST[Email]'), Fax= ('$_POST[Fax]'), `type`='$type', make = '$make', Categories = ('$_POST[Categories]'), Keyword = ('$_POST[Keyword]'), `Picture1` = '$fullpath1', Headline = ('$_POST[Headline]'), Slogan2 = ('$_POST[slogan2]'), Description1 = ('$_POST[Description1]'), Description2 = ('$_POST[Description2]'), Description3 = ('$_POST[Description3]'), `Picture2` = '$fullpath2', `Picture3` = '$fullpath3', `Picture4` = '$fullpath4', `Picture5` = '$fullpath5', `Picture6` = '$fullpath6', `Password`= '$Password' WHERE User_Name = '$User_Name'"; $result = mysql_query($query) or die ("Problem with the query: <pre>$query</pre><br>" . mysql_error()); ENDIF; ENDIF; Link to comment https://forums.phpfreaks.com/topic/47249-how-to-set-up-file-value/#findComment-230547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.