Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. change imagejpeg($image); imagedestroy($image); imagedestroy($watermark); to imagejpeg($resized); imagedestroy($image); imagedestroy($watermark); imagedestroy($resized);
  2. try this addition imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); // Resize after merge $newwidth = 500; $newheight = 400; $resized= imagecreatetruecolor($newwidth, $newheight); imagecopyresized($resized, $image, 0, 0, 0, 0, $newwidth, $newheight, $imagewidth , $imageheight); imagedestroy($image); $image = $resized; EDIT: added two lines
  3. apart from the $content = addslashes($content); everything else looks ok, the "[blob - 0b]" is just a way of PMA saying its raw data
  4. Okay... i don't get the question! to double it do $imagewidth = imagesx($image)*2; $imageheight = imagesy($image)*2; ???
  5. height and width of what ? the image $imagewidth = imagesx($image); $imageheight = imagesy($image); or the watermark $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark);
  6. Set_cookie
  7. it will get the returned data to check to see if its in their but by then the loop has started.. you could try function loadTemplateFile( $filename, $parse=true ) { $file = file( $filename ); if( $file == false ) return null; $file = implode( " ", $file ); return ($parse)?$this->parseTemplateFile($file):$file; } function parseTemplateFile( $file ) { $file = str_replace( "%templateheader%", $this->loadTemplateFile( "style/header.html", false ), $file ); $file = str_replace( "%templatefooter%", $this->loadTemplateFile( "style/footer.html", false), $file ); //$file = str_replace( "%iecheck%", tmplIECheck(), $file ); return $file; } totally untested
  8. Nope still no problem here http://madtechiesupport.com/TestForm.php <? session_start(); function checkType() { if( isset($_FILES) ) return true; foreach($_FILES['images']['type'] as $theType) { $value = strtolower($theType); if(!empty($value)) { if($value != "application/pdf") { return false; } } } return true; } if(isset($_POST['submit'])) { if (checkType()===FALSE) { $errors[]="Sorry , current format is <b>'.($value).'</b> ,only html or pdf files are allowed."; echo "<pre>"; print_r($errors); }else{ echo "WooHoo"; } die; } ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <?php echo "<html><head><title>Email Form</title></head>"; $max_no_img=4; // Maximum number of images value to be set here echo "<form method='post' enctype='multipart/form-data' target='errorframe'>"; echo "<table class='test' width='100%'>"; echo "<tr height='25px' align='center'><th class ='overState' colspan='4'><font face='verdana' size='2' color='navy' >Email pdf</font></th></tr> </table> <table class='test'> <tr><td>To: </td><td><input type='text' name='to' value='' /></td> <td>CC: </td><td><input type='text' name='cc' value='' /></td></tr> <tr><td>BC: </td><td><input type='text' name='bc' value='' /></td> <td>From: </td><td><input type='text' name='from' value='XYZ@googlemail.com' /></td></tr> <tr><td>Subject: </td><td colspan='3'><input type='text' name='subject' value='pdf Attached' /></td></tr> <tr><td>Message:</td><td colspan='3'> </td></tr> <tr><td> </td><td colspan='3'><textarea cols='60' rows='7' name='message' value=''></textarea></td></tr>"; for($i=1; $i<=$max_no_img; $i++){ echo "<tr><td>Files $i</td colspan='3'><td> <input type='file' id='pdfs[]' name='pdfs[]' value='' class='formbutton'></td></tr>"; } echo "<br><TR> <td align='right' colspan='2'> <input class='formbutton' type='submit' name ='submit' value='Send' ></td> <td align='left' align='left' colspan='2'><input class='formbutton' name='exit' type='button' id='exit' onclick='self.close();' value='Close' ></td> </tr>"; echo "</table></form>"; echo "<table width='100%'><tr><Td><iframe id='errorframe' name='errorframe' style='border:0px;'></iframe></td></tr></table> </body> </html>"; ?>
  9. change for($i=1; $i<=$max_no_img; $i++){ echo "<tr><td>Files $i</td colspan='3'><td> <input type='file' id='pdfs[]' name='pdfs[]' value='' class='formbutton'></td></tr>"; } to for($i=1; $i<=$max_no_img; $i++){ echo "<tr><td>Files $i</td colspan='3'><td> <input type='file' name='pdfs[]' value='' class='formbutton'></td></tr>"; } it should be fine
  10. try here http://madtechiesupport.com/TestCheckType.php
  11. you have the href set to the same page.. $site_url = "belladonnasdarkgraphics.com/layout.php"; // no http, no trailing / //...snip...// <a href="http://<?php echo $site_url; ?>" target="_blank" title="<?php echo $urlpath . $file; ?>"><img src="http://<?php echo $img_url . "/" . $imgpath . $file; ?>" alt="<?php echo $file; ?>" width="300" ></a><br>
  12. i just tested this is FF 2.0.0.6, no errors <form method="post" enctype="multipart/form-data" > <input name="images[]" type="file" /><br /> <input name="images[]" type="file" /><br /> <input name="images[]" type="file" /><br /> <input name="submit" type="submit" value="sumit" /> </form> <?php function checkType() { if( isset($_FILES) ) return true; foreach($_FILES['images']['type'] as $theType) { $value = strtolower($theType); if(!empty($value)) { if($value != "application/pdf") { return false; } } } return true; } if (checkType()===FALSE) { $errors[]="Sorry , current format is <b>'.($value).'</b> ,only html or pdf files are allowed."; }else{ echo "WooHoo"; } ?>
  13. what about this if( ( is_string($var) && !empty($var) ) || (is_numeric ($var) && $var > 0) ) { //process $var }
  14. if your viewing as plan text your fine..from XSS
  15. parseTemplateFile call's loadTemplateFile which is fine.. but on your change parseTemplateFile call's loadTemplateFile which call's parseTemplateFile which call's loadTemplateFile which call's parseTemplateFile Inf. Loop,
  16. that code should work fine for both IE & FF, Use this code in its own file and let me know if you get the same error.
  17. erm.. thats basic html.. your linking to itself.. you may want to post the code..
  18. not sure if this is what you want $page = (int)$_GET['page']; $pagefile = "page$page.php"; $PrevPagefile = "page".($page-1).".php"; $NextPagefile = "page".($page+1).".php"; include $pagefile; if( file_exists($PrevPagefile) && is_file($PrevPagefile) ) { echo "<a href='?page=".($page-1)."'>Previous Page</a>"; } if( file_exists($NextPagefile) && is_file($NextPagefile) ) { echo "<a href='?page=".($page+1)."'>Next Page</a>"; } hello page 1 page 2 etc etc EDIT: updated a few typos
  19. if no files are uploaded it will fail function checkType() { foreach($_FILES['images']['type'] as $theType) { $value = strtolower($theType); if(!empty($value)) { if($value != "application/pdf") { return false; } } } return true;//or false if they must upload } Updated
  20. in which case.. page1 - the form.. action to page 2.. redirects to page 3.. if your stuck on the move from page 2 to 3 then i would use headers header("Location: newpage.php?id=1");
  21. if you have 2 scripts and you recieve the GET['ID'] from one, any script included will also get that value.. ie <?php echo $_GET['ID']."<br>"; include "script2.php" ?> <?php echo $_GET['ID']."<br>"; ?> Now, if you want to pass $_GET['ID'] without recieving it.. you can do this <?php $_GET['ID'] = 12; include "script2.php" ?> but i would recommend you modify the script your including like this if(isset($_GET['ID']) || !empty($passeddata)) { //... } then just set $passeddata in the first script and call as normal EDIT: so a quick fix ... $companyid = mysql_insert_id (); $_GET['id'] = $companyid; $file = "companydata_details.php"; include $file;
  22. A Javascript solution will probably work best, for a simple count down <script language="javascript"> var count = 20; function countdown() { document.getElementById('countdown').innerHTML = count; count = count-1; if(count == 0) { document.location.href="NewPage.html"; } } </script> <body onload="setInterval('countdown();', 1000);"> <div id="countdown"> </div> </body>
  23. I added a form, which i assume your using.. this should work fine <form method="post" enctype="multipart/form-data" > <input name="images[]" type="file" /><br /> <input name="images[]" type="file" /><br /> <input name="images[]" type="file" /><br /> <input name="submit" type="submit" value="sumit" /> </form> <?php function checkType() { foreach($_FILES['images']['type'] as $theType) { $value = strtolower($theType); if(!empty($value)) { if($value != "application/pdf") { return false; }else{ return true; } } } } if (checkType()===FALSE) { $errors[]="Sorry , current format is <b>'.($value).'</b> ,only html or pdf files are allowed."; }else{ echo "WooHoo"; }
  24. jd2007.. read the manual... 8 out of 10 of your questions are in the manual I assume he means expire In addition please click solved on some of your topics.....
  25. add an if(file_exists($file) && is_file($file)) just to be sure
×
×
  • 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.