| Welcome to Webforumz.com. |
|
May 9th, 2008, 17:25
|
#1 (permalink)
|
|
Junior Member
Join Date: Jul 2005
Location: Lethbridge, Alberta
Posts: 17
|
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!
|
|
|
May 10th, 2008, 00:57
|
#2 (permalink)
|
|
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 520
|
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.
__________________
Take it easy
Other Road Design
WebForumz Moderator: HTML | Javascript | PHP
|
|
|
May 10th, 2008, 15:36
|
#3 (permalink)
|
|
Junior Member
Join Date: Jul 2005
Location: Lethbridge, Alberta
Posts: 17
|
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!
|
|
|
May 10th, 2008, 16:07
|
#4 (permalink)
|
|
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 520
|
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.)
__________________
Take it easy
Other Road Design
WebForumz Moderator: HTML | Javascript | PHP
|
|
|
May 10th, 2008, 16:44
|
#5 (permalink)
|
|
Junior Member
Join Date: Jul 2005
Location: Lethbridge, Alberta
Posts: 17
|
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.
|
|
|
May 10th, 2008, 16:48
|
#6 (permalink)
|
|
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 520
|
Re: PHP+SQL+File Upload
Easy:
- Get the videos from the database
- Loop through the results using mysql_fetch_array()
- Each loop create a link to myvideoplayer.php?video=currentvideo
- In myvideoplayer.php send the value of $_GET['video'] to the flash video player
- 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)
__________________
Take it easy
Other Road Design
WebForumz Moderator: HTML | Javascript | PHP
|
|
|
| Thread Tools |
|
|
| 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
HTML code is Off
|
|
|
|
|
|