Click to See Complete Forum and Search --> : simple question: keeping the address


beginnerz
01-04-2006, 09:27 PM
<form name='form' method='post' action='<?php echo $_SERVER['PHP_SELF']; ?>' enctype="multipart/form-data">
<?
if(isset($_POST['submit'])){
echo "yes";
}else{
echo "no";
}
?>

<input type="file" name="txtPhotograph" size="6"
value="<?php echo $photo; ?>">
<input type = "submit" name="submit" value="submit"></form>

for this simple php, when i click submit, the address in the text field will disappear . is there a way to keep the address even i click submit?

NogDog
01-04-2006, 09:58 PM
value="<?php echo (isset($_POST['txtPhotograph'])) ? $_POST['txtPhotograph'] : ""; ?>">

beginnerz
01-04-2006, 10:02 PM
doesnt seems to work. it still will disappear. if that is a type="text" then no problem but when it is a type="file" it seems like it cant echo the value $_POST

NogDog
01-04-2006, 10:10 PM
Hmmm... the HTML 4.01 spec says, "User agents may use the value of the value attribute as the initial file name," (my emphasis). So I guess it might work in some browsers and not in others.

ShrineDesigns
01-05-2006, 02:33 AM
try using $_FILES['txtPhotograph']['name']

beginnerz
01-05-2006, 02:41 AM
hmm....its still the same, that's meaning i cant create one submit button to view the photos without poping up in new window and still keep the address, unless create type="" value="view photos" then onclick pop up in new window just to view the picture.

but anyway thanks a lot.