jonpugh114
Members-
Posts
12 -
Joined
-
Last visited
jonpugh114's Achievements
Newbie (1/14)
0
Reputation
-
Opening A Pdf In A Web Page
jonpugh114 replied to jonpugh114's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
Thanks for that, it looks like I might have to show the pages using images, which will make my life easier. Cheers, Jon -
Hello, I've been recently getting into OOP, and trying to put some classes together to speed up development. My next target is to simplify working with a database, especially when it comes to pagination. Has anyone got any suggestions of an approach I could use to simplify the whole process with compromising flexibility? Thanks, Jon
-
Hello, I'm trying to get into OOP and I'm putting together a class to create and validate form inputs/selects/textarea etc. The property I want to create is an array to hold errors. When a validation method fails to validate the posted input it will add an element to the array which is picked up by the method to create the input then add a class and an error message. What I'm stuck on is how to create a property as an array, and how to add elements to that array from within the class. Can anyone point me in the right direction? Maybe I should have started with "hello world"... Cheers, Jon
-
Force Download A Pdf
jonpugh114 replied to jonpugh114's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
Actually I've sorted it, I was calling the file in from another directory, I'm not entirely sure what the problem was but I resolved by placing the download script in the same directory as the PDF's. Thanks, Jon -
Force Download A Pdf
jonpugh114 replied to jonpugh114's topic in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
I've still got the same problem, the pdf downloads but it's either empty or corrupt. Any thoughts? -
Hello, I need to force download a PDF file instead of displaying it in the browser, any idea how I'd do this? This is what I've tried: $file = 'file.pdf'; header('Content-type: application/pdf'); header ("Content-type: octet/stream"); header ("Content-disposition: attachment; filename=".$file.";"); header("Content-Length: ".filesize($file)); readfile($file); exit; This appears to force the download, but when I try to open it I'm told that it's either empty or can't be read. Any ideas? Thanks, Jon
-
The query seems to work, I've tested it and it has returned results as expected. Regarding the database design, the search is for the whole site, and users would be looking for page content along side category/product information. I'm sure that I could (or maybe should) have designed the database so that all content occupies it's own table and I'll bear that in mind next time it comes up. Thanks, Jon
-
Hello, I need to set up fulltext searching using three tables, I can do it fairly easily with one table but I'm struggling with this problem. I was thinking that if it can't be done using a single query, maybe I could do separate queries for each table and try to return a numerical relevance score, which would allow me to merge the results. Can anyone point me in the right direction? Thanks, Jon
-
Hello, I'm just using TinyMCE for the first time and I'm really impressed - except that I can't enable the image upload without parting with some cash for every site I use it on. Can anyone recommend any third party plugins, or make suggestions on how I could set something up myself? Cheers, Jon
-
Hello, I'm building a site for a villa where they will be taking online bookings, it's mostly straightforward but I'm trying to find the best way to calculate a different price for different seasons (calculated by the day), bearing in mind that one booking could straddle two seasons. Any ideas? Cheers, Jon