HTML - File Upload By Clicking A Link Instead Of Button
I need an way to upload a file by clicking a link instead of button(<input type="file" name="somename"/>). This feature has been newly added to GMail, to attached a file we need to click a link. Any ideas or code of how this can be done are needed. Thanks Similar TutorialsUsing below script after clicking the button it will reload the page and starting the application I want people go to anchor link location after clicking the submit button, for example go to the bottom of the page because the program is in the bottom of the page how to do that guys please help Code: echo '<form action="" id="frm_chat" method="post"><fieldset id="fieldset_chat"><legend>Chat</legend><div>'; echo $err_msg; echo "<label>Nick: </label>".$txt_nick->getHtml()."<br />"; echo "<label>Server: </label>".$ddl_server->getHtml()." or ".$txt_server->getHtml()."<br />"; echo "<label>Channel: </label>".$ddl_channel->getHtml()." or ".$txt_channel->getHtml()."<br />"; echo ' <input type="submit" class="btn" name="btn_chat" value="Chat Now"/></div></fieldset></form>'; I have a browse button when user selects a file i want to display the files attached in a table with attached filename and date. can anybody tell me how to generate table dynamically. Hi all, how can i upload a file and when i click the submit button i go automatically to other web page. I am using some code that uploads the file perfectly, but i can't get a way to go to other page when i click the submit button. If someone can help me giving me an example of how to do that, or tell me what to change in my code i'll appreciate any kind of help. Here is my code: PHP Code: <?php function error($errorMsg) { ?> <script> alert("<?php echo $errorMsg;?>"); </script> <?php } global $folder; $folder = "uploaded"; if(!is_dir($folder)) if(!mkdir($folder)) { error("Can't, neither, access, nor create, the upload folder"); die(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style> body { background-color:#000000; } </style> <title>Upload</title> </head> <body> <center><h1><font color = "#FFFFFF" > Upload </font></h1></center> <?php function mainPage() { ?> <iframe style="display:none" name="fileUploader"></iframe> <form method="POST" target="fileUploader" enctype="multipart/form-data" action="?action=fileUploader"> <div><input name="file" type="file" STYLE="color:#FFFFFF; size="60"></div> <input type="submit" value="Upload" > </form> <?php } function fileUploader() { global $folder; function storeFile($folder,$tmpFileName,$fileName) { if(!is_uploaded_file($tmpFileName)) { error("Invalid file"); return; } if(!move_uploaded_file($tmpFileName, $folder . "/" . $fileName )) { error("Can't move uploaded file to destination"); return; } } foreach ($_FILES as $file) storeFile("uploaded",$file["tmp_name"],$file["name"]); } $actions = array("fileUploader" => 1,"fileLoader"=> 1); if (!isset($_GET['action'])) { //If not isset -> set with dumy value $_GET['action'] = "undefine"; } $action = $_GET["action"]; if($actions[$action]) $action(); else mainPage(); ?> </body> </html> Is there a way to put a custom graphic for the browse button in the file upload field, similar to how you can use a custom graphic for the submit button? Hi: I have a link that I want to send out to my users on a Page, (this link is about 240 characters long: http://xxxxxxxxxxxxxxxxx, etc, etc) I wish my page to automatically bring up the link on the User's screen. How do I do this please ?? (btw, now I just show a 'clickable' link on the page and the user must 'click' it to activate the link. But, I wish to automate this action please) Thanks ! -Mel Smith Hey guys, Just a quick and hopefully simple question. I'm trying to check the accuracy of my hits and visits system on my website, so I wanted to get a bot which clicks on a link from the same IP every few days, hours, minutes or seconds. Basically I want a bot that clicks on a link at every specified interval, just like a real person would click on a link. However, I obviously don't want the resulting window to come up, I just want the server to think I've clicked. Are there programs that already do this? Hello, I was wondering if there was away to remove a DIV that I have when a link is clicked? Also I have a drop down list and I would also like the div to go away when one of those are selected. Thank you so much in advance, I really appreciate it! hmm is there a way to do this so i have a text link <input type=button onClick="show()" value="hide"> when the user clicks on the button it calls some javascript which shows a div (not relevant!!). is there a way so that you click on the same button again it calls some different javascript e.g. hide() ?? I know about onFocus, onBlur etc but this is not what i need. Hi, I am newbie to HTML , I am trying to move the content in html page up/down on clicking of arrow images. HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Scroll</title> <meta name="Generator" content="EditPlus"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <style type="text/css"> .top{ position: absolute; top:0; right:0; background-image: url('uparrow.png'); background-size: 16px 16px; width: 16px; height: 16px; } .btm{ position: absolute; display:block; background-image: url('downarrow.png'); background-size: 16px 16px; width: 16px; height: 16px; bottom: 0; right: 0; } </style> <script type="text/javascript"> function scrollup(objId){ alert("Scroll UP"); console.log(objId); var a = document.getElementById(objId).style.top; console.log(a); } function scrolldown(objId){ alert("Scroll DOWN"); var b= document.getElementById(objId).style.btm; console.log(objId); console.log(b); } </script> </head> <body> <div id="scrollDiv" style="btm:0px"> This is what i like to say. </div> <div class="top" onclick="scrollup('scrollDiv')"></div> <div class="btm" onclick="scrolldown('scrollDiv')"></div> </body> </html> Can somebody help me in this. Regards, Murali i am dynamically creating a HTML in which i have an <img> tag but when i click on it it is not giving any sound like we normally get. so what could be wrong. any help on this ASAP is very help full i am dynamically creating a HTML in which i have an <img> tag but when i click on it it is not giving any sound like we normally get. so what could be wrong. any help on this ASAP is very help full hiiii alll........ I am creating 2 html pages. when i open first page i want to display a particular form. clicking on link in form 1 we will go to 2nd html page where a image link will appear. when we click on this image link i want to dispaly 1st html page with 2nd form. how to do this please give the html code for this..... Hey everyone, I'm having trouble with this and I have no clue whatsoever how to solve it. My splash page has a css-centered background image which I would like to make it 'look' like a link, v.g. if you click anywhere on the page, the main page loads. I've seen this behavior in some lyrics pages, with a new page opening in a popup when you click anywhere in the screen, but what I need is to make the whole page behave like a giant "A HREF" tag, to load a new page in the same window. Is there anyone out there who can help me with this? Thanks in advance! Hi All, I want to change the form action clicking on radio button. I have two radio button. the default action is a1.jsp if I click on update button If I click on second radio button I want to change the form action. I want to redirect to another file (change form action if possible) if I click on second radio button How can I do that ? Thanks please reply soon. Hi All, I want to change the form action clicking on radio button. I have two radio button. the default action is a1.jsp if I click on update button If I click on second radio button I want to change the form action. I want to redirect to another file (change form action if possible) if I click on second radio button How can I do that ? Thanks please reply soon. Hello, I was able to get the "force repeated refresh" Meta code to work, which is awesome because that's what I needed , however, I am running into a snag. I tried using both JavaScript and just a typical <a href> link, but when you click on either one the Meta Refresh ceases to process. Code is below. I tried plugging the meta http-equiv line into the Body section at various places just for fun, but that doesn't fix the issue. To be honest, the easiest fix here would be to simply load the URL in question immediately when opening Index.html (it's local, stored on my HDD) instead of having a link. Is this possible? I have Googled to find the Html code required to immediately load a URL upon opening an Html file, but can't seem to locate such a command/code. ------------------------------------------------------------------------------------------------------ <html> <head> <meta http-equiv="Refresh" content="1";url=https://mylogins.edc.cingular.net/assignedQueue.cfm?cAsnNext> <script type="text/javascript"> function open_win() { window.location.href = "https://mylogins.edc.cingular.net/assignedQueue.cfm?cAsnNext"; } </script> </head> <body> <a href="https://mylogins.edc.cingular.net/assignedQueue.cfm?cAsnNext" target="_top">https://mylogins.edc.cingular.net/assignedQueue.cfm?cAsnNext</a> <input type=button value="Open Window" onclick="open_win()" /> </body> </html> ------------------------------------------------------------------------------------------------------ My apologies if this belongs in a different forum. I'm creating an order form for a site and I need to add something I've never done before. I want content to be added to the form if the user clicks on a certain radio button. At the bottom of the form there are fields for the subtotal and total of the items that they're inputting at the top of the form. By clicking on a radio button I want to do either of the following. 1) A new table cell appears with text and an input field that has a number already in it. 2) The above cell and content are already on the page, and the clicking of the radio button only adds the info into the empty input. The first option I assume is a little more complicated and probably deals with CSS and/or Javascript. Option 1 is preferred but if I can only do number 2 then I'll deal. Just a note, I'm not doing any actual number calculations with this form. It's just raw numbers so there's no need to take that into consideration. Any and all help will be greatly appreciated. Hi, I'm working on a simple website in which I'm required to use two types of forms input on a webpage. I have decided to make a simple quiz which will be designed as follows; -------------------------------------------------------- Q1: The largest mammal on land is: (radio button choices) Q2: Please tick the two correct answers: (tick boxes, four available... only two correct) ---------------------------------------------------------- (BUTTON: Please click here for the answers) ... answers should appear once the above button is pressed... Answers: Q1: B Q2: A * C Is this possible in HTML? Sounds quite straight-forward but I'm no expert so forgive me.. Ps: Is it possible to design a radio button which, depending on the choice, the related-text will appear underneath on the same page? So if they select 'A' then paragraph 'A' will show, if they select 'C' then paragraph 'C' will appear (with the rest hiding)... Thanks! The following common code is not working in Firefox (3.0.11). It works in Safari (4.02) and IE7. When I say not working, I mean that when I click the submit button, the address does not change to the form processing url: Code: <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="mp3file" type="file" /> <input type="submit" name="submit" value="Send File" /> </form> The file uploader.php does nothing, it is blank, I'm merely trying to establish communication. Once again, the code functions in IE and Safari so I dont think this is PHP related. Hi im not sure if this can be done i have created some buttons to use as links and once i put the a href code in a box appears around the button can i remove this and how plz you can see example of what i mean on my website i have made Home and Contact clickable but i want to remove the box thats around the button if possible http://dreamteam0708.co.uk/ for info: im coding my own html in notepad, not using any programs or anything and my hosting doesnt support php etc |