Jump to content

bobinindia

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Posts posted by bobinindia

  1. I have a javascript function that opens and tries to print a php page.

     

    When I hit the 'print draft' button on the first page the window opens correctly and the print dialog box comes with the correct file name in it. When I actually hit the 'print' button in the dialog box the error comes.

     

    The page is generated by GD and only has a imagejpeg sent to it. Can that confuse the printer? My error is that 'the page was replaced while you were trying to print'. Is that because php took a second to generate the page or what is going on there?

  2. I have checked each time i uploaded the file the content of the imagecode.php. It only changed when the image had no image icon. The images are being uploaded and entered into the database as the images upload id is going up every time i run it regardless of the preview icon.

    This is an example of what is written in the file.

    <?php echo 'Image=images/uploaded/280.jpg'; ?>

    No unusual characters to break the string.

  3. So this is the code that writes to a text file:

    $fp = fopen('imagecode.php', 'w');
    $vari = "<?php echo 'Image=".$theimage."'; ?>";
    fwrite($fp, "$vari");
    fclose($fp);

    Nothing too unusual there. Permissions are fine as it does write sometimes. $theimage is a file uploaded by a user. Testing on a mac I noticed that if an image in Finder has a preview icon it won't be written to this file. Any other image will. All jpgs. Any idea what that could be?

  4. $i = 1;
    
    while($myrow = mysql_fetch_array($result))
                         {
                            $itemId = $myrow['itemId'];
                            $price = $myrow['price'];
                            $quantity = $myrow['qty'];
                            $date = $myrow['date'];
                   
                            
                         
                         $mailcontent.$i = "Item Id: ".$itemId."\n"
                                    ."Quantity: ".$quantity."\n"
                                    ."Date: " .$date."\n"
                                            ."Customer email: ".$email."\n"
                                       ."Shipping Address: \n" .$shipadd."\n";
                                   
                         $i++;
                                                            
                            }
    $mailcontent = $mailcontent1.$mailcontent2.$mailcontent3;
    //etc
    mail($to, $subject, $mailcontent,$additional_headers);
    

     

    Something along those lines.

    No expert myself!!

  5. You will need to store the info for the table in a variable which gets a new name each while loop. ie ++1 onto each variable name.

    Then join them before mailing.

    each variable  hold a row.

    $variable1.$variable2 etc

     

  6. Solved it.

    By making the transparent color one of the RGB values - 1 or +1.

    The eye can't see it.

    $color = rgb2hex2rgb($colour);
            $one = $color[0];
            $two = $color[1];
            $three = $color[2];
            if ($three<255){
                $replace = $three +1;
            } else {
                $replace = $three - 1;
            }
    $tcolour = imagecolorallocate($mask,$one,$two,$replace);

×
×
  • 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.