-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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
-
apart from the $content = addslashes($content); everything else looks ok, the "[blob - 0b]" is just a way of PMA saying its raw data
-
Set_cookie
-
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
-
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
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>"; ?> -
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
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 -
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
try here http://madtechiesupport.com/TestCheckType.php -
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>
-
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
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"; } ?> -
what about this if( ( is_string($var) && !empty($var) ) || (is_numeric ($var) && $var > 0) ) { //process $var }
-
if your viewing as plan text your fine..from XSS
-
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,
-
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
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. -
erm.. thats basic html.. your linking to itself.. you may want to post the code..
-
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
-
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
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 -
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;
-
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>
-
[SOLVED] function checktype is not working?
MadTechie replied to sayedsohail's topic in PHP Coding Help
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"; } -
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.....
-
add an if(file_exists($file) && is_file($file)) just to be sure