Help - Search - Members - Calendar
Full Version: I want to use the php_uploads folder
HTMLHelp Forums > Programming > Client-side Scripting
Adamharo
So I decided I wanted to let people upload to my site and its just been a mess. this it my code for the page. any ideas? im new to all this BTW.


</head>

<body>
<!-- start wrapper -->
<div id="wrapper">
<!-- start banner -->
<div id="banner">www.BBD.com</div>
<div id="leftcol"> <!-- start nav -->
<div id="nav">
<ul>
<li><a href="index.html">home</a></li
>
<li><a href="projects.html">projects</a></li
>

<li><a href="info.html">info</a></li
>
<li><a href="upload.html" class="youarehere">upload</a></li
>
</ul>
<!-- end nav -->
</div>
<!-- left col -->
</div>

<!-- start content -->
<div id="content">
<!-- Begin the top content container class div -->

<div class="container">

<h2>Upload Necessary Files Here</h2>
<form method="post" enctype="multipart/form-data" onSubmit="callMe()" name="myForm">

<input type="hidden" name="pageid" value="445789">

<script LANGUAGE="JavaScript">
<!-- Begin
function fileCheck()
{
if
(document.myForm.yourFile.value == '')
document.myForm.uploadFile.value = 0;
else
document.myForm.uploadFile.value = 1;
}
// End -->
</script>

<input type="hidden" name="uploadFile" value="0">


<table>

<tr>
<td><font face="verdana,helvetica" size=1>Browse for File</font></td>
<td><input type="file" name="yourFile" size="30" maxlength="255"></td>
</tr>

<tr>
<td><font face="verdana,helvetica" size=1>Your Name</font></td>
<td><input type="text" name="yourName" size="30" maxlength="50"></td>
</tr>

<tr>
<td><font face="verdana,helvetica" size=1>File info</font></td>
<td><input type="text" name="yourFileInfo" size="40" maxlength="200"></td>
</tr>

<tr>
<td>&nbsp;</td>
<td><input name="mySubmit" type="Submit" class="youarehere" value="Upload"></td>
</tr>

<script>
function callMe()
{
fileCheck();
document.myForm.mySubmit.value = "Please Wait...";
document.myForm.mySubmit.disabled = true;
}
</script>


</table>

</form>
<p><!-- End the top content container div -->
</p>
</div>
<!-- end content -->
</div>
<div id="footer">
<p>graphic design &amp; image consulting</p>
</div>
<!-- end wrapper -->
</div>
</body>
</html>


pandy
You can't do file upload with JS. You need a script on the server.
http://htmlhelp.com/faq/html/forms.html#form-howto
Darin McGrew
Please see the FAQ entry How can I allow file uploads to my web site?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.