Jump to content

kooper

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by kooper

  1. you didn't put and \ in front of the " in the alt using ' has as similar effect
  2. worked perfectly, thank you v much
  3. thanks very much i tryed adding it to the echo, which just rendered my bbcode useless.lol so i added it to the mysql insert and with a little playing around with it, it worked perfect, thanks alot now there just the formating thing to get sorted
  4. how can i keep my text formating after its queried from mysql as an example id if i posted this [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] hello how are you [/quote] after its queried it becomes [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]hello how are you[/quote] also, is there an easy way to block html in someones post? i was thinking about useing bbcode i tryed $comment = htmlspecialchars($_POST[comment]); but it doesnt seem to do very much
  5. [!--quoteo(post=376935:date=May 25 2006, 10:03 AM:name=Bisa)--][div class=\'quotetop\']QUOTE(Bisa @ May 25 2006, 10:03 AM) [snapback]376935[/snapback][/div][div class=\'quotemain\'][!--quotec--] With some help Im now able to add rows into my table but how do I drop rows? the only thing I can find is the "drop_table" and thats not what I want... all help/suggestions are welcome [/quote] you can do it the hard way with phpmyadmin or use this query $sql = "DELETE FROM the_table WHERE id = '$whatever_your deleting"; $result = mysql_query($sql); obviously replaceing the_table and whatever_your deleting with whatever you tables and variables are
  6. hey, ive dabbled in php before but im still a learner I recently made a script that would upload a file and if that file was an image you could choose to have a thumbnail made using the GD library. problem im having is the if else which decides weather to make the thumb from a jpeg, gif or png isnt working. the script that reads the extension seems to be working fine. you can probably tell more from the code, so here it is. [code] <?php //variables $directory = "../../$address/"; $file = $_FILES['userfile']['name']; $upload = "$directory". $_FILES['userfile']['name']; $link = "http://localhost/gsm/$address/$file"; $thumbWidth = 200; $thumbDirectory = "$directory/thumbs"; $namelength = strlen($file); $namelength = $namelength - 3; if(strpos($file, jpg) == $namelength){ $filetype = "jpg"; } else if(strpos($file, png) == $namelength){ $filetype = "png"; } else if(strpos($file, gif) == $namelength){ $filetype = "gif"; } //upload script if(!(copy($_FILES['userfile']['tmp_name'], "$upload"))) die("Cannot upload files."); echo "Upload Complete!<br> <a href=\"$link\" target=\"_blank\">$link</a><br>"; echo "$filetype <br>"; //thumb script function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidth)     {          //detecting type of source file         if ( $filetype == "png") {         $srcImg = imagecreatefrompng("$imageDirectory/$imageName");         } else if ( $filetype == "jpg") {         $srcImg = imagecreatefromjpeg("$imageDirectory/$imageName");         } else if ( $filetype == "gif") {         $srcImg = imagecreatefromgif("$imageDirectory/$imageName");         } else {         echo "file type not supported for thumbnailing";         };                  $origWidth = imagesx($srcImg);         $origHeight = imagesy($srcImg);         $ratio = $origWidth / $thumbWidth;         $thumbHeight = $origHeight / $ratio;         $thumbImg = imagecreatetruecolor($thumbWidth, $thumbHeight);         imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $origWidth, $origHeight);         imagejpeg($thumbImg, "$thumbDirectory/$imageName");     } if($makethumb == "1" && $address == "media1")     {         createThumbnail("$directory", "$file", "$thumbDirectory", "$thumbWidth");     } ; ?>    [/code]
×
×
  • 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.