Greenguy's Board


Go Back   Greenguy's Board > Newbie Questions
Register FAQ Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2007-01-28, 05:19 PM   #1
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
Generally, I would do something like

Code:
<?php
    if (!(file_exists($_FILES['uploadedfile']['tmp_name']))) {
      $error .= "Please try again, I didn't get a file. ";
    } else {
       // do something with the file
       header("Location: /thanks_for_your_upload.html");
       exit;
    }
?>
Upload your file:
<form method="post" enctype="multipart/form-data">
<input name="uploadedfile" type="file">
<input type="submit" name="submit" value="Upload">
</form>
Of course, you might want other input fields, insert records into a database, etc, but, the very basic framework you need to upload an image and process it is right there.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote
Old 2007-01-29, 02:49 PM   #2
BigVikingAl
They have the Internet on computers, now?
 
Join Date: Apr 2005
Posts: 148
So do I place the php code in a seperate file? Do I point my form action to this php file? Right now here is my form:

<form action="http://formmail.servage.net/" method="POST" enctype="multipart/form-data" name="Application" >

<input type=hidden name="id" value="8460">
<input type=hidden name="subject" value="FORM SUBJECT">

<table bgcolor="#a04d2d" cellpadding="7" width="750">
<tr>
<td> <div align="right"> <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="#FFFFFF"><b>Attach Photo 1:</b></font></div></td>
<td><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">
<input accept="image/gif,image/jpeg,image/png" style="width:240" name="picture1" type="file" class="inputfield">
</font></td>
</tr>
<tr>
<td> <div align="right"> <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="#FFFFFF"><b>Attach Photo 2:</b></font></div></td>
<td><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">
<input accept="image/gif,image/jpeg,image/png" style="width:240" name="picture2" type="file" class="inputfield">
</font></td>
</tr>
<tr>
<td align="right"><input name="submit" type="submit" value="Submit">
&nbsp;&nbsp;&nbsp;&nbsp;
<input name="reset" type="reset">
<br> <p><br>
</p>
<p></p></td>
</tr>
</table>
</form>


and here is my output:


Below is the result of your feedback form. It was submitted by
Unknown Stranger (nobody@servage.net) on January 29th, 2007

submit: Submit
email: nobody@servage.net
realname: Unknown Stranger





if I remove the enctype="multipart/form-data"

I at least get a return of an image pointing to a local file:


Below is the result of your feedback form. It was submitted by
Unknown Stranger (nobody@servage.net) on January 29th, 2007

picture1: C:\\Documents and Settings\\Al\\My Documents\\Invoices\\inv22.jpg
picture2: C:\\Documents and Settings\\Al\\My Documents\\Invoices\\inv23.jpg
submit: Submit
email: nobody@servage.net
realname: Unknown Stranger


I want people to upload files with their forms. Is this a server issue as the form is being pointed to a page controlled by them through the form action attribute?
__________________
MrPornReview/throat-gaggers
In depth deepthroat site reviews
BigVikingAl is offline   Reply With Quote
Old 2007-02-09, 10:00 AM   #3
BigVikingAl
They have the Internet on computers, now?
 
Join Date: Apr 2005
Posts: 148
Finally got one at:

http://www.hiqformmail.com/starting.html

Thanks guys
__________________
MrPornReview/throat-gaggers
In depth deepthroat site reviews
BigVikingAl is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:10 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc