Jump to content

eRott

Members
  • Posts

    206
  • Joined

  • Last visited

    Never

Everything posted by eRott

  1. Just realized something. [code] $showmovie = <<<MOVIE <object width='550' height='400'> <param name='movie' value='$video'> <embed src='$video' width='550' height='400'> </embed> </object> MOVIE; echo $showmovie; [/code] This is saying it can find the value stored in '$video' but where is that value of $video stored? In your code it says that the value of $video is [code] $video = mysql_fetch_array($result); [/code] which is just the results of searching the database. But there is no actual value, (eg: http://www.mydomain.com/videos/cheese.swf) for the variable $video. i am so lost.
  2. Oh ok. So just add it there... gotcha. If you mean by "hardcoding your dropdown list", manually adding all the videos, yes, that is currently what I do. While I suppose I could pull of the information from a database like you said, the main purpose of this is to allow users to directly access a video. Instead of that drop down list. Basically its just like me saying to you... "Hey I found this funny video, go here, and choose "Blah Blah" from the drop down list then click play!" Rather, I would like to be able to do... "Hey I found this funny video, go here!" You know what I mean? ... Ok, that script thing I was working on worked.. who knew  ;D. Ok, so now I have a database called ".....", inside that i have a table called "....." and inside that I have 2 fields, "video_id" and "video_name". Correct so far? Now, how do i actually go abouts adding videos to the database? Also, that code you wrote, I not too sure I follow what exactly it does. Please, let me know which option, if any is the correct understanding of what it does: a) It searches the database, finds all/any videos and lists them all on the page b) It searches the database, finds only one video and plays it c) It searches the database, finds all/any videos and lists them. Then, when a link is clicked, it plays it
  3. Yes, that was an excellent explaination. Thank you very much. That has helped a lot, i think ;D. I had been doing some looking around and this is what I have so far: config.php [code] <?php $dbhost = 'localhost'; $dbuser = 'insert_username'; $dbpass = 'insert_password'; $dbname = 'insert_database'; ?> [/code] opendb.php [code] <?php $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); ?> [/code] closedb.php [code] <?php mysql_close($conn); ?> [/code] create_database.php [code] <?php include 'config.php'; include 'opendb.php'; $query = 'CREATE TABLE .....( '.         'video_id INT NOT NULL AUTO_INCREMENT, '.         'video_name VARCHAR(50) NOT NULL, '.         'PRIMARY KEY(video_id))'; $result = mysql_query($query); include 'closedb.php'; ?> [/code] Now I just have to make it all work. Although, this part of the code you had written: [code]       // if a video was found...       $videofound = mysql_num_rows($result);       if ($videofound > 0) {         $video = mysql_fetch_array($result);         // insert standard video/swf imbedding code here, using $video as the name       } // end if found   } // end if there was a linkie clicked [/code] When you say, "insert standard video/swf embedding code here, using $video as the name" what exactly do you mean? See, I have a game and video website, and am looking for a better way to show videos. Currently, for the videos I just have a page for the category and all the videos are there. So for example, all my funny videos, I have one page where there is a drop down list that users select a video from and click play then the videos shows in a frame. But why I want to do it with the whole id thing, is so people can access an individual video directly, instead of having to go to funny.php and selecting it from the drop down list. Here is the code of funny.php: sorry, keeps saying the server reset the connection while trying to load the page, so just use this link: http://www.erott.retect.com/videos/funny.txt
  4. omg. The response time is like 3 seconds. Hell, I can't even look away before someone has already replied! This forum is amazing!  ;D. Anyway, back on topic, yes please. ANY and ALL help you can provide is more then appreciated. Also, using a mySQL database, how would I go abouts adding more information to it? Would I also need some sort of form that I enter information into then submit it and it writes to the database. I am at an even greater state of confusion when it comes to MySQL databases.
  5. @ Jenk I am going to be honest with you... I have NO idea on earth what that means  ;D. @ Millar That's about all I know about this. I've seen that type of code thing elsewhere, however, I have no idea how to write it. I mean, I do I assign the ids in the first place etc... I can read and understand and modify php code, however, I am completly clueless when it comes to actually writing it. Consider me an alien who just arrived on earth who is trying to learn php  ???. By the way, wow. You guys certainly replied fast  :o
  6. Hi, I didnt really know what to name this but I hope someone can help. While I do know some stuff about PHP, I am still learning. I have seen many website with urls such as http://www.mydomain.com/index.php?page=contactus I am just wondering, how would I do something like this. I am looking to create something similar whereby it specifies a certain video for example. So I am looking for something like: http://www.mydomain.com/videos.php?id=rocket_launch And if someone were to go to that link, it would display that video about a rocket. So basically every single video has an id and i could do a link thing like that. So for example I could have a bunch of different ones like: http://www.mydomain.com/videos.php?id=rocket_launch http://www.mydomain.com/videos.php?id=exploding http://www.mydomain.com/videos.php?id=best_card_trick Take YouTube for example. I am looking to do something similar to that. For example, one of their URLS to a video is: http://youtube.com/watch?v=MBwEd_g62Hk I am thinking simple, something more like having two simple files; vid_id.php and video.php (for example). Then, in the vid_ip.php file it would contain a list of all the videos, and have id's. For example, the numbers 0-5 are the id's, and for every id it tells the source of the video file. [code] [0] src="http://www.mydomain.com/videos/rocket.swf" [1] src="http://www.mydomain.com/videos/balloon.swf" [2] src="http://www.mydomain.com/videos/cake.swf" [3] src="http://www.mydomain.com/videos/cheese.swf" [4] src="http://www.mydomain.com/videos/apple.swf" [5] src="http://www.mydomain.com/videos/cat.swf" [/code] Then, in video.php a simple script which would allow me to simply type in http://www.mydomain.com/video.php?id=3 in the browsers address bar and it would then bring me to the page which will show the video about cheese. Would it be possible to do something simple like this? Thank you. Best Regards,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.