Jump to content

businessman332211@hotmail.com

Members
  • Posts

    304
  • Joined

  • Last visited

Everything posted by businessman332211@hotmail.com

  1. No I mean like being able to display code directly to the browser without it getting read as a language.Like if i write any tutorial, for xhtml, css, javascript, ajax, php, asp jsp, there has to be a way to show code examples, of the language without actually running the language.Like if I was explaining echo I would want to SHOW to the people<?phpecho "hello world";?>without it actually running the script but instead show the whole block of code as text, the same with xhtml, javascript, or css tutorials.
  2. I need some very quick help. I need to just figure out how to make text show, no matter what language. It hink this is xhtml. I want to be able to display code in a browser, no matter what language, asp, jsp, html, php, javascript, whateverTO where when I write tutorials I can have code examples, and I want the code to print out to the screen without actually parsing, or running. Advice anybody?
  3. I am wanting to get a good stepping stool for this and make sure it's even worth my time. I know for a fact ajax is worth my time and it's something I need to, and want to learn, I am also going to learn rss soon. The other language I have my sites on is ruby on rails. I always want my main programming language to be php, I might even pick up enough asp and jsp to be able to use them, and do something with them, BUT I will always use php as my main. The thing I want to currently ask is, I know a little about what ruby on rails is. The thing I need to ask is, how can it be used in relation to php, I am pretty sure it's not a server side programming language, is it something I can use with php, or somethign that will end up ultimately replacing php, if I started using it.I want to learn what I call, all the aiding languages first.Like languages I generlaly use on everythingFor instancexhtml/css is always layout and design.PHP/mysql is my server side and database of choice.Javascript(with advanced ajax once I learn), I use a a browser side language, and ajax as a supplement to my applications. Now I come to the point where I am eyeing ruby on rails, where does it fit into this equation. Is it something(like ajax) can be just a supplement to my other languages, or will it end up taking over one or more of those languages if I started implementing it. That is what is going to help me decide whether to start learning it or not.
  4. everything else with the files are taken care of, including setting those variables, it's just not doing anything/
  5. // The code below I used from a friend named just some guy from the forums at // w3schools. It takes the path name, and the// file name of the file I am using, and it tests the directory to see if the file// already exists. If it exists then it takes the current filename and path// I am working with in my script, and renames the file, enought to where it can// still be added. This isn't used necessarily to allow someone to upload// the same file 2 times, but more of if it ends up being the situation// where the filename is the same on 2 different computers and those files// just end up happening to have the same name. // Just a safegaurd against discrepancies in case. // The whole section between comments was created by someone else.if (file_exists($basepath . $filename)) { $nr = 0; $filename = $_FILES['lostimage']['name'] . "_{$nr}"; while (file_exists($basepath . $filename)) { $filename = $_FILES['lostimage']['name'] . "_" . $nr++; }}// end script from just some guy on w3schools.com that tests if the filename// exists or not obviously I got this from just some guy. The thing is I can't get it to work, it's only second priority, if I even get it working, it's a low budget project, that for now is only getting the essentials until they increase there budget later on down the road. I will be doing more when she get's income from the site, if the filename is named the same it keeps it the same, it's in a larger script. If the same file is uploaded it just saves it over the old one, which is fine, the picture can be shared by 2 posts, but if one post expires and delete's the picture then the other post is out of luck until it expires. This is something that may only happen one or 2 times within a year but it's still a possibility nevertheless. If I can't get this to work, I will just useif file_exists to test for it, and return an error if the file already exists.
  6. If they refuse you can get them to terminate the hacker's accounts through court order if you have the identification on the hackers.
  7. Yes I fixed this one months ago, thanks though i barely ever have any php questions anymore, except on advanced topics now.
  8. Oh that was something I didn't know, I was wondering, I stepped away for a few months, because I was on a huge project, I came back and noticed there was no posts since I left it, thanks for telling me that. Do they know who hacked it, were they able to do any ip traces, or get law enforcement, or fbi involved. Hackers can be traced, and you can get legal authorities to help in the investigation, as well as being able to prosecute for the hacking, and for the damage done to the site. If they can find the person, there are police squads specifically trained to hunt down hackers home computer, from there ip, even if they change ip addresses all there old adresses are still registered, with there web host provider, and recorded in the whois database. It can be traces to the service provider, then they can be issued a court order to provide details about the person's home address and everything off the records in there computer with the ip address.
  9. I have noticed lately, in general this forum use to be loaded, with questions, answers and everything but it seems for the past month it's been dead, I have posts up here that got answered on the 7th of last month, almost 1 month ago and htey haven't even been bumped yet.
  10. Ok I understand the date thing now, can you reexplain the date funciton I haven't been using dates for long.I don't understand this fully.
  11. The thing I don't understand about the date is, I have the unix time stampt set into the database as entrydateBut when I try to pull the entry date out and format it, it doesn't let me, it automatically sets the date to the current date.Another thing I needed to know, is how do I fix these problems <!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. These are all updated together, upon submit. The ones that are approved are set to approved status, the ones that are declined, are immediately deleted from the database, and the file is removed from it's location on the server. If you check some of the choice, and leave some of the choice alone, they will still be here later, for instance if there are 3 items listed. If you approve 1, decline 1, and leave the other alone for now, the approved one is updated, the declined one is deleted, and the one left alone, is not touched, and left there, for you to update later.</p><?php // Connects to database$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;}?> <?phpif (isset($_POST['update'])) { foreach ($_POST['approval'] as $key => $value) { if ($value) { mysql_query('DELETE FROM fileinfo WHERE id='.$key); unlink($funnyurl); // url is set to exactly like this // http://www.funnyemailforwards.com/apex/uploads/filename.ext // Follows a path exactly to the file. } else { mysql_query('UPDATE fileinfo SET approval=1 WHERE id='.$key); } }// closes foreach}// closes isset control structure?><?php // script to display information$result = mysql_query("SELECT * FROM fileinfo WHERE approval=0 ORDER BY entrydate ASC");echo "<form name=\"dataupdating\" action=\"approval.php\" method=\"post\">";while ($row = mysql_fetch_assoc($result)){extract($row);$date = date("m/d/y");$site = "http://www.funnyemailforwards.com/apex/";$funnyurl = $site . $funnyurl; echo "<ul>"; echo "<li><a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a></li>"; echo "<li>" . $date . "</li>"; echo "<li><input type=\"radio\" name=\"approval[$id]\" value=\"1\">Approve</li>"; echo "<li><input type=\"radio\" name=\"approval[$id]\" value=\"0\">Decline</li>"; echo "</ul>"; $management = true;}if ($management === true) {echo "<input name=\"update\" type=\"submit\" value=\"Update Database\">";echo "</form>";} if ($errorhandler != "") { echo "$errorhandler"; $management = false;}?></body></html> The thing that happens is now if there are no entrys it saysupdateanywayI don't want it to show that update field unless there are entries, but if I put it inside, it keeps repeating the update, I don't want it to do that either. Also it tells me hte file does not exist in the section where it's suppose to delete the file, I don't understand, I am feeding it the full file path, I add 2 variables, I have/uploads/filname.extensionsaved int he dband $site = "http://www.funnyemailforwards.com/apex/ saved in the variableso it looks like thishttp://www.funnyemailforwards.com/apex/uploads/file.extTHat is what is fed to unlink but it's telling me the file does not exist.
  12. I can't see now, I think you shoudl redo coloring but that's not what you are asking for advice one, so I don't really know, I never encountered that problem before.
  13. Use php, or javascript, or some other programming language, or maybe there is a way with css, but none that I know of, CSS isn't dhtml, it's just a styling language, I don't think it can have that kind of logic, except for if you have the general content flow correct some things flow into place, like the bottom stuff will continue heading downwards to match the length of the page, other than that there is nothing that I know of.And if you thought it was height:auto then give it a try, show us a url link, give us some code, something to go by, and We cna have a look at it and see what we can figure out for you.
  14. Can you show me real quick how to put that script you showed me here, to change the filename each time, how to work it into my script some, I am naming files based on 2 things, the name of the file, and the nameoffunny this is the persons name they give the file when entering the form, that is where most of the calls come from that, field, and I noticed I can name them 2 times. Here is my current script. I am not asking for someone to run through this and answer all my questions, but I am asking if a passerbyer sees a question at the bottom they know, if they can answer, with a number so I know which one, then I would appreciate it, this is an area where I ask things I have learnt over the past few weeks, that I need some understanding on, thanks. <?php$management = true;$errorhandler = "";$filemanager = true;$dateinfo = strtotime("now");$dateformatted = date("n-d-y", $dateinfo);if ($_POST['name'] == "") { $errorhandler .= "The Name field has been left blank<br />"; }if ($_POST['keywords'] == "") { $errorhandler .= "The Keywords were left blank<br />"; }if(!is_uploaded_file($_FILES['file']['tmp_name'])){ $errorhandler .= "No file has been uploaded<br />"; $filemanager = false; } if ($filemanager === true) {$_accepted_extensions = array('.tiff', '.png', '.mpeg', '.mpg', '.wav', '.avi', '.mid', '.jpg', '.txt', '.gif', '.mp3', '.jpeg', '.gif', '.swf', '.swc', '.flv', '.mov', '.ram', '.rm', '.ra', '.rpm', '.asf', '.wma', '.wmv', '.wm', '.asf', '.wma', '.wm', '.avi', '.mpeg', '.mpg', '.mp2', '.mp3', '.mid', '.midi', '.wav'); if ($filemanager == true) { $tmp = pathinfo($_FILES['file']['name']); if (in_array('.' . $tmp['extension'],$_accepted_extensions)) { $filemanager = true; $management = true; }else { $filemanager = false; $management = false; $errorhandler .= "You have attempted to upload the wrong file type<br />"; $errorhandler .= "We only accept mpeg, mpg, wav, avi, mid, jpg<br />"; $errorhandler .= "jpeg, pdf, txt, gif, and mp3 formats<br />"; $errorhandler .= "To request new file types email<br />"; $errorhandler .= "information@theyellowpagesnetwork.com"; } } } // Relative URL with desired folder name and the name of the file on the user's machineif ($management === true && $filemanager === true) { $newfile = "uploads/".basename($_FILES['file']['name']); $newfiletemp = "{$_FILES[file][tmp_name]}"; if (file_exists($newfile)) { $errorhandler .= "The file already exists"; $filemanager = false; } if($filemanager === true) { if (!move_uploaded_file($newfiletemp, $newfile)) { $errorhandler .= "The file was not moved properly"; $filemanager = false; $manager = false; } } }if ($filemanager === true || $manager === true) { $connect = mysql_connect("localhost", "#####", "######"); $select = mysql_select_db("funnyemailforwards"); if (!$connect && !$select) { $errorhandler .= "The database could not connect, or selected"; $management = false; $filemanager = false; } }if ($filemanager === true && $management === true) {$query = "SELECT * from fileinfo WHERE type = '" . implode("", $_POST['type']) . "' AND nameoffunny = '" . mysql_real_escape_string($_POST['name']) . "' AND keywords = '" . mysql_real_escape_string($_POST['keywords']) . "' AND funnyurl = '" . mysql_real_escape_string($newfile) . "' AND entrydate = '" . mysql_real_escape_string($dateinfo) . "'";$result = mysql_query($query);$matches = mysql_num_rows($result); if ($matches == 0) { $name = $_POST['name']; $name = strtolower($name); $name = str_replace(" ", "", $name);$inserter = "INSERT INTO fileinfo (type, nameoffunny, keywords, funnyurl, entrydate) VALUES ('" . implode("", $_POST['type']) . "', '" . mysql_real_escape_string($name) . "', '" . mysql_real_escape_string($_POST['keywords']) . "', '" . mysql_real_escape_string($newfile) . "', '" . mysql_real_escape_string($dateinfo) . "')"; if(mysql_query($inserter)){ $management = true; $filemanager = true; }else { $management = false; $filemanager = false; $errorhandler .= "The information was not inserted into the database properly"; echo mysql_error(); } } else { $filemanager = false; $managment = false; $errorhandler .= "The information was already in the database, could not complete"; } }if ($management === false || $filemanager === false) { echo "{$errorhandler}"; } else{ echo "Everything worked out smoothly"; } ?> There are some things that I don't understand in general about this after I finished with it.1. Which name is the one that is on the urllike http://www.funnyemailforwards.com/uploads/file.txtwhich name on here is the file.txt version, I know the name is what they put in on the form, I had someone modify my htaccess file, so now when someone goes to a 2nd level tier it directs them to display.phpa tier like www.funnyemailforwards.com/file/file.txtthe file.txt is the url I use, for instance if someone typed in something that doens't exist it returns file does not exist at this location. On the display page I have it cut away so it can process each type of file type <?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 in the database<br />";}/* 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]$/i", $funnyurl)){require_once("./includes/view_text.php");}elseif (preg_match("/[.jpg|.gif|.jpeg|.bmp|.tiff]$/i",$funnyurl)) {require_once("./includes/view_picture.php");}elseif (preg_match("/[.mov]$/i",$funnyurl)) {require_once("./includes/view_quicktime.php");}elseif (preg_match("/[.ram|.rm|.ra|.rpm]$/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]$/i",$funnyurl)) {require_once("./includes/view_windowsmedia.php");}elseif (preg_match("/[.swf|.swc|.flv]$/i",$funnyurl)) {require_once("./includes/view_flash.php");}else {echo "No file exists at this location";}?></body></html> Then on each file I have a place where it handles the appropriate file, based on the type, these are my handling pages, as includes. view windows media player type files <!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><!-- begin embedded WindowsMedia file... --> <div> <OBJECT id='mediaPlayer' width="320" height="285" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <param name='fileName' value="<?=$funnyurl?>"> <param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value="true"> <param name='showControls' value="true"> <param name='loop' value="true"> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285" src="<?=$funnyurl?>" autostart="true" designtimesp='5311' loop="true"> </EMBED> </OBJECT><br /> <!-- ...end embedded WindowsMedia file --> <!-- begin link to launch external media player... --> <a href="<?=$funnyurl?>" style='font-size: 85%;' target='_blank'>Launch in external player</a> <!-- ...end link to launch external media player... --> </div> <?php echo "<a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a>"; ?></body></html> Here is for viewing text <!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$file = file_get_contents($funnyurl);$file = nl2br($file);echo "$file";?> <?php echo "<a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a>"; ?><body></body></html> view real_media <!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><!-- begin embedded RealMedia file... --> <!-- begin video window... --> <div> <OBJECT id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width="320" height="240"> <param name='src' value="<?=$funnyurl?>"> <param name='autostart' value="true"> <param name='controls' value='imagewindow'> <param name='console' value='video'> <param name='loop' value="true"> <EMBED src="<?=$funnyurl?>" width="320" height="240" loop="true" type='audio/x-pn-realaudio-plugin' controls='imagewindow' console='video' autostart="true"> </EMBED> </OBJECT><br /> <!-- ...end video window --> <!-- begin control panel... --> <OBJECT id='rvocx' classid='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' width="320" height='30'> <param name='src' value="<?=$funnyurl?>"> <param name='autostart' value="true"> <param name='controls' value='ControlPanel'> <param name='console' value='video'> <EMBED src="<?=$funnyurl?>" width="320" height='30' controls='ControlPanel' type='audio/x-pn-realaudio-plugin' console='video' autostart="true"> </EMBED> </OBJECT><br /> <!-- ...end control panel --> <!-- ...end embedded RealMedia file --> <!-- begin link to launch external media player... --> <a href="http://servername/path/to/media.file" style='font-size: 85%;' target='_blank'>Launch in external player</a> <!-- ...end link to launch external media player... --> </div><br /> <?php echo "<a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a>"; ?></body></html> View Quicktime <!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> <!-- begin video window... --> <div> <OBJECT classid='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' width="320" height="255" codebase='http://www.apple.com/qtactivex/qtplugin.cab'> <param name='src' value="<?=$funnyurl?>"> <param name='autoplay' value="true"> <param name='controller' value="true"> <param name='loop' value="true"> <EMBED src="<?=$funnyurl?>" width="320" height="255" autoplay="true" controller="true" loop="true" pluginspage='http://www.apple.com/quicktime/download/'> </EMBED> </OBJECT> </div><br /> <!-- ...end embedded QuickTime file --> <?php echo "<a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a>"; ?></body></html> View Picture <!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><?phpecho '<img src="' . $funnyurl . '" />';?><a href="<?=$funnyurl?>"><?=$nameoffunny?></a></body></html> View Flash <!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><!-- begin embedded Flash file... --><div> <OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width="320" height="240"> <param name='movie' value="<?=$funnyurl?>"> <param name='quality' value="high"> <param name='bgcolor' value='#FFFFFF'> <param name='loop' value="true"> <EMBED src="<?=$funnyurl?>" quality='high' bgcolor='#FFFFFF' width="320" height="240" loop="true" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'> </EMBED> </OBJECT> </div><br /> <!-- ...end embedded Flash file --> <?php echo "<a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a>"; ?><body></body></html> And then I have my admin system.1. How is this for my first major script, is it good, I know the players, I got from a generator, but I modified them to match my needs.2. Is there something I left out security wise.3. I see there are multiple ways to append strings together, but I am wondering about something likeif there's a string that has quotation marks<form name="something" id="something"This is just an example, I can't append something in there without<?=$variable?>I don't want to use shorthand but when I try to use<?php echo $variable?> it doesn't workand ?php echo '$variable'?> returns errorsI am just asking in general because I need to figure this out for future projects4. In general was my first main completed, well not completed I am still doing a few things on it, like the admin page, and some db calls on the homepage, but overall is my first main project good, did I do pretty good for my first big programming project.5. Have I offended anyone on this forum at all so far, or annoyed anyone.6.Ok when I named the files there are basically 2 files nameson every script I places a variable like$site = "http://www.funnyemailforwards.com/apex/";Then the other file name in the db was "uploads/filename.ext";So I added those 2 variables together to gethttp://www.funnyemailforwards.com/apex/uploads/filename.extTHis made sure it always matched the proper destination, what I have as my primary name, the one that is used as links and always fed to the display .php is a name that they name it on the form, they pick name, and it's labeled in a variable called nameoffunnythat is what I use to call the information, but I don't understand where the funnyurl the /uploads/filename.ext I don't understand where the filename.ext comes from, I made the script it's there but how did it get there.7. How do I get a different name for each filename, I know that someguy gave me one, and I was looking at that but couldn't integrate it, and I was more of wondering, when someone enters the name int he form, if they enter the same name as another, I wanted to just add a 1-2-3-4-5 or whatever, at the end of it or something, but then I have the problem with the funnyurl, what if someone enters a file that is generally named like demon.awf for example, then someone else downloads the same filename 2-3 times, I think I haev that script to where if someone duplicated filename's like that it returns file already exists, I am pretty sure of that.8. Do my display pages, the pages you view the various content, do you think that those types of scripts will play the types of files I showed in display.php or are there smoe of them I should take out, or some I forgot to put in for one of the types.9. Is my script generally secure, or does anyone have tips on being more secure, or general security advice?10. I use dreamweaver, but I am always in code view, doing everything by hand, when I open a page that has object tags though, it asks me if I wnat to change them to browser safe tags, like embed, this confuses me as aspnetguy said embed was DEPrecated abject was not, so now I am wondering because even w3 said that embed was deprecated, why would dreamweaver 8 tell me that newer browsers may not be abel to use it, when I have the object tags, this severely confused me, it has been doing it for quite awhile now.Or when they made dreamweaver did they get the 2 tags mixed up.11. What are these things I keep seeing where I have my video playerstheclassidparam name12. With javascript what I was wondering one thing about, when some people do javascript they leave out comments, I know they should be there but I use<script type="text/javascript"><!-- code snippet here-->Should it be <!--code//-->What annoys me more than anything, just for an example is this<script type="text/javascript"><!-- hide from older browserscode--></script>sorry but that is just the most annoying thing I have ever seen, it just annoys me for some reason.13. Ok I have a question on the power of php, I had to use htaccess with information like IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*IndexIgnore *Options -IndexesDirectoryIndex index.php<Limit GET POST>order deny,allowdeny from allallow from all</Limit><Limit PUT DELETE>order deny,allowdeny from all</Limit>RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteRule (/.*) display.php What I don't understand is I was told you don't need htaccess to do this, but I have thought of hundreds of ways, and none are feasable, can someone give me 2-3 examples, of theoretical other ways of doing the same thing that was done with funnyemailforwards, without ever using htaccess.Just so I will understand more that php always has multiple paths to each need.14. Is htaccess worth learningI see it looks easy to understand, I went through tutorials, and I saw a lot, custom error messages, and a lot more.15. Why do someone create a php file without an extension.16. How does php still parse these files without extensions17. How do I set dreamweaver to be able to open these file types.Thanks for all of the help.
  15. Ok I made this <!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 // Connects to database$connect = mysql_connect("####", "####3", "######");$select = mysql_select_db("funnyemailforwards");$errorhandler = "";$management = true;if (!$connect || !$select) { $errorhandler = "The database could not connect, or was not selected<br />"; $management = false;}?> <?php // script to display information$result = mysql_query("SELECT * FROM fileinfo WHERE approval=0 ORDER BY entrydate ASC");echo "<form name=\"dataupdating\" action=\"approval.php\" method=\"post\">";while ($row = mysql_fetch_assoc($result)){extract($row);$date = date("m/d/y");$site = "http://www.funnyemailforwards.com/apex/";$funnyurl = $site . $funnyurl; echo "<ul>"; echo "<li><a href=" . '"' . $funnyurl . '"' . 'target="_blank">' . $nameoffunny . "</a></li>"; echo "<li>" . $date . "</li>"; echo "<li><input type=\"radio\" name=\"approve_{$row['id']}\" value=\"1\">Approve</li>"; echo "<li><input type=\"radio\" name=\"decline_{$row['id']}\" value=\"0\">Decline</li>"; echo "</ul>"; }echo "<input name=\"update\" type=\"submit\" value=\"Update Database\">";echo "</form>"; if ($errorhandler != "") { echo "$errorhandler"; $management = false;}?><?phpif (isset($_POST['update'])) {}?></body></html> This is what I have for my update query but it's not working.Also the date isn't posting right either, I pulled the date from a database as a unix time stamp so I could format it later.the lines of how it would look if (isset($body_POST['update])) {DELETE * FROM fileinfo WHERE decline_$row['id'];and then my file delete likeunlink($fileurl); // my file url is the full url http://www.funnyemailforwards.com/apex/uploads/filename.extand then to update I could have$update = "UPDATE approval FROM fileinfo WHERE accept_$row['id] VALUES (1);";mysql_query($update)} Is this somethign along the lines of how it would go.
  16. 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. <!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> 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?
  17. I used the following script pages for my includes on my display page. This should take care of everything<!-- begin embedded Flash file... --> <table border='0' cellpadding='0' align="center"> <tr><td> <OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width="320" height="240"> <param name='movie' value="<?=$funnyurl?>"> <param name='quality' value="high"> <param name='bgcolor' value='#FFFFFF'> <param name='loop' value="true"> <EMBED src="<?=$funnyurl?>" quality='high' bgcolor='#FFFFFF' width="320" height="240" loop="true" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'> </EMBED> </OBJECT> </td></tr> <!-- ...end embedded Flash file --> </table><a href="<?=$funnyurl?>"><?=$nameoffunny?></a>And a lot more. I did one for each and covered almost all of the file extensions I could think of
  18. Ah thank you, the $ situation worked perfectly, I also learnt something new about reg exps. Thanks for the help.
  19. I found some issues and fixed them but it's still having the same problem any advice <?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";}?>
  20. What am I doing wrong here $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";} http://www.funnyemailforwards.com/display.phpThe problem is currently, it shows a media player file it shouldn't were did I misformat my code?
  21. Actually I tried that, I will use that later, but it's a little too annoying to work with it using php variables, does anyone know what file types just the basic object tags support?
  22. That will help a lot but what file types are covered by Flash QuickTime Real Media Windows Media I really appreciate this link as well, this is going to be very helpful on this and other related projects, I really appreciate it, thanks, do you have any idea about what filetypes those cover.
  23. I am afraid to browse and pick up random filetypes, because of viruses, I am just wondeirng which ones you have tested these on before, or know for a fact, or just have a list somewhere, I have been googling all morning,
  24. I know it just played an mp3I am just wondering what types do you know this will play<object data="<?=$funnyurl?>" width="200" height="200"></object>What file types can I atleast safely say it will pick up and play, without problems.
  25. How, I just changed my tags to objectI am only creating one, and php will be feeding it variables, anykind of music, or video, I am just wondering which ones I can trust it to play.
×
×
  • Create New...