Jump to content

kwdrysdale

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Everything posted by kwdrysdale

  1. Sorry folks. I just figured out my problem. I was trying my link on an old file (so none of our members would have any problems) that did not have any apostrophe ( ' ) characters. Then when trying it on a newer file, that had an apostrophe, it would not work proper. I'll just have to remember not to use any special characters in my filenames.
  2. A direct link to the MP3 will open a new window and (for me) play the file in QuickTime. Others it may play in WindowsMedia, RealPlayer, etc. If I use force_download.php it will bring up the save dialog and download direct to the users computer rather than stream the media.
  3. not the <enclosure> tag, inside the <link> tags.
  4. I am using a web-based media player to play my podcast.xml file. Everything works great except for one tiny issue. There is a clickable link that is supposed to allow the user to download the audio file to their computer. Well...when the user clicks the link it opens a new window and then plays the audio file with whatever program the person has setup to play mp3 files. My goal is to use a force download script to bypass the users mp3 player of choice and save the file to their computer. If I try my PHP script directly on a webpage everything works fine. The problem is when I try to take that exact same link and use it in my podcast.xml file. If anyone is able to help with a solution it would be greatly appreciated. I will post the code I am using for the force_download.php as well as the podcast.xml: force_download.php: <?php // get the file url from querystring $filename = realpath($_GET['file']); // Error: only files that are in a subdir of this script can be downloaded $current_dir = dirname(realpath($_SERVER['SCRIPT_FILENAME'])); if($current_dir != substr(dirname($filename), 0, strlen($current_dir))) { die( "The requested file cannot be retrieved for security 1 reasons."); } // Error: PHP files cannot be downloaded if(strToLower(substr($filename,strlen($filename)-3, 3) == 'php')) { die( "The requested file cannot be retrieved for security reasons."); } // Error: file is not found if(!file_exists($filename)) { die("The requested file could not be found"); } // required for IE, otherwise Content-disposition is ignored if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); } // build file headers header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // header for the content type $ext = strToLower(substr($filename,strlen($filename)-3, 3)); if ($ext == "mp3" ) { header("Content-Type: audio/x-mp3"); } else if ($ext == "jpg") { header("Content-Type: image/jpeg"); } else if ($ext == "gif") { header("Content-Type: image/gif"); } else if ($ext == "png") { header("Content-Type: image/png"); } else if ($ext == "swf") { header("Content-Type: application/x-shockwave-flash"); } else if ($ext == "flv") { header("Content-Type: video/flv"); } // and some more headers header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); // refer to file and exit readfile("$filename"); exit(); ?> podcast.xml <?xml version="1.0" encoding="UTF-8"?> <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> <channel> <title>Solid Rock Ministries Podcast</title> <description>The best way to stay up to date with all the current messages from SRM!</description> <link>http://www.solidrockministries-mb.ca</link> <language>en-us</language> <copyright>Copyright 2008</copyright> <lastBuildDate>Thur, 1 Jan 2009 13:37</lastBuildDate> <pubDate>Wed, 31 Dec 2008 16:22</pubDate> <docs></docs> <webMaster>kmdrysdale@shaw.ca</webMaster> <item> <title>Wed Dec 31/08 - New Year's Eve</title> <link>force_download.php?file=mp3/125-Wed Dec 31, 2008-New Year's Eve.mp3</link> <description>9 - Give an offering of worship to the Lord as we declare the new season.</description> <enclosure url="http://www.solidrockministries-mb.ca/mp3/125-Wed%20Dec%2031,%202008-New%20Year's%20Eve.mp3" length="57972888" type="audio/mpeg"/> <itunes:duration>2:41:02</itunes:duration> <category>Podcasts</category> <pubDate>Wed, 31 Dec 2008 19:30</pubDate> </item> <item> <title>Sun Dec 28/08 - Live in God's Season</title> <link>http://www.solidrockministries-mb.ca/mp3/124-Sun%20Dec%2028,%202008-Live%20in%20God's%20Season.mp3</link> <description>Pastor Dave shares more about our new season that we are in. Prepare yourself to live in God's season!</description> <enclosure url="http://www.solidrockministries-mb.ca/mp3/124-Sun%20Dec%2028,%202008-Live%20in%20God's%20Season.mp3" length="476705524" type="audio/mpeg"/> <itunes:duration>2:12:25</itunes:duration> <category>Podcasts</category> <pubDate>Sun, 28 Dec 2008 10:00</pubDate> </item> <item> <title>Sun Dec 21/08 - The New Season</title> <link>http://www.solidrockministries-mb.ca/mp3/123-Sun%20Dec 21,%202008-The%2New%20Season.mp3</link> <description>Pastor Dave shares more detail about the new season we are in and releases an opportunity to give on New Years Eve.</description> <enclosure url="http://www.solidrockministries-mb.ca/mp3/123-Sun%20Dec 21,%202008-The%2New%20Season.mp3" length="39222800" type="audio/mpeg"/> <itunes:duration>2:15:16</itunes:duration> <category>Podcasts</category> <pubDate>Sun, 21 Dec 2008 10:00</pubDate> </item> <item> <title>Wed Dec 17/08 - Ministry Gifts are Personal</title> <link>http://www.solidrockministries-mb.ca/mp3/122-Wed%20Dec%2017,%202008-Elder%20Al%20Drysdale-Ministry%20Gifts%20are%20Personal.mp3</link> <description>Elder Al Drysdale teaches us that God gave us each, individually, the ministry gifts that are placed over us.</description> <enclosure url="http://www.solidrockministries-mb.ca/mp3/122-Wed%20Dec%2017,%202008-Elder%20Al%20Drysdale-Ministry%20Gifts%20are%20Personal.mp3" length="24927480" type="audio/mpeg"/> <itunes:duration>1:30:16</itunes:duration> <category>Podcasts</category> <pubDate>Wed, 17 Dec 2008 19:30</pubDate> </item> </channel> </rss>
  5. I found a solution to my own problem. After reviewing the code some more, I saw similarities between the bottom part of the activex control and flash portions. I put part of the code below and marked in bold the portion that I added for anyone else that may have this problem.
  6. Ok. I have just made new javascript drop-down menus. They work fine, except I have one page that has a media player control in it. The menu goes behind the media player control. I know how to make flash transparent, but I was hoping there is a way to do the same thing to this control. I'll post the code for the media player: <object id="snd_1" name="snd_1" 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 Player...' type='application/x-oleobject' style="width:280px; height:44px;" > <param name='fileName' value="mp3/Righteousness Song.mp3"> <param name='animationatStart' value='true'> <param name='transparentatStart' value='true'> <param name='autoStart' value="false"> <param name='showControls' value="true"> <param name='loop' value="false"> <embed type='audio/mpeg' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id="snd_1" name="snd_1" style="width:280px; height:44px;" displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' src="mp3/Righteousness Song.mp3" autostart="false" designtimesp='5311' loop="false"> </embed> </object> Any help with this would be appreciated. Thanks. Kevin
  7. kwdrysdale

    Layers

    Thank you all so very much. I tried the z-index with no luck at all. The param method is the way to go and works like a charm - I think it is mainly because I had to go over flash. Thanks again, and I hope this will not cause any arguments between the 2 different solutions. Kevin
  8. kwdrysdale

    Layers

    I tried giving them a z-index and have the same problem. Are you meaning to give each div that contains the objects (script and flash file) a different z-index? Each div has an absolute position (in pixels). I will search for more information on z-index to make sure I am using it properly, but if there are any other suggestions out there that would be appreciated as well. Thanks. Kevin
  9. kwdrysdale

    Layers

    OK. I am working on a site with Serif WebPlus. It doesn't produce the nicest looking code, but that is fine with us - for now anyway. The issue I am having - our navbar is javascript and I have a calendar script that creates a flash file. The navbar drop-downs will only go behind the calendar flash file. Is there some way that I could get the navbar drop-downs to stay on TOP of the calendar flash file? The temp location for the page is: http://solidrockministries-mb.ca/hide2/srmcs_calendar.html Any advice on how to fix this would be appreciated. Thanks. Kevin
  10. Thank you for taking the time to test it. I was looking at my code at almost midnight and thought I found the problem, so I thought I would ask here and see if someone already knew the answer rather than staying up later. Thanks again.
  11. Ok...I know the "goal" is not to use tables for positioning, but it is the easiest way for me right now. My question is probably fairly simple, but here goes. Does the table alignment over-ride the <div> positioning? For instance, if my div is set to be in the center of the screen and I have <table align="left"> will the table break from the <div> ??? Hope that makes sense and thanks for any replies. Kevin
  12. I have tried searching this forum and google, but I can't seem to find anything that will teach me how to have an option to turn off the volume (by users option) of a flash file. I've seen it on different sites, but can't figure out how to do it. I have a flash file with music in it, but want the viewers to be able to turn the music off if they want to. Is there a way to do this? If so, is there any place online that I can learn how to do it? Thanks. Kevin
  13. I thought this code above would work flawlessly (it did as a section of code on the validator), but it still didn't like the <noscript> tag once everything was put together. So...I just dropped the javascript and am using the flashplayer object. Are there any benefits to keeping the javascript in the file? Kevin
  14. I figured it out. It was the <embed> tag that is no longer valid in xhtml. I searched all the tags in that section to see if I could find anything that would not work proper and found it. Works good. New code, for anyone interested is: <div id="InteriorHeader"> <a href="index.html"> <script type="text/javascript"> AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','400','height','200','title','d','src','flash/srm flash1','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/srm flash1' ); </script> <noscript> <object type="application/x-shockwave-flash" data="flash/srm flash1.swf" width="668" height="220"> <param name="movie" value="flash/srm flash1.swf" /> <param name="quality" value="high"/> </object> </noscript> </a> </div>
  15. As "requested" here is the entire <div> that contains the offending code: <div id="InteriorHeader"> <a href="index.html"> <script type="text/javascript"> AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','400','height','200','title','d','src','flash/srm flash1','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','flash/srm flash1' ); </script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="668" height="220" title="d"> <param name="movie" value="flash/srm flash1.swf" /> <param name="quality" value="high" /> <embed src="flash/srm flash1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="668" height="220"></embed> </object> </noscript> </a> </div>
  16. I have spent countless hours working on a site, and learning TONS of stuff about PHP, CSS and proper coding techniques. It's been a blast. Anyway...I am at a point where I was wanting to validate the html and make sure everything was 100%. I tried to validate the code at http://validator.w3.org/ and got errors in this section that I am not sure how to fix. <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="668" height="220" title="d"> <param name="movie" value="flash/srm flash1.swf" /> <param name="quality" value="high" /> <embed src="flash/srm flash1.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="668" height="220"></embed> </object> </noscript> I am using the following as my document type: <!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"> I think the biggest error, if there is a way around it, is the first one: Is there a way to fix this? What it is doing, is if someone has javascript turned off, the flash movie will still play, so it is using a flash plugin. OR...should I just do away with the javascript way of playing the movie and just use the object tag to use the plugin? Thanks for any advice you can give that will help me get this validated properly. Kevin
  17. Is there a reason it should be in that order? Just curious - totally new to CSS and want to learn the correct way first. Thanks Kevin
  18. A total newbie question here, but I know px and %, but what is em?? Would that be a better way for positioning, etc? Kevin
  19. The styles are inside the body tag, and I was already calling the external stylesheet in that format. My head is a little clearer now, so I'll post with a bit more detail. It kind of seems like these "common" tags have been defined somewhere else, but I can not find them, or how they would be effecting anything since I have specific styles defined for them inside the menu id. Here is the code I am using up until the flaws start: <!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>SRM Church Page</title> <meta name="description" content="PageDescription:1_Here" /> <meta name="keywords" content="PageKeywords:1_Here" /> <link rel="stylesheet" href="../includes/menuv.css" type="text/css" media="screen"/> <link rel="stylesheet" href="../includes/styles.css" type="text/css" media="all" /> <link rel="stylesheet" href="../includes/login.css" type="text/css" media="all" /> <link rel="stylesheet" href="../includes/sIFR-screen.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../includes/sIFR-print.css" type="text/css" media="print" /> <script src="../includes/sifr.js" type="text/javascript"></script> <script src="../includes/sifr-addons.js" type="text/javascript"></script> <? /* <script src="../includes/jscript.js" type="text/javascript"></script> */ ?> <style type="text/css"> <!-- .style3 { font-size: 12px} .style4 { font-family: Amery; font-size: 14px; color: #0000FF; } body,td,th { color: #FFFFFF; } body { background-color: #FF3300; background-image: url(../images/background.jpg); background-repeat: repeat; } .style5 { color: #FF6600; font-weight: bold; font-style: italic; font-family: Amery; font-size: larger; text-align: center; } .style10 { font-size: 24px; font-family: "Times New Roman", Times, serif; font-weight: bold; } .style16 { font-family: Amery; font-size: larger; } .style28 { font-family: Amery; font-size: 36px; color: #FF6600; } --> </style> <script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script> </head> <body> <div id="Page"> <img src="../images/flashBackground.jpg" width="710" height="97" /> <span class="style5">The Transformation of Christ's Glorious Church has Begun ... Enter in and Enjoy the Journey!</span> <div id="Date"> <p> <script type="text/javascript">document.write(getDate()); </script> </p> </div> <div id="menu"> <ul> <li><h2><a href="../index.html">SRM Home Page</a></h2></li> </ul> ....more menu options... if I copy the #menu h2 style info and make it .menu_title I can succesfully use: <li><span class="menu_title"><a href="../index.html">SRM Home Page</a></span></li> and it displays properly. body is defined as: html, body { margin: 0; padding: 0; width: 100%; text-align: center; background: #a18753 url(../images/pageBackground.gif) repeat-x; font: 12px Arial, Helvetica, sans-serif; page is defined as: margin: 0 auto; width: 710px; background-color: White; border-top: 20px #000000 solid; So...no defining of h2/ul/li tags before my menu div which has all that stuff defined within the css file. Any guesses why these tags seem to be ignored?
  20. Something strange is happening in my current attempt to use CSS pop out menus. I can make the simple design work when it is just by itself, but as soon as I take the CSS file and the html and place it in the webpage, it doesn't display everything properly. The big issues are the standard h2/ul/li tags. They don't act properly while inside the "menu" div. Is there a simple way to ensure that the menu style sheet will take priority over any other style sheets? I am using external files. I define the menu h2 tag like this: #menu h2{...style info...} Kind of lost trying to figure out why it won't work on my site. It is only inside the body tag, and one other div tag (which doesn't define h2/ul/li tags). Hopefully I am making sense - I'm a bit new to CSS terms. Any ideas?? Thanks Kevin
  21. I like this solution. I think it should be pretty easy to implement, since I should be able to add it at the beginning of all php files. It's amazing how much stuff there is to learn with all this!! Thanks. Kevin
  22. I don't have a solution to the problem as I have the exact same problem, and question. Is there some way to prevent full path disclosure? For the last post, what it is, where I have seen it anyway, is if there is an error message it will show the full path of where the file is that contains the error. This gives hackers more information about the server and your file structure. So...is there anyone out there willing to share how to prevent this? Thanks. Kevin
  23. Thank you for the help. It took a bit of thinking from your reply, but I did find there error. I was missing $mailer in this: global $session, $database, $form, $mailer; It is working like a charm now and I am VERY happy!!! Thanks again. Kevin
  24. Ok...I am so close to getting what I want I can almost taste it! First, I'll explain. I am working with an open source membership script. I have modified it to work with userlevels so that we have to manually approve each user that registers. When they register, it sends them an email telling them they successfully registered, but are not approved yet. When I approve them (from admin center) I was hoping to be able to have the 'approved' email sent automatically. Here is some snippets of what I have: form code from admin center to change userlevel: <table> <form action="adminprocess.php" method="POST"> <tr><td> Username:<br> <input type="text" name="upduser" maxlength="30" value="<? echo $form->value("upduser"); ?>"> </td> <td>Level:<br><select name="updlevel"><option value="1">1<option value="2">2<option value="9">9</select></td> <td> <br> <input type="hidden" name="subupdlevel" value="1"> <input type="submit" value="Update Level"> </td></tr> </form> </table> The code to update the userlevel (from adminprocess.php) in the database and HOPEFULLY send the email. All code before this was error checking to ensure the username entered matches a username in the database: $database->updateUserField($subuser, "userlevel", (int)$_POST['updlevel']); if($_POST['updlevel'] >= 2){ $uduinfo = $database->getUserInfo($_POST['upduser']); $udemail = $uduinfo['email']; $uduser = $uduinfo['fname']; $mailer->sendApproved($uduser,$udemail); } The getUserInfo code from database.php: function getUserInfo($username){ $q = "SELECT * FROM ".TBL_USERS." WHERE username = '$username'"; $result = mysql_query($q, $this->connection); /* Error occurred, return given name by default */ if(!$result || (mysql_numrows($result) < 1)){ return NULL; } /* Return result array */ $dbarray = mysql_fetch_array($result); return $dbarray; } When I try to make the userlevel 2 or greater, I get this error: and this is the offending line: $mailer->sendApproved($uduser,$udemail); Any suggestions on what should be changed to fix this problem? I am really new to PHP (like I think I say in every post) so I am hoping I posted enough of the code, and that it is a simple problem. Thanks for any help. Kevin
  25. I am new to php but I feel I am learning relatively quick, but not quick enough to sit down and actually write something from scratch yet. I am working on a website for my church and I would love to be able to incorporate something similar to what is used when people write comments about the tutorials. Is there a way to get the code for that so that I can customize it a bit for our site? I've searched forums here, and even tried to "view source" on the comments page, but can't get anything that would help me understand what is going on. So...here I am looking for something similar to the comments section of this site. Kevin
×
×
  • 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.