Jump to content

Juliette

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Juliette

  1. that's working.. tnx one more question.. can I open it in new tab?
  2. Hi, i'm writing a php script which reads data from file, and then it shoud pass that value (which is actually url) to browser. How can I do that without any href or buttons? I want to call that script, and then specific page should be opend. Cheers
  3. its working with trim! Great. And about this Don't know why but that's the only way to successfully pass value $pic_array[$counter]; to another file. I tried with <input type="hidden" name="pic" value="<?php echo $pic_array[$counter]; ?>">, as you can see, but its not working.. Edit: $counter from first file is sending number of last line (the empty one) , and not the number of chosen picture. Any suggestions?
  4. Hello, i have a problem with displaying .jpg images in pdf, when using php & FPDF. If I write path to image in '2php.php' manually, it's working properly (image is displayed in created doc.pdf file) but when I try to use it with variables received from 'main.php' an error occures. Error: FPDF error: Unsupported image type: jpg Is there some solution to this? tnx MAIN.PHP: <html> <body> <?php $PATH = "path to image dir.."; $file = "pic.txt"; $lines = count(file($file)); $handle = @fopen($file, "r"); if ($handle) { while (!feof($handle)) { $pic_array[] = fgets($handle, 4096); } fclose($handle); } ?> <table BORDER="1"> <?php for($counter = 0;$counter<=$lines; $counter++){ ?> <tr> <td><?php echo $pic_array[$counter];?></td> <td> <form method="POST" action="2php.php" name="form" id="form"> <input type="hidden" name="path" value="<?php echo $PATH; ?>"> <input type="hidden" name="pic" value="<?php echo $pic_array[$counter]; ?>"> <input type="submit" value="<?php echo $pic_array[$counter];?>" name="PDF"></td></tr> <?php }?> </form> </td></table> </body> </html> 2php.php <?php require('fpdf.php'); $pic = $_POST["PDF"]; $path=$_POST['path']; $path1 ="".$path."".$pic.""; //$pic1 = 'pic1.jpg'; $pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','B',16); $pdf->Image($path1, 1, 10, 250, 250); //$pdf->Image($pic, 1, 10, 250, 250); //$pdf->Image($pic1, 1, 10, 250, 250); $pdf->Cell(40,10,$path1); //$pdf->Cell(40,10,$pic1); $pdf->Output(); ?> example of pic.txt: pic1.jpg pic2.jpg picure3.jpg image.jpg
  5. I solve it, but thx for help
  6. Hello, I need help with passing values, when generating PDF file (I'm using FPDF). I have to pass few values to that file, and I dont know how. I tried send it with post method (from form) and then get it with GET, but without success, some error occurres. I dont even know if that's actually possible with FPDF, because FPDF manual says "You must send nothing to the browser except the PDF itself: no HTML, no space, no carriage return." Some ideas?
×
×
  • 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.