Jump to content

KillGorack

Members
  • Content Count

    57
  • Joined

  • Last visited

Community Reputation

1 Neutral

About KillGorack

  • Rank
    Regular Member
  • Birthday 11/22/1970

Profile Information

  • Gender
    Male
  1. I'm good gotta use NPM, not composer.. ;0)
  2. Thanks, I figured that was the case, just wanted to be sure. I have in the past worked with x3dom similar to that tut, just wanted info on getting composer to download that as well. From bash; dave@dave-main:/var/www/html/PX5$ composer install Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - The requested package components/x3dom could not be found in any version, there may be a typo in the package name. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. - It's a private package and you forgot to add a custom repository to find it Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
  3. Quick question about the dependency manager Composer with PHP. I have it installed and am pulling in a few libraries, it works pretty well as far as I can tell. I have a question that might be dumb, so I apologize in advance. When connecting to your application it's still required to use the lines similar to the following? <script src="vendor/components/jquery/jquery.min.js"></script> <link rel="stylesheet" href="vendor/twbs/bootstrap/dist/css/bootstrap.css" > Also I'm trying to figure out how to install the x3dom library, but cannot get composer to do it. (https://www.x3dom.org/)
  4. Securing my upload folder “upl” The upl folder is used to store anything that is uploaded by the user for their needs that is not a part of the back end, as such all content in this folder is subject to being locked down and and supplied after checking credentials. The upl folder has an .htaccess file that locks down all remote access. order deny,allow deny from all When something is needed from this directory we jump that wall with the help of apache after credentials are verified. I think this is straight forward so far. For images something like; <img src=”downloader.php?app=1&id=20&type=thumb”> For files something like; <a href=”downloader.php?app=1&id=20&type=file&fileid=1212”> After we check creds, we use similar to below to get data from that locked down folder. $size = filesize($file); header ( 'Content-Description: File Transfer' ); header("Content-Type: application/force-download"); header ( 'Content-Type: application/octet-stream' ); header ( "Content-Disposition: attachment; filename=\"".basename($file)."\""); header ( 'Expires: 0' ); header ( 'Cache-Control: must-revalidate' ); header ( 'Pragma: public' ); header ( 'Content-Length: ' . filesize ( $file ) ); ob_clean(); flush(); readfile ( $file ); exit(); seems to work pretty swimmingly for the most part. My problem is (or at lease a mild nuisance) is that it seems that these images loaded in this manner are not subject to the cache system of a browser? It looks like they reload every time a page is visited. Is there a way around this?
  5. Still not driven to conclusion; I have TWO scenarios. #1 session_set_cookie_params( 300, "/; SameSite=Strict", ".killgorack.com", true, true ); session_start(); Through www.immuniweb.com it seems the stuff is set correctly on production(php 7.3.5) server. I get no errors on the production(php 7.3.5) server I stay logged in after initial form post for login on production(php 7.3.5) server I DO NOT stay logged in after initial form post for login on development(php 7.3.3) server (localhost) #2 session_start(); session_set_cookie_params( 300, "/; SameSite=Strict", ".killgorack.com", true, true ); Through www.immuniweb.com it seems the stuff is NOT setup correctly on production(php 7.3.5) server I get errors on the production(php 7.3.5) server I stay logged in after initial form post for login on production(php 7.3.5) server I stay logged in after initial form post for login on development(php 7.3.3) server (localhost)
  6. Also I'm getting an error when I change the order as you've suggested. Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in C:\xampp\htdocs\portal-x\inc\ses.php on line 12 I'll fiddle with it, once I've changed the urls it seems to be working. I'll have to add this file to gitignore, and keep a local file different than production once I have it working.
  7. Yea thanks, also it's a really dumb mistake.. I don't change the URLS of the website from dev to prod.. I think these are the issue. Always 30 seconds after I post..
  8. I have issues with a user being logged in and staying logged in, When logging in I create these $_SESSION variables Array ( [usr_login] => username [usr_fname] => first [usr_lname] => last [usr_email] => email [ses_usrid] => 1 [loggdin] => Yes [loginremember] => ) And after login it looks great till I refresh the page or go anywhere else on the site. All variables above are gone. Consequently, this works with no issues on the prod server, just not on my machine. Code I've been playing with since it started, specifically the setting of the cookie. (this code runs before anything else) // ================================================================= // Sesssion start // ================================================================= session_set_cookie_params( 0, "/; SameSite=Strict", ".killgorack.com", true, true ); session_start(); // ================================================================= // Security stuff // ================================================================= header("strict-transport-security: max-age=31536000"); header('X-Frame-Options: sameorigin'); header("X-XSS-Protection: 1; mode=block"); header('X-Content-Type-Options: nosniff'); header("Content-Security-Policy: default-src BLA BLA BLA "); header("Feature-Policy: vibrate 'none'"); header("Referrer-Policy: no-referrer"); header("Access-Control-Allow-Origin: https://www.MYWEBSITE.com/"); header("Expect-CT: max-age=86400, enforce"); header_remove("X-Powered-By"); // ================================================================= Any ideas?
  9. I have a working solution, this seems to work.. From <script type="text/javascript"> $(document).ready(function() { $("#show_pop_message").fancybox().trigger('click'); }); </script> To <script type=\"text/javascript\"> window.jQuery(document).ready(function() { $.fancybox.open('#show_pop_message'); }); </script>
  10. Working with some older php code, and Fancybox 2.1.5 We moved to getting js/css from CDNJS using: <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js" integrity="bla bla bla" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.css" integrity="bla bla bla" crossorigin="anonymous" /> Now the links within the fancy box, seems to be reloading the box again instead of following the link. I pretty sure it's a version issue, just cant get it to work.. <?php if(isset($pop)){ if($pop['shw'] == true){ //======================================================== // A message with a forward button ot two //======================================================== if($pop['typ'] == "MsgFwd"){ echo "<script type=\"text/javascript\">"; echo "$(document).ready(function() {"; echo "$(\"#show_pop_message\").fancybox().trigger('click');"; echo "});"; echo "</script>"; echo "<div id=\"show_pop_message\" style=\"display:none;\">"; echo "<div class=\"cont_login\">"; echo "<table cellpadding=\"2\" width=\"100%\" border=\"0\" cellspacing=\"0\">"; echo "<tr>"; echo "<td colspan=\"2\"><div class=\"text5\">".$pop['ttl']."</div></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"2\"><hr class=\"allform_div\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td style=\"vertical-align: text-top;\"><img src=\"".$pop['ico']."\" style=\"margin-right:10px;\"></td>"; echo "<td><div class=\"text7\">".$pop['msg']."</div></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"2\"><hr class=\"allform_div\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><div class=\"text6\" style=\"text-align:left;\">".$pop['nte']."</div></td>"; echo "<td align=\"right\">"; echo "<a href=\"".$pop['fwda']."\" id=\"NULL\"><img src=\"".$pop['btna']."\" style=\"margin-bottom:-5px; text-align:right;\"></a>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "</div>"; //======================================================== // Just a message (Ok and it goes away) //======================================================== }elseif($pop['typ'] == "MsgOk"){ echo "<script type=\"text/javascript\">"; echo "window.jQuery(document).ready(function() {"; echo "$.fancybox.open('#unlnkForm');"; echo "});"; echo "$(':button').click(function() {"; echo "parent.$.fancybox.close();"; echo "})"; echo "</script>"; echo "<div id=\"unlnkForm\" style=\"display:none;\">"; echo "<div class=\"cont_login\">"; echo "<table cellpadding=\"2\" width=\"100%\" border=\"0\" cellspacing=\"0\">"; echo "<tr>"; echo "<td colspan=\"2\"><div class=\"text5\">".$pop['ttl']."</div></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"2\"><hr class=\"allform_div\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><img src=\"".$pop['ico']."\" style=\"margin-right:10px;\"></td>"; echo "<td><div class=\"text7\">".$pop['msg']."</div></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=\"2\"><hr class=\"allform_div\"></td>"; echo "</tr>"; echo "<tr>"; echo "<td><div class=\"text6\" style=\"text-align:left;\">".$pop['nte']."</div></td>"; echo "<td align=\"right\">"; echo "<a href=\"javascript:parent.$.fancybox.close();\"><img src=\"".$pop['btna']."\" style=\"margin-bottom:-5px; text-align:right;\"></a>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</div>"; echo "</div>"; } //======================================================== } } ?> using that mess up there with: $pop = array( "shw" => true, "typ" => "MsgFwd", "ttl" => "Success!", "msg" => "Thanks your changes have been made, please press the OK button below.", "ico" => "sty/img/ico/alert.png", "nte" => "", "fwda" => $lnk, "btna" => "sty/img/btn/ok.png" ); Any ideas on how to get the links within the box to work?
  11. I have to get my head around this but it seems SQL has some counting functionality. The code below works, 113 is the current ID we're looking at and the sql below will give previous, and next as well. From a coworker; WITH numberlist AS (SELECT ID, row_number() OVER (ORDER BY trk_airdate ASC) as RN from startrek) SELECT numberlist.* FROM numberlist WHERE RN IN (SELECT RN + i FROM numberlist CROSS JOIN (SELECT -1 AS i UNION ALL SELECT 0 UNION ALL SELECT 1) n WHERE ID = 113) ORDER BY RN wonderful
  12. I like this solution, but reordering the table isn't possible in my situation Even in this example data we have overlapping dates, which could cause skipping records? I will test this to be sure. <Off topic> In the early 90's DS9, and TNG aired at the same time, Then later in the same decade Voyager, and DS9 overlapped. </Off topic>
  13. SQL is made up below, but I have something similar sorted by dates, and NOT by ID. Currently I get this done by getting all the ID's in an array ordered by date and gleaning the two record ID's from that array. if the table is huge, that might not be the best way. Just seems like there should be an easier way to do it. Any ideas? Select startrek.ID, optc.opt_value as trk_series_id, optc.ID as trk_series_idID, startrek.trk_title, startrek.trk_episode, startrek.trk_season, startrek.trk_airdate, startrek.trk_stardate FROM startrek JOIN opt optc ON optc.ID = startrek.trk_series_id ORDER BY trk_airdate ASC
  14. current code, a little better function sec_diff_time($s, $e){ if(!validateDate($s, "H:i:s") or !validateDate($e, "H:i:s")){ return false; }else{ $secsday = 86400; if(strtotime($s) <= strtotime($e)){ $secs = strtotime($e) - strtotime($s); }else{ $secs = (strtotime($e) + $secsday) - strtotime($s); } return $secs; } }
  15. Hi, Trying to figure out a way to get a time difference between two times assuming they are in order.. For example; in the array below the days is easy.. because the time happens later, however nights it becomes a little more confusing. The method I'm using now is; if the dates are in order just stick a reference date on there, and get a difference. If they seem to be reversed, I stick a reference date on the first one and a reference date +1 days on the second and get the difference. Can you all think of a better way? I will use the assumption that the times will NEVER be more than 24 hrs apart.. Array ( [2] => Array ( [days] => Array ( [0] => 07:00:00 [1] => 15:45:00 ) [nights] => Array ( [0] => 15:30:00 [1] => 02:15:00 ) )
×
×
  • 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.