Jump to content

tpimental

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tpimental's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm guessing there is a problem with your PHP code parsing your results. It seems anything that would return multiple results fails (displays no results). Searing for the word "on" which is in every name on your site also fails.
  2. This isn't very clean either, but you could auto-refresh the form page every time it loads with either JavaScript or PHP. That would ensure the fields were empty.
  3. You all were right. I haven't completely figured it out yet, but it's definitely a style/layout issue. Sorry for the confusion.
  4. Let me explain the page a bit more. $report_id is pulled from the querystring and is used to call a database with more than 100 value name/value pairs which are displayed using parse_str() in the included files. The included files are simply large table formatted forms. The pages render fine in both IE and FF on the page, but when I try to send them to my printer or print preview in IE, I lose everything within the included files.
  5. The strange thing is that it works fine in FF. Any way, here's some code. Let me know if anything stands out at you. <h2>View Report</h2> <form> <input type="button" value="Print This Page" onClick="window.print()" /> </form> <div class="print"><a href="<?php echo $_SERVER['REQUEST_URI']; ?>" onClick="window.print();return false">Print Report <img src="images/print.png"></a></div> <form> <?php $reports_data= $db->get_results("select value_name,value from report_data where report_id=$report_id"); foreach ( $reports_data as $data ) { // Access data using object syntax $str.=$data->value_name."=".stripslashes($data->value)."&"; }; echo parse_str($str); if ($report_type == 'inspection_report') { include 'view-inspection_report.php'; } elseif ($report_type == 'valve_test') { include 'view-valve_test.php'; } elseif ($report_type == 'dry_pipe_valve_test') { include 'view-dry_pipe_valve_test.php'; } elseif ($report_type == 'fire_pump_test') { include 'view-fire_pump_test.php'; } ?> </form>
  6. I searched high and low for others experiencing this problem, but it must be rare (or the fact that "print" can mean a lot of things in PHP is f-ing up my searches). At any rate, I have a "printer friendly" version of a page that includes a file based on a querystring. This all works fine in FF, but when I go to print the page only the header and footer appear on the printed page (or in IE's print preview). Has anyone run into something like this?
  7. If the table doesn't appear then there's something wrong with your SQL query or connection. We'd probably need more info then to help you out.
  8. This should do it: <?php echo substr("Hello world!",4); //replace Hello World with your variable ?>
  9. When I added the code, nothing comes up which I assume means the file isn't being loaded. I'm still stuck, because files with less than 748 rows does spit out results, but more than that doesn't.
  10. Thanks for the tip hitman, but I get the same error with your code. I'm 99% sure the problem is with the fopen call, because if I add an IF statement around the fopen, it stops there. For example: <?php if(!$handle = fopen($file, "r")) { echo 'Error: could not open file'; die; } ?> The error prints out and the script dies. But I'm completely open to suggestions. Thanks!
  11. I think you just need some parenthesis in your logic... try something like this: $result = mysql_query("SELECT * FROM employer_posts WHERE (title like " . "'%$title%'" . "OR description like " . "'%$title%'" . ") AND category=" . "'$category'" . "");
  12. I've got an interesting issue happening. I get the following error when uploading a CSV file with more than 748 rows: Here's the code: $handle = fopen($file, "r"); while (($data = fgetcsv($handle, 10000, ",")) !== FALSE) { //<--this is row 33, but the error is occurring with the fopen if ($rowcnt != 1) { if ($data[7] == "") { $data7 = date("Y-m-d H:i:s",strtotime($inspectDate)); } else { $data7 = date("Y-m-d H:i:s",strtotime($data[7])); } $query = "INSERT INTO reportdevices VALUES( $data[0], '$data[6]', '$data[8]', '$data7', $_GET[reportID] );"; $errnct = 0; if ($data[6] != "") { //skip blank rows (rows without pass/fail) $db->query("$query"); } else { $devcnt--; } } $rowcnt++; $devcnt++; } Here's a sample row from a CSV file: 16424,1000894,TS,13 fl. Stair 1 closet,476,1,p This is so strange, because I can upload all the CSV files I want as long as there are less than 748 rows. My first guess was this was a php.ini issue, but a 748 row CSV file is about 30K... go up to 1000 rows and its a whopping 60k... not even close to my upload limits. Any thoughts? This one is really starting to tick me off.
×
×
  • 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.