Jump to content

A JM

Members
  • Posts

    249
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

A JM's Achievements

Regular Member

Regular Member (3/5)

1

Reputation

  1. I have the following SQL executing on MySQL 5.6 and need a single statement solution or another solution on how to get a single recordset??? This is a working SQL statement with the following results. week cumulative_A cumulative_M cumulative_E cumulative_W 1 0 5 24 7 2 0 5 35 14 10 0 14 54 22 11 0 17 54 55 12 0 17 62 65 13 0 17 68 77 14 0 17 77 86 Essentially the SQL below executes in 2 statements, 1 for establishing variables and the other to populate them, my webpage isn't able to deal with that. Any ideas on how to address?? Thanks, SET @csumA:= @csumM:= @csumE:= @csumW:=0; select week, (@csumA := @csumA + A) as cumulative_A, (@csumM := @csumM + M) as cumulative_M, (@csumE := @csumE + E) as cumulative_E, (@csumW := @csumW + W) as cumulative_W from( SELECT WEEK(s.date) week, SUM(CASE WHEN s.user_id = 50 THEN s.points ELSE 0 END) AS A, SUM(CASE WHEN s.user_id = 51 THEN s.points ELSE 0 END) AS M, SUM(CASE WHEN s.user_id = 52 THEN s.points ELSE 0 END) AS E, SUM(CASE WHEN s.user_id = 53 THEN s.points ELSE 0 END) AS W FROM users u, scores s, league l WHERE u.user_id = s.user_id AND l.league_id = s.league_id and l.league_name = 'Sunday League' AND year(s.date) = YEAR(sysdate()) GROUP BY s.date ORDER BY s.date ASC) PTS;
  2. Yes, that is where I ended up since it was becoming difficult to rectify. I've modded the UploadHandler.php in the Jquery_File_Upload plugin its strange that it doesn't deal with those situations already. Many thanks for the input. AJM.
  3. Is there a better way to address file downloads? Maybe a jquery addin or something similar and sort of remove the php coding for the download by passing it the variables of the file, location, etc.? Just trying to remedy the problem with an alternate solution. Thanks for the insight. AJM,
  4. It seems to be tied to the down load somehow since the file name looks correct in the URL that is passed. In this cas I tried a simple .jpg that wen clicked is assumed to be a .wav file?? <?php $ID=stripslashes($_GET['recordid']); $file = $_GET['file']; // the absolute path to your directory storing your files. $path = '../claims/' . $ID . '/'; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=\"$file\""); header("Content-Description: File Transfer"); header('Accept-Ranges: bytes'); header('Content-Length: ' . filesize($file)); readfile($path.$file); ?>
  5. I didn't think to use them together..rawurlencode() or htmspecialcharacters()... duh! I'm still experiencing issues with it though (see attached) The 2nd file, seems to pass correctly to the download but then appears the "_". AJM, EDIT I've tried to break it up like this: $dir = dir($path); while($value = $dir->read()) { if($value != '.' && $value != '..') { $file = htmlspecialchars(rawurlencode($value), ENT_QUOTES); echo "<form method='post' action='"?><?php echo"' ><a href='/pages/download.php?file=$file&recordid=$claim_doc_folder'> $value </a></form>"; } }
  6. So digging further... ugh. I can accomodate for files with a single quote by using the following: $file = htmlspecialchars($value, ENT_QUOTES); However when the user clicks on the link to download the file the file name now has an "_" underscore in the name, from the GET() function? 2003 Baja 20_' Outlaw.pdf <?php $ID=stripslashes($_GET['recordid']); $file = $_GET['file']; // the absolute path to your directory storing your files. $path = '../claims/' . $ID . '/'; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=\"$file\""); header("Content-Description: File Transfer"); header('Accept-Ranges: bytes'); header('Content-Length: ' . filesize($file)); readfile($path.$file); ?>
  7. After further researching - the problem appears to be related to a filename that contains a single quote... I'm not sure how to create the URL to deal with that?
  8. requinex, Having a similar issue after I encapsulated the HTML attributes with quotes... seems like it should be working, thoughts? I'm still seeing the file name get truncated at spaces.. <?php //initialize the session if (!isset($_SESSION)) { session_start(); } $doc_folder= $_SESSION['port_recordID']; //variable comes from detail page only used to carry claimnumber $path = "../claims/" . $doc_folder . "/"; $dir = dir($path); while($file = $dir->read()) { if($file != '.' && $file != '..') { echo "<a href='/pages/download.php?file=$file&recordid=$doc_folder'> $file </a>"; } } ?>
  9. I found the answer to my issues in that have multiple php tags that need to be combined and they had a blank line in between them, ugh!!!! http://www.tech-recipes.com/rx/1489/solve-php-error-cannot-modify-header-information-headers-already-sent/ Many thanks for the suggestions and assistance. AJM,
  10. The offending code does not have any echo or print functions within it but there is some echo'ing going on in some of the JavaScript.. I've removed the offending echo() from the javascript section and tried the page again but still get the same error, I'm confused on how to track this down. The form is posting correctly as the data is written as designed I just can't get it past the header() redirect. Is there an alternative on how to track down where the offending code is?
  11. Is that output to the user or submitted to the DB? Just not 100% on what "output" is referring to.. Thanks,
  12. I'm having a problem solving the following problem that I am having with the Submittal of a form. After the Submit button I am inserting records into a database and then wanting to redirect to a confirmation page but I'm getting the following error and am not sure how to resolve the problem. Any suggestions of ideas I can follow? Thanks. AJM, Warning: Cannot modify header information - headers already sent by (output started at /home/content/91/4761691/html/pages/claim.php:82) in /home/content/91/4761691/html/pages/claim.php on line 226
  13. Many thanks for the help, that resolved the problem. Can you elaborate on the security issue and how the htmlspecialchars() functions aleviates the problem? AJM,
×
×
  • 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.