Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Well, you need to work on that. As for your code - kind of odd looking. All of your "images" code is in ONE list element tag?
  2. So - what have you tried??? Have you downloaded lightbox and read the docs and TRIED to use it???
  3. Deprecated! Deprecated. Say it 3 times fast. In a way MySQL is "depreciated" or ever under-appreciated but the true term for what has happened to the interface is "deprecated'. To quote that well-known mantra - "there is no I in deprecated".
  4. I won't shout - you're doing good. Ok - don't know why the browsers are so different for you. I have tried the code below EXACTLY as I've posted it in IE10, Safari, and Chrome - all on my PC. They all work mostly as expected. The only problem is that Chrome seems to position my pdf way off center inside the div/object area - but at least it displays it. Here's the code. Do this as an experiment. Simply provide a pdf filename to the $filename var in my code and upload it to your site and use this as a simple test of "showing pdf and html" in a webpage. Don't worry about reading the table and getting the name for now. This is just a test. If it works for you then you can build your real logic into it. <?php $filename = "firehouse_ad_hvvfa_sample1.pdf"; $code=<<<heredocs <!DOCTYPE html> <html> <head> <title>pdf in a page</title> <style type='text/css'> #pdf { position:relative; float:left; width: 300px; height: 300px; margin: 1%; // border: 2px solid red; } #pdf p { padding: 10px; } #pdf object { display: block; border: solid 3px red; } </style> </head> <body> <!-- begin DIV to hold the PDF --> <!-- begin DIV to hold the PDF --> <!-- begin DIV to hold the PDF --> <center> Version 5 <form method='POST'> Click here to close this and go back <input type='submit' name='btn' value='Return'> </form> </center> <br><br> <div id="pdf"> heredocs; echo $code; echo "<object data='" .$filename . "#scrollbar=1' type='application/pdf' width='100%' height='100%'><p>It appears you don't have a PDF plugin for this browser. No biggie... you can <a href='$filename'>click here to download the PDF file.</a></p></object>"; //toolbar=1&navpanes=0& echo "</div></body></html>"; exit(); Good luck!
  5. I said to remove 'tags' - so remove the other one also. What's this about about 'no pdf reader'? You never mentioned that before. You said your pdf took over the whole page. Now you're telling me that you aren't seeing the pdf at all? When you've made all my suggested changes (headers out; file reading prior to html coding; checking for errors when reading the file) please post your complete code again.
  6. Remove the header tags Stop suppressing errors (@) on your commands. If there IS and error, don't you want to KNOW about it???
  7. You HAVE no html. Just the div with the pdf in it. ps - read the pdf file into a var BEFORE you begin your html and check that it read ok. Then just place that var into the object tag.
  8. You begin by looking in your db for a certain numbered value. You don't bother to check if your query ran successfully though, nor do you even check if you had any rows returned before retrieving the first row. (Bad practice!). But then it gets weird. Assuming that you get rows back (more than 1) you echo out messages that say your search argument was found AND that successive ones were found EVEN THOUGH YOUR QUERY COULDN'T POSSIBLY HAVE RETURNED ANYTHING BUT THE FIRST ONE. PS - I'd turn on php error checking to ensure you're not doing something wrong with that echo message. Also - you are incrementing $number as if it is a number when you keep making it a string.
  9. Add this right after the query call and before the fetch call: if (!$result) { echo "Query did not run - ".MySQL_error(); exit(); } I really don't like your where clause. Didn't know you could use a select as the object of an 'in' clause
  10. Prove to yourself that the value you are using to open the file has something in it - add an echo of $_FILES['file']['tmp_name'] PS - you should ALWAYS check the results of a query or a file open command to ensure that it was successful.. If you had done that here you would have only shown that one error.
  11. If you had posted the code, we could see it. Some of us don't click on links that we are unfamiliar with.
  12. How about using google? I found this in about 2 minutes. some css to size the div that will hold the pdf image #pdf { width: 50%; height: 300px; margin: 2em auto; border: 2px solid red; } #pdf p { padding: 1em; } #pdf object { display: block; border: solid 1px yellow; } Here is the html that displays the pdf image <center> <form method='POST'> Click here to close this to back <input type='submit' name='btn' value='Return'> </form> </center> <br><br> <!-- begin DIV to hold the PDF --> <!-- begin DIV to hold the PDF --> <!-- begin DIV to hold the PDF --> <div id="pdf"> <object data="firehouse_ad_hvvfa_sample1.pdf#toolbar=1&navpanes=0&scrollbar=1&page=1&view=FitH" type="application/pdf" width="100%" height="100%"> <p>It appears you don't have a PDF plugin for this browser. No biggie... you can <a href="firehouse_ad_hvvfa_sample1.pdf">click here to download the PDF file.</a></p> </object> </div> <!-- end DIV --> Obviously you will have to code something to handle your 'return' or 'close' button, but this works for me.
  13. What evidence do you have for us that things are not happening? ps - I have seen some posts somewhere that suggest that your header is malformed. Try: header("Location: with a space after the colon and then the address you want.
  14. Not even close. I want to see what gets echoed out from your query statement when you add this line: echo $query_question; // ADD THIS LINE RIGHT HERE AND THEN PASTE THE OUTPUT TO THE FORUM. $question_info=mysql_fetch_array($query_question);
  15. echo out the query statement before you try and run it so that we can see the ACTUAL query being submitted. BTW - please tell us what you refer to 'question number displayed'.
  16. index names should have quotes on them. Plus - one should ALWAYS check (!) the results of a query to be sure it actually ran. Add this: if (!$query) { echo "Query did not run - error msg is: ".MySQL_error(); exit(); } after your call to MySQL_query. PS - you REALLY should use a different interface to your db, The MySQL_* functions have been deprecated (not depreciated) and are soon to be removed. Start learning mysqlI or PDO and use it.
  17. 1 - use the code tags as described in the forum's rules. They are the little <> icon in the editor menu or simply code and /code wrapped in brackets. 2 - you can't compare a string (which $end is) to a date value (which $now is). Try: $end = strtotime('04:15:00 PM'); 3 - your table names are dates? Really? There may be more but those two things are a start
  18. What is that last 'thing' in your query statement? I've never seen an index like that! Try adding a test of your query result - I find it hard to believe that your query is actually producing anything.
  19. What is the outbounding box? You have a set of image dims; you have the dims of the text box from above. What is this 'outbounding box'? It would seem that the height of your text box is simply index 7 less index 1 since you have a square text box (angle=0?). Then you have the vertical midpoint of your image already, so half of the text box height from that midpoint is the starting point for your text box, no? I've never done this but from reading the manual just now, it seems simple. Can you show us more of your code, specifically how you display the text?
  20. Do you really think WE can figure out what YOU are doing with this code? What do the values you are supplying represent? And what do you do with the value you arrive at? More importantly, once you have this "height" value, how do you decide where to place the element? So much missing...
  21. THAT'S BECAUSE YOU HAVEN'T LISTENED TO ME! You have to add a line after the query checking it for an error. (run the query) $result = mysqli_query($con,$query); (test the query ran) if (!$result) { echo "Query failed to run - error message is: ".MySQL_error(); exit(); } // now fetch the results since YOU ARE SURE it ran ok
  22. I believe you have to say it longhand : Price <= $maxprice and Price >= $minprice
  23. Your where clause is close. Don't you want to check <= maxprice and >= minprice? Anyway - you need to add a check of your query execution before attempting to read the results. look up MySQL_error() function
  24. I think I just need to see where you build your query statement and run your query
×
×
  • 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.