Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. Thanks tomorrow when I start back on this, I will take a look at this, and have something to go by, thanks.
  2. What I don't currently understand is how to make sure it's set to each specific entry, if they click to change one of them over to approved, but want to leave another until later, how will I be able to tell them the difference in each other.
  3. I have a script here, I am working on an approval/decline system now. The idea is, whenever someone enters something new into the database, it does a bit, it gives the file name, a name, it does a url to the file, whatever.  I have a whole system set up for that, now I have an admin page to decline approve new entries, I have a place in the db under the proper table called approval it's default is 0.  I am having trouble doing 2 things, I have queried it, but I am having trouble making it work, I also need to know, how do I make new entries be tied into some new system to delete the data when it is declined. Because there will be new ones appearing here each time, I don't know how it will discern which entries are which, all I know is that it will pull up all entries with 0, I want if he accepts 1 it changes to 1, if he declines, it deletes the information, and deletes the file location as well.  What I need to figure out though is how to get the new entries, to where they are tied in with whatever I use for decline/approve, I also need to know how to get this query to work properly. [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Approval</title> </head> <body> <h3>Welcome Bobby</h3> <p>These are recently pending database entries, please accept/decline.  Please note declined entries are automatically permanently deleted from the database.</p> <?php $connect = mysql_connect("localhost", "######", "######"); $select = mysql_select_db("funnyemailforwards"); $errorhandler = ""; $management = true; if (!$connect || !$select) { $errorhandler = "The database could not connect, or was not selected<br />"; $management = false; } if ($management == true) { $query = mysql_query("SELECT * FROM `fileinfo` WHERE approval = '0'";); if (mysql_num_rows($query)) { while($row = mysql_fetch_assoc($query)) {             extract($row); } } } if ($errorhandler != "") { echo "$errorhandler"; $management = false; } ?> </body> </html>[/code] The first thing is building the general query, the second, is I know I am going to make it output a form for each entry, but I don't know how to make it work only with the entrys it supposed to, seeing that every entry will be different I Don't understand the general theory behidn this part.  And about the query, am I atleast on the right track?
  4. I fixed it I just changed my regular expression around a little.
  5. Still can't seem to get this to work right?
  6. [code] <?php $funnyurl = $site . $funnyurl; if (preg_match("/[.txt]{4}/i", $funnyurl)){ require_once("./includes/view_text.php"); }elseif (preg_match("/[.jpg|.gif|.jpeg|.bmp|.tiff]{4}/i",$funnyurl)) { require_once("./includes/view_picture.php"); }elseif (preg_match("/[.mov]{4}/i",$funnyurl)) { require_once("./includes/view_quicktime.php"); }elseif (preg_match("/[.ram|.rm|.ra|.rpm]{4}/i",$funnyurl)) { require_once("./includes/view_realmedia.php"); }elseif (preg_match("/[.asf|.wma|.wmv|.wma|.wm|.asf|.avi|.mpeg|.mpg|.mp2|.mp3|.mid|.midi|.wav]{4}/i",$funnyurl)) { require_once("./includes/view_windowsmedia.php"); }elseif (preg_match("/[.swf|.swc|.flv]{4}/i",$funnyurl)) { require_once("./includes/view_flash.php"); }else { echo "No file exists at this location"; } ?> [/code] I took care of all those, I was getting confused with java script, I mostly use javascript or did. The next question I had is why isn't it working now, it's still having the same problem http://www.funnyemailforwards.com/display.php
  7. Ah so instead I would use <?php echo $funnyurl?>
  8. He means have something to where tables can auto-generate themselves using php with proper attributes based on the situation.
  9. What am I doing wrong here [code] $funnyurl = $site . $funnyurl; if (preg_match("/[.txt]{4}/i", $funnyurl)){ require_once("./includes/view_text.php"); }else if (preg_match("/[.jpg|.gif|.jpeg|.bmp|.tiff]{4}/i",$funnyurl)) { require_once("./includes/view_picture.php"); }else if (preg_match("/[.mov]{4}/i",$funnyurl)) { require_once("./includes/view_quicktime.php"); }else if (preg_match("/[.ram|.rm|.ra|.rpm]{4}/i",$funnyurl)) { require_once("./includes/view_realmedia.php"); }else if (preg_match("/[.asf|.wma|.wmv|.wma|.wm|.asf|.avi|.mpeg|.mpg|.mp2|.mp3|.mid|.midi|.wav]{4}/i",$funnyurl)) { require_once("./includes/view_windowsmedia.php"); }else if (preg_match("/[.swf|.swc|flv]{4}/i",$funnyurl)) { require_once("./includes/view_flash.php"); }else { echo "No file exists at this location"; } [/code] http://www.funnyemailforwards.com/display.php The problem is currently, it shows a media player file it shouldn't were did I misformat my code? It isn't suppose to show anything unless something matches one of those filetypes, it was working right all the way down to the point where I added in else if (preg_match("/[.asf|.wma|.wmv|.wma|.wm|.asf|.avi|.mpeg|.mpg|.mp2|.mp3|.mid|.midi|.wav]{4}/i",$funnyurl)) { require_once("./includes/view_windowsmedia.php"); } Now it tried to show that one whether it matches or not.
  10. What can I use in stead of the shortcut, it's not too late for me to change it all now.  I just thought it was an easy way to insert stuff in xhtml without taking up too much room, what do you recommend.
  11. I have my php script set up like this. <embed src="<?=$funnyurl?>" width="100" height="100"></embed> I am passing a php variable into, it connects but it's not playing, it shows a big question mark.  Is there something else I need to do to get files to display.  I need to pull the stuff from the database, and play it from the directory, I have a script set up, and it properly handles pictures, txt, and now it's time for music, and video?
  12. [code]<object classid="{$clsid}" type="{$type}" data="{$data}">[/code] This is the code I have to insert my windows media player thing.
  13. I got it nevermind, thanks I had the recieving script wrong.
  14. [code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>testpicture</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!--<link href="style.css" rel="stylesheet" type="text/css" />--> </head> <body> </body> </html> [/code] This is what I have so far, but that is with the code you gave me, I don't understand why it isn't showing up there.
  15. It didn't work for some reason, I know it works some, because I had another one access the txt file earlier, and it worked perfectly.  But now the image isn't showing up, I have it in another page, aside from my pages up there this is what I have in my view image file, if you want to see how they get here look in the first post.  I have one php file for each grouped types [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title><?php echo "{$nameoffunny}" ?></title> </head> <body> <?php echo '<img src="' . $funnyurl . '" />'; ?> </body> </html>[/code]
  16. I finished my txt script but I can't get my images to access for some reason, I tried the following 2 codes on the appropriate page. echo '<img src="{$funnyurl}" />'; and echo "<img src='{$funnyurl}' />; and <img src="<?php echo '{$funnyurl}'>; I cna't get any of them to work.
  17. [code]<?php $file = file_get_contents($funnyurl); $file = nl2br($file); echo "$file"; ?>[/code] That worked now how do I handle .pdf, or .doc files, or are those worthless, or overly complicated to get to work properly.
  18. http://www.funnyemailforwards.com/apex/uploads/websitereport.txt That is the url exactly, and when I tripled check it's exactly the samething, it will change with each file, but it will still always point to the right file. The stuff I used with getfilecontents was the following code [code] $file = file_get_contents($funnyurl); echo "$file"; [/code] That is what I used I must have done it wrong because now it does something but nothing like what I expected. http://www.funnyemailforwards.com/file/dickhead for one the report had 2 times as much in it as that, it seems, adn another it looks like crap, I thought it would print it out like it was in the txt file.
  19. Nothing white screen. Here is what I have if it helps, but I will be reposting it later in another thread, I was going to keep one massive thread later for help, but here is some of the code. This is the page that you come to to handle viewing files, and htaccess is fixed to make this work properly. [code]<?php # getLoc() grabs the current URL and parses the fake folders into variables. function getLoc(){ $dirname = split("/", getenv("REQUEST_URI")); foreach ($dirname as $var) { if (($var!="BidRent")&&($var!="display")&&($var!="")){ $p[] = $var; } } return $p; } # They are called and set here. $pages = getLoc(); $folder = trim($pages[0]); $pagename = trim($pages[1]); $site = "http://www.funnyemailforwards.com/apex/"; $pageTitle = "Page For $page1"; mysql_connect("localhost", "####", "####")or die(mysql_error()); mysql_select_db("funnyemailforwards")or die(mysql_error()); $select = "SELECT * FROM fileinfo WHERE nameoffunny = '$pagename'"; $query = mysql_query($select); $count = mysql_num_rows($query); $fetch = mysql_fetch_assoc($query); if ($count > 0){ if(extract($fetch)) { $successful = true; }else $successful = false; }else{ echo "The file Does not Exist"; } /* Ok so now that you have the basic environment set up, you want to take $page1 and search the database for the URINAME (which you need to insert upon data submit, URL friendly -- They need to be unique!) preg_match("/[.doc|.txt|.wod]{4}/i",$string) Once you find one, grab its ID and table its under (if the types of data are in different tables). Once these global variables are set you will include premade files that handle each type of data, think template that will auto populate the page in specific areas with that datas information from the database. (by global variables i mean inside those includes will all use the same variables set here). So once you figure out what type it is, grabbed its id etc the page continues to load, maybe grab the title while you check and the type to build $pageTitle -- since this is a gateway you need to do as such. so lets say this is a picture under aaron. $area = "picture"; $uriname = "aaron"; grab the ID or just use the unique uriname and grab its information. the file will parse it as a picture with its info. You may notice commented includes for header and footer, i dont know how your doing it but i usually cut the top and bottom of my sites off and stick them in their own files, and include on main files, this allows me to not have to edit a hundred files if i just need to change 1 thing at the top of the site. */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo "{$nameoffunny}" ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!--<link href="style.css" rel="stylesheet" type="text/css" />--> </head> <body> <?php $funnyurl = $site . $funnyurl; if (preg_match("/[.txt]{4}/i", $funnyurl)){ require_once("./includes/view_text.php"); } ?> </body> </html>[/code] Below here is the code for viewing the txt files. [code]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title><?php echo "{$nameoffunny}" ?></title> </head> <?php echo "{$funnyurl}"; $open = fopen($funnyurl, "r"); echo "{$open}"; ?> <body> </body> </html>[/code] $funnyurl ends up being the full file path. The current error messages are nothing, it just doesn't do anything. When I try to echo it like that I get Resource Id #5 or something here is my db info id   type  nameoffunny  keywords  funnyurl  entrydate  approval        Those are my columns in my table fileinfo The funnyurl for this specific file is /uploads/dickhead.txt then the url is http://www.funnyemailforwards.com/apex/ when I add the strings together I get the url with whatever the file name is
  20. I don't know much about tihis yet I just got past the difficulty of trying to get my barebones script set up this is what I tried get_file_contents($urloffile); it didn't work I also tried $file = fopen($urloffile); echo "$file";
  21. I have written a script finally to handle my files, it's a display file, and I made modifications to php ht access What I am needing to ask, is I am trying to get the contents of the file via the url, http://www.funnyemailforwards.com/apex/uploads/file.ext in this case .txt, and .doc and .pdf But I am just wanting to pull all the text out of those files, and throw it onto the screen.  In one giant p tag I was hoping to do< <p> Work with the file and make it display </p> But I don't know what functions to use.
  22. How do I get a .txt, .doc, .pdf file display as regular text in a webpage. I wanted to change them all over If pdf and doc aren't possible without using a pdf file then I just want to display txt files, any advice, using php.I know how ot access the file and url I just have to know what functions to use to get it to display I tried fopen and file_get_contents but neither of them did what I wanted.
  23. Thanks for the help, I am glad it finally works.
  24. I have to set up something with php and mysql, to search idx what is idx internet data exchange:S
  25. 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.
×
×
  • 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.