PHP+SQL+File Upload

This is a discussion on "PHP+SQL+File Upload" within the PHP Forum section. This forum, and the thread "PHP+SQL+File Upload are both part of the Program Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old May 9th, 2008, 17:25
Junior Member
Join Date: Jul 2005
Location: Lethbridge, Alberta
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
PHP+SQL+File Upload

I have a job lined up requiring something new for me. The client wants to have the ability to put daily videos up on his website. All these videos will be converted to flash before putting them on the website. He tells me each video will be approimately 10-15min. I've been doing some searching, but so far haven't really found what I'm looking for.

I do know that I can purchase a "PHP UPLOAD2" from DMXZone program that can do this, but I was thinking this should be something I can do myself.

So here's what I'm trying to do.

1) Create a page to upload the file. This will include an HTML based page with a name field and also the file upload, and then submit it.
2) Then a PHP page will dump the file into a 'video' folder, and place the name and location into an SQL database.
3) Over on the display page I have a different problem.
3a) I will place an imageholder on the spot where the flashvideo will play
3b) Under this video spot, will be an entire list of the videos given by name (the name field from the upload). This would be done by a pull from the SQL database
3c) Upon clicking one of this links, it will play that video in the video holder spot.

This upload section will be in a sql-based "user authentication" part of the website. So there is some security there, and I will make it so it only uploads flash files.

Some direction would be most helpful. Perhaps pointing to some tutorials that you think best fit this scenario. I've been finding tutorials on 'picture uploads' similar to what I'm going for, though I know I'd have to increase the size limitations that they have placed in those. Just trying to get some further insight on this.

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old May 10th, 2008, 00:57
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,275
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: PHP+SQL+File Upload

How much PHP and SQL do you know? I can't really give you a poke in the right direction until I know how much you can do already.

But 10-15 minute videos could be quite large, be sure to double check how big they are and your hosts max POST size and the max upload filesize are greater than this.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old May 10th, 2008, 15:36
Junior Member
Join Date: Jul 2005
Location: Lethbridge, Alberta
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP+SQL+File Upload

Well... I'm not an expert, let's start there. I'm probably a novice that can look at a block of code and figure it out. In the past I would input information into the database, and then pull that info into a PHP page using PHP/SQL. Or I will get code that will do what I want and try to figure out how it's doing it.

Recently I've been going through some basic tutorials on how to upload a file and have the file name and file location stored in a database, and the file actually stored in a folder. (Found an article at About.com but I keep getting errors when I run it and it doesn't work)

As for the video, this does worry me a little. I mean I could just have him FTP the videos, but than I would probably have some issues when I attempted to pull the information out for the display page. I am going to use Easy Web Video which will convert all videos into a smaller size and in flash. Hoping that alone may help make a difference.

And then for the display page which I envision to chart out all the videos in the database, and have a 'video area' that will display the video the user clicks on in the chart.

Hope that helps you understand where I'm at a little more.
Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old May 10th, 2008, 16:07
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,275
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: PHP+SQL+File Upload

so it sounds like you can do everything there. although using a regular upload would take 5-10 minutes, so a progress bar might be nice. (You can do this with PHP 5.2 and greater, anything less you'll have to use a perl hack.)
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old May 10th, 2008, 16:44
Junior Member
Join Date: Jul 2005
Location: Lethbridge, Alberta
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP+SQL+File Upload

thanks for that!!

I was able to figure out that I am running PHP 5.2.2 so it looks like that will work, and will be a very handy tool.

Quick question.... for the page where I will display all this. As mentioned, I want to have a "video area" at the top of the page, like an imageplaceholder. Then underneath that I will have a table which will auto-populate the titles of the videos from the database.
Each link will than link to the video corresponding to the title (info gained from the database). When you click on the link it will than play that video in the video section.

how do I do this?
Cause I'm lost on how to get it all to link together, list all the videos and have it so they link and play the video on the top.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old May 10th, 2008, 16:48
CloudedVision's Avatar
Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,275
Blog Entries: 9
Thanks: 2
Thanked 40 Times in 40 Posts
Re: PHP+SQL+File Upload

Easy:
  1. Get the videos from the database
  2. Loop through the results using mysql_fetch_array()
  3. Each loop create a link to myvideoplayer.php?video=currentvideo
  4. In myvideoplayer.php send the value of $_GET['video'] to the flash video player
  5. have the flash video player play that video (not sure how to do that, you'll have to ask in the Flash Forum for that)
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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
file upload berry05 Job Opportunities 0 Mar 19th, 2008 19:09
renama file name before upload mcnika PHP Forum 1 Mar 17th, 2008 12:13
File Upload magiccupcake PHP Forum 1 Jan 22nd, 2007 05:10
simple file upload? jimmy_d PHP Forum 3 May 19th, 2006 18:27
File upload djme PHP Forum 4 Jan 11th, 2006 18:25


All times are GMT. The time now is 20:18.


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