Jump to content

All Activity

This stream auto-updates

  1. Today
  2. You can only have one session at a time. Not sure what you are thinking of when you talk about 'ONE big session'. How's this? How do you know that the items saved in you session vars were tinkered with when you first saw them? You then compare them to the latest version of your post data and they might be wrong already.
  3. To prevent misuse on some $_GET and $_POST pages, I use sessions to make sure Get, Post, and other variables aren't monkeyed with. Example: if($_SESSION["ordernumber"] !== $_POST["ordernumber"]) { exit(header("location:goAwayHacker.com")); } When I reviewed my final code, I've used lots of individual sessions to do the checks-and-balances: e.g. $_SESSION["ordernumber"], $_SESSION["userid"], $_SESSION["sku_numbers"], $_SESSION["date"], $_SESSION["this"], $_SESSION["that"], $_SESSION["etc"] Question: Would having just ONE big session as an array containing all the aforementioned sessions be equally secure? Does having one big session as an array make PHP work harder and slow things down? $_SESSION["security"] = array( 'ordernumber' => '1234', 'userid' => 'MyDogRover', etc. etc. etc..... So, for example, instead of if($_SESSION["ordernumber"] !== $_POST["ordernumber"]) { exit(header("location:goAwayHacker.com")); } ... I would do: if($_SESSION["security"]["ordernumber"] !== $_POST["ordernumber"]) { exit(header("location:goAwayHacker.com")); } Thank you.
  4. Whether it's padding or margin in this case doesn't really matter - the question could still be valid and of use to others. If you could explain a bit more fully what it is you're after and what you've tried we can all work to come to a solution that works regardless the target attribute.
  5. Dear Moderator, please delete this thread. I nothing less than bungled my question. I have never bungled a question before. This one is...... bungled. I meant "padding" when typing the word "margin." I did not mean "margin." Thank you.
  6. If you are talking about producing true 'monthly reports' for people who read reports all the time, fancy is not the way to do it. Yes - fancy looks nice on a web page but when you are showing people raw data it is best to have it in a clean simple format that makes it easy to examine and identify trends in columns of figures or whatever you are summarizing a month's worth of activity for. FPDF does a great job of letting you query some data and then produce organized tabular (or not) reports in a black and white (with maybe some accents of color) format for people who have to drill thru them regularly. Learning FPDF is simply a matter of laying out in your mind how you want to organize the data, recognizing the widths of the columns you will have and then creating a row of (what are called) cells wherein you place individual fields from your query. 1 - do a query to get 5 columns of data 2 - plan how wide each col needs to be 3 - begin a loop on the query results Then while($row = $qrslts(PDO::FETCH_ASSOC)) { echo "$pdf->cell($col1_w, $cell_h, {$row['col1'], 1, 0, 'L'); echo "$pdf->cell($col2_w, $cell_h, {$row['col2'], 1, 0, 'C'); echo "$pdf->cell($col3_w, $cell_h, {$row['col3'], 1, 0, 'C'); echo "$pdf->cell($col4_w, $cell_h, {$row['col4'], 1, 0, 'R'); echo "$pdf->cell($col5_w, $cell_h, {$row['col5'], 1, 1, 'R'); // jump to new line } This would put your query results into a well organized table structure having no borders. You can easily add the borders and modify the column widths by altering the values I have used. If you have data that is bigger than a simple column FPDF offers a 'mutlicell' function to allow the data to overflow into multiple rows. Takes a bit of practice but as you can see there really isn't a lot to it.
  7. Are you sure you have all of the values for the send? Nothing missing? Is your 'from' address set in those headers and does it belong to your domain?
  8. mail returns true or false, neither of which you check for.
  9. are there Any GOOD tutorials on PDFP & tables ? http://www.fpdf.org/en/tutorial/tuto5.htm I'm reading the above but its only got one type of data, (i'm looking at the fancy table) from what i see - it just extracts data from a file & inserts it into a data array. HOWEVER, i have data in this format:- Array ( [1] => Array ( [cats] => 12 [kittens] => 8 ) [3] => Array ( [cats] => 3 [kittens] => 1 ) [4] => Array ( [cats] => 2 [kittens] => 1 ) ) (thats just 1 month of data, I have 4-5 months to show so far. ) I HAVE managed to get my data into the correct format. However I have 4 header titles & 4 columns of data in my table - However they're not aligned with each other.. i'm modifying the widths of the columns to try to be underneath the titles - however shouldn't they auto-align ?
  10. I was being literal. The error message is "Error."
  11. If you're open to using a non-PHP solution, I find the easiest way to accomplish this task is to use NodeJS along with puppeteer. This uses an instances of chromium to generate the PDF and as such for the most part supports all the same HTML and CSS features as google chrome does. Essentially you get the same output you would if you used the 'Print to PDF' feature of chrome. I have a PHP class and simple Javascript script I've created that makes using it fairly simple.
  12. Got it going - Just testing. though it doesnt like normal HTML code (it displays the code instead of processing it).. I'll keep trying...
  13. Don't know. But you could google it. FPDF is a tool written to use php and a set of its own functions that generate cells that you define the size of and you can locate using an x/y grid on a page. Doesn't have a lot of font choices so if you have some fancy html you're gonna have to think about it.
  14. Thanks - I'll try it - HOWEVER i don't want to learn a complete new language (if i can)... my HTML templates already have the fonts etc all sorted.. I guess using this PDF - i need to set all the sizes/fonts etc manually Is there anything that will just convert HTMLoutput to PDF?
  15. And you want us to tell you ??? Would be nice if you told US what the error says.
  16. Why don't you use php to generate the pdf instead of producing html and then trying to convert it? FPDF is a pretty good tool for generating a pdf.
  17. Hello. I'm using PHP Smarty, and have generated HTML output. Now i'm trying to convert this into a PDF. (I've got a regular website up & running - just creating monthly reports in PDF). I've found dompdf and set it up, & have all the files correct, However I'm getting an error:- $sm="/home/users/MYPATYH/usr/dompdf/dompdf/vendor/dompdf/dompdf/lib"; ini_set('include_path',ini_get('include_path').":$sm"); Fatal error: Uncaught Error: Class 'DOMPDF' not found in Question:- WHICH file exactly, should be included in the directory, What file is being accessed for "DOMPDF"? can someone recommend a good PDF converter (I've got all the HTML output). with a step-by-step guide as to how to install it. 1) Download files 2) Upload files 3) find directory /usr/path/etc../ etc... 4) include "path to file" (this should be the path to file.php file... - (Exact filename its looking for) My current code is:- require ("/home/users/MYUSERPATH/usr/dompdf/dompdf/autoload.inc.php"); require ("/home/users/MYUSERPATH/usr/dompdf/dompdf/vendor/autoload.php"); $filename = "$file2/report-$dt.pdf"; $dompdf = new DOMPDF(); $dompdf->load_html($output); $dompdf->set_paper('a4', 'portrait'); $dompdf->render(); file_put_contents($filename, $dompdf->output()); ERROR- Fatal error: Uncaught Error: Class 'DOMPDF' not found in ......
  18. Hello, I have a PHP script intended to send an e-mail to someone. It works fine and everything, but throws an "Error" message. Even though it works. <?php $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; $mailheader = "From:".$name."<".$email.">\r\n"; $recipient = "some@emailaddress.net"; mail($recipient, $subject, $message, $mailheader) or die("Error!"); echo' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Contact form</title> <link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600&family=Poppins&display=swap" rel="stylesheet"> <link rel="stylesheet" href="style.css"> </head> </html> ';?>
  19. Yesterday
  20. it you post all this code on github, less any private settings, someone can have a look at it. things that were previously Deprecated and have been removed in php8 will be producing errors, though if the code is running to the point of producing output, they are at least non-fatal errors. if the code itself is setting the error related settings, anything you do to set them, might be overwritten. this looks like a typical misuse of OOP and from the small amount of actual posted logic, the author(s) misunderstood some of how php even works (the output buffering code in the redirect method does absolutely nothing.) this is a form to email application. are you using multiple user languages? are you using file attachments? it doesn't actually take a lot of code to validate a form submission and send an email.
  21. What have you tried so far?
  22. Thank you. I took ginerjm's advice from his signature and enabled ALL errors and found that while it worked in PHP 7.4 there were deprecated issues... I will start there. Deprecated: Non-static method Action::isAvailable() should not be called statically... Deprecated: Non-static method Action::Factory() should not be called statically... ...both appear 7 or 8 times, always point to the same line. The former: if (Action::isAvailable($var['name'])) { This is the latter one: $action = Action::Factory($action_data['name']); I actually hired a Freelancer to try to fix the scripts a few days ago but we were not able to. Although, from what I've learned from this thread, along with all those new warnings from 7.4 and I think we'd have a better chance if we have another go at it.
  23. Good evening! can you please help me make this chat logger in real time! without refreshing the page! LINK
  24. Maybe. Maybe not. Really hard to tell since we don't know how SendMail works. Try it and find out.
  25. it's also possible that the method in question is being explicitly called from somewhere within the code, given that it returns a value. there would be a fatal error, which could be hidden in the 'view source' of the output or may be hidden due to php's error_reporting/display_errors settings. if this is the case, you would need to keep the original outputter() method definition, then have the new __construct() method call the outputter() method.
  26. There may be other classes that need the same fix, but aren't broken enough to cause an error. Look in the other PHP files for classes which have a function with the same name as the class, for example: class MyFancyClass { function MyFancyClass(){ //stuff } } Then rename the method to __construct like you did before so the code would become: class MyFancyClass { function __construct(){ //stuff } } If you can't find any or fixing the remaining ones doesn't resolve the problem then you may have some other compatibility issue. That the code has this particular issue indicates is was probably written around the PHP 4 / early PHP 5 days. Much has changed since then, so you'll likely have to do one of Spend time learning and fixing the issues or Hire someone to fix the scripts for you or Find a newer up to date script that does the same thing.
  27. Thank so much! That does indeed squash the error... but now with PHP 8, the form outputs simply: default_page_content default_page_footer rather than the HTML form template that loads when processing with PHP 7.4.
  1. Load more activity
  • 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.