Jump to content


Photo

2 questions


  • Please log in to reply
11 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 July 2006 - 02:00 PM

I have 2 things I am trying to do, but I don't understand where to start.
I have to get files to embed into a page when they are uploaded, and have to have the filename as the url.
For instance if someone names the file ants
it would be accessed through
www.funnyemailforwards.com/ants
I need to figure out how to get them all to appear like this but I don't understand how, I also don't understand how to set up the files to embed automatically each time they are uploaded based on filetype?
[move]Thanks for the help.[/move]

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 03 July 2006 - 02:55 PM

I don't fully understand what you mean by 'embed' a file into a page. You can use include() to insert another scripted/plain text file within your page...

With regards to your URL structures, you can do that with an Apache module called mod_rewrite, searching the forums or checking out the documentation over at apache.org should help you out with that.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 July 2006 - 03:08 PM

I will look into mod rewrite what I don't understand about embedding, is how to get a video or music file to be played automatically, and have a download link, this is over my head, I will check into that mod_rewrite first.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 July 2006 - 03:18 PM

To embed say a video or a music file in to a page you'll want to look into imbedding objects into a webpage with html.

This site here generates the HTML for you here:
http://cit.ucsf.edu/...media/step1.php

#5 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 03 July 2006 - 03:21 PM

Oh, I understand now. There is no 'global' way of embeding media files into a webpage as each different type of media file is embeded slightly different.

For example, you can embed a video file, within a Windows Media Player window with the following code:
<object id='MediaPlayer' width='292px' height='290px' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' standby='Loading Windows Media Player components...' type='application/x-oleobject'>
    <param name='FileName' value='videos/$row[filename]'>
    <param name='ShowControls' value='true'>
    <param name='ShowStatusBar' value='false'>
    <param name='ShowDisplay' value='false'>
    <param name='autostart' VALUE='false'>
    <embed type='application/x-mplayer2' src='videos/$row[filename]' name='MediaPlayer' width='292px' height='290px' ShowControls='1' ShowStatusBar='0' ShowDisplay='0' autostart='0'>
    </embed>
</object>

If you do a bit of a search on Google it's pretty straight forward to find out how to include other types of media, aswell as the list of other parameters you can use in the above example.

#6 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 July 2006 - 05:01 PM

That helped a lot, now the one thing I don't understand is how to make the embedded page, have a relation to the uploaded specific file.  Seeing that each file will be in the directory, and each one will have a different name, what prevents from the txt file I have over here called funnypoem, from accidentally attempting to embed itself in a windows media player page.  I don't understand how to make the embedded pages to be exactly related to the uploaded files.  Because on each individual page, I need the file imbedded, and to create a link on each file, so that people can click the link and have it download the file incase they don't have the proper plugin.
I know this is a lot, but when I get only 1 txt file, all I need to do with txt files is have them display, how is it going to know not to try and have a download link too, this is the best way to explain what I Don't understand, I am confused, and have tried to explain it before, but maybe that helped.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#7 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 July 2006 - 05:18 PM

This tutorial here shows you how to read files in a directory.

But to see whether a file is a PHP file or a TXT file I'd use the substr to get the last four characters from the filename. Then I'd use str_replace to remove the period (.) from the string. Now That I have just the extension I'd use if statment to see whether extension is equal to txt or use in_array to check the file extension again multiple file extensons.

#8 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 July 2006 - 05:20 PM

Thanks before I ask any more questions related to this, I am going to step back and look over all this advice, and the tutorial and see if I have enough tools and knowledge now to get this done, thanks a lot for the help, I have a deeper understanding of what I am doing now, before I start digging into it too deep, thanks again.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#9 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 03 July 2006 - 05:37 PM

I finished a high school project on a site it involved videos and streaming, i used the standered html enbeded method and gess what the client wanted a better solution, the problam was that when the user moved the page up and down the browser would destalt the video in the page.

In the end i enbeded a flash video viewer but know the complant is that users got to install flash.

didnt fine a way around it,  so if you bussiness man do get a nice sharp video player enbeded that works on most file exstentions please let me know cheers.



heres an example of html method/php.

Your also notice i added apic if the user has not got a video ok.

good luck.

  <?

$video_query="SELECT * from members_video_uploads where id='$id'";
$video_result=mysql_query($video_query);

while($vid=mysql_fetch_assoc($video_result)) {



?>


<td  align="center"><b>members video</b><br><br>

<object
width="125" height="125" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1">
<param name="filename" value="members_video/<?echo $vid["userfile_name"];?>">
<param name="AutoStart" value="false">
<param name="ShowControls" value="true"><br>
<param name="ShowStatusBar" value="False">
<param name="ShowDisplay" value="false">
<param name="AutoRewind" value="True">

<embed type="application/x-mplayer2"
filename="kids.mpg" autostart="True"
showcontrols="True" showstatusbar="False"
showdisplay="False" autorewind="True">
</embed></object>


<?
}
if(mysql_num_rows($video_result)==0){
echo'
<td  align="center"><b>members video</b><br><br><img width="125" height="125" src="images/novid.png"></img>';
}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#10 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 03 July 2006 - 05:45 PM

I will keep this in mind, thanks.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#11 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 04 July 2006 - 02:55 PM

What I don't understand is how to write to the file.  Like if a video file get's uploaded, how do I automatically have php create a page for it, and have the stuff in the page I need for it to work, and have a filename, I don't know how to do this, but then if it ends up being just a txt file, have it create a .php filet hat just shows the file information, just created pages with php, one page for each file type, so I can also generate a link, and have it save the new page in a directory with all the proper information:S:S

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#12 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 04 July 2006 - 03:04 PM

What I mean is this
I want to have this all in one page
I noticed how if you upload files, a script can move the file, or whatever, it can even create files out of nowhere like pdf's or whatever.  The thing I am wondering, is I can have like this, now that I have my extensions, I can have something for like
if (fileextension = "this, this, and this") or whatever
then I can have my stuff here, and have my php script create a .php page, and name it the filename the person gives it .php, then have that create the proper tags, like if it's text, i can have the otehr file just create the necessary tags to imbed, and put them in there, then have it create a download link, or whatever, is this a possibility.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users