[SOLVED] Array code help

This is a discussion on "[SOLVED] Array code help" within the PHP Forum section. This forum, and the thread "[SOLVED] Array code help are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 23rd, 2007, 16:50
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Array code help

What code do i need to finish of my array form so once the submit button is pressed, the images are uploaded into a file called "images" & the name of the images is uploaded into the sql databse with the rest of the form!

Below is the bottom of my array code:

PHP: Select all

$fields['select'] = array('type'        => 's',       
                               
'required'    => true,    
                               
'column'        => 'first_name'    
                               
); 

    
$fields['select2'] = array('type'        => 's'
                               
'required'    => true
                               
'column'        => 'last_name' 
                               
); 

    
$fields['select2'] = array('type'        => 's'
                               
'required'    => true
                               
'column'        => 'image_one' 
                               
); 
    
$fields['select2'] = array('type'        => 's'
                               
'required'    => true
                               
'column'        => 'image_two' 
                               
); 
Any suggestions???


Cheers,
Reply With Quote

  #2 (permalink)  
Old Nov 23rd, 2007, 17:34
SuperMember

SuperMember
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Array code help

Dont know if i can help to much with this one.

but something like this will grab an upload file and stick it where you want it.

PHP: Select all

if (is_uploaded_file($file_array["tmp_name"])) {
        
move_uploaded_file($file_array["tmp_name"], "$file_dir/".$file_array["name"]) or die ("Couldn't copy"); 
it might give you some ideas.

$file_dir = "yourlocation";

Last edited by dab42pat; Nov 23rd, 2007 at 18:06. Reason: forgot
Reply With Quote
  #3 (permalink)  
Old Nov 23rd, 2007, 18:44
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Array code help

Thanks m8t al give it a go
Reply With Quote
  #4 (permalink)  
Old Dec 1st, 2007, 15:14
Reputable Member
Join Date: Oct 2007
Location: Liverpool UK
Age: 29
Posts: 216
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Array code help

I have solved this problem by simply using a different chunk of code at the botton of the array to handle file upload!!! Its to much hard work trying to mix file upload PHP code with the array code when a seperate peace of code works just fine

The array also need a record inserted to work, once the record was inserted the image section ($_POST) needed to be changd to ($_FILES)

Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Fetch Array problem Aso PHP Forum 3 Dec 4th, 2007 16:13
[SOLVED] select from array in drop down box saltedm8 PHP Forum 6 Dec 3rd, 2007 21:08
[SOLVED] Array sorting welshstew Classic ASP 6 Nov 28th, 2007 16:45
[SOLVED] saving data from one array into another eon201 PHP Forum 2 Nov 7th, 2007 09:34
[SOLVED] array woes eon201 PHP Forum 1 Nov 6th, 2007 15:13


All times are GMT. The time now is 02:16.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43