joebudden Posted December 8, 2006 Share Posted December 8, 2006 I have made a list of hyperlinks referring to files in a database. As well as displaying links to the files I also want to give the user the option to delete a file so i added a delete hyperlink to each row. foreach ($resultArray as $row) { $href = $_SERVER['PHP_SELF'] . "?frmFile=" . $row['dbArtefactId']; echo(" <em>(" . $row['dbArtefactId'] . ")</em> "); echo("<a href='" . $href . "' >"); echo(" <em>(" . $row['dbArtefactFileName'] . ")</em></a>"); echo(" <em>(" . $row['dbArtefactFileType'] . ")</em>"); echo(" <em>(" . $row['dbArtefactFileSize'] . ")</em>"); echo(" <em><a href='deleteFile.php'>Delete</a></em><br />"); }When the user clicks delete i want the file ID to be displayed within a txt field on a form....................The code below displays a form which collects the employee thats logged in's ID number..<?php echo("<input type='text' name='frmEmployeeId' maxlength='4' "); if (isset($_SESSION['sessEmployee'] ['id'])) { echo("value='" . $_SESSION['sessEmployee'] ['id'] . "'"); } echo(" />"); echo($invalidOwnerNameMessage); ?> Would it be a similar piece of code to display the dbArtefactFileId within a text field on another formIf anyone has ANY help or advice that wud be greatly appreciated!!!!1TAR Link to comment https://forums.phpfreaks.com/topic/29933-getting-a-value-into-a-html-form/ Share on other sites More sharing options...
Psycho Posted December 8, 2006 Share Posted December 8, 2006 Yes. As long as you are passing a value to a page it is very simple to populate a field with the value. Just something like this:[code]<?php$dbArtefactFileId = ($_POST['dbArtefactFileId'])?$_POST['dbArtefactFileId']?:"";echo "<input type=\"text\" name=\"'dbArtefactFileId\" value=\"$dbArtefactFileId\">";?>[/code] Link to comment https://forums.phpfreaks.com/topic/29933-getting-a-value-into-a-html-form/#findComment-137534 Share on other sites More sharing options...
joebudden Posted December 8, 2006 Author Share Posted December 8, 2006 erm not quite sure what u mean ???can i send u my source files??? Link to comment https://forums.phpfreaks.com/topic/29933-getting-a-value-into-a-html-form/#findComment-137538 Share on other sites More sharing options...
papaface Posted December 8, 2006 Share Posted December 8, 2006 Do you have msn? If so add me papa_face (At) hotmail.com Link to comment https://forums.phpfreaks.com/topic/29933-getting-a-value-into-a-html-form/#findComment-137546 Share on other sites More sharing options...
joebudden Posted December 8, 2006 Author Share Posted December 8, 2006 im using e messenger so can u add me [email protected] Link to comment https://forums.phpfreaks.com/topic/29933-getting-a-value-into-a-html-form/#findComment-137550 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.