Jump to content

Cardale

Members
  • Posts

    278
  • Joined

  • Last visited

Everything posted by Cardale

  1. darn sorry. I don't have much experience with your situation. What host are you using if you don't mind me asking? Sounds like an odd setup.
  2. Not bad. How did you assemble your lists?
  3. You can see an example here. http://www.kinggoddard.com/test2.php It isn't perfect, but it gets the job done. If you added a few more things to make sure all is well it would help.
  4. Well honestly you wouldn't have thousands if you deleted the one before it, but in order to do this you have to create two files. We will name this image.php <?php session_start(); $command = "find /var/www/test/*.jpg"; $file = exec($command); $info = pathinfo($file); $file_name = basename($file,'.'.$info['extension']); $realstring = $file_name; $useimage = imagecreatefromjpeg($file); $linecolor = imagecolorallocate($useimage,233,239,239); $textcolor = imagecolorallocate($useimage, 255, 255, 255); imageline($useimage,1,1,40,40,$linecolor); imageline($useimage,1,100,60,0,$linecolor); imagestring($useimage, 5, 20, 10, $realstring, $textcolor); header("Content-type: image/jpeg"); imagejpeg($useimage); $_SESSION['filename'] = $file; $_SESSION['file'] = $file_name; ?> second example.php <?php session_start(); ?> <img src="test.php"> <?php $file = $_SESSION['filename']; $file_name = $_SESSION['file']; $file_name = $file_name + 1; rename("$file", "/var/www/test/".$file_name.".jpg"); ?> Now create a directory name it "test" give it proper permissions. Then get a good image to use and name it 0.jpg. and that should be it after you set all the permissions correctly. Hahah..cool
  5. I would recommend more reading and following along with other tutorials until that has given you enough insight to code your own things. Don't take this as me saying you can't do it, but rather you just need more experience with other commands before you can code your own work. Read about if statements and while loops and you can fix your current problem easily.
  6. I would assume so, but I have never tried personally. Try reading this http://digiex.net/networking/544-configuring-php-under-windows-use-gmail-external-smtp-server-ssl.html
  7. $num = 250; $count = $num - $rcount; echo $rcount; echo "<br />"; echo $count;
  8. http://php.net/manual/en/control-structures.while.php Good examples here.
  9. $headers = "From: myemail@email.com\r\n"; $headers .= "Reply-To: myemail@email.com\r\n"; $headers .= "Return-Path: myemail@email.com\r\n"; $headers .= "CC: myemail@email.com\r\n"; $headers .= "BCC: myemail@email.com\r\n"; $headers .= "X-Mailer: PHP/" . phpversion(); mail($to, $subject, $body, $headers) Try adding the addition header I updated the code up top. I assume your using a hosting service? Also try this. ini_set ("SMTP","mail.website.com"); ini_set ("sendmail_from","webmaster@website.com");
  10. Cardale

    Installing SVN

    I need a good tutorial on how to get SVN installed. Anyone know of a good one? Working with Ubuntu 9.10.
  11. Ubuntu is the best. There are a few reason why people say they aren't. [*]Is they don't use only open source software/drivers. Which is stupid because some companies don't release the driver code or data structure so it is obvious they would design a better driver. [*]Ubuntu isn't the most "bleeding edge"(whatever that means) which isn't really true you can install anything you like in Ubuntu it just will work out of the box in most cases. Which is helpful if you like to work on things rather than make your OS work. Which is why most people leave Windows behind I would imagine.
  12. $headers = "From: myemail@email.com\r\n"; $headers .= "Reply-To: myemail@email.com\r\n"; $headers .= "Return-Path: myemail@email.com\r\n"; $headers .= "CC: myemail@email.com\r\n"; $headers .= "BCC: myemail@email.com\r\n"; mail($to, $subject, $body, $headers) http://php.net/manual/en/function.mail.php Should be something like this....
  13. You might want to try changing how this code is laid out for one. //CHECKS USERNAME //should also check and make sure no bad input entered by user malicious code. $query = mysql_query("SELECT * FROM members WHERE username = ".$newusername); $usernamecheck = mysql_num_rows($query); $newusername = $_POST['newusername']; if(!preg_match("/^[a-z\d]{5,12}$/i", $newusername) && $usernamecheck > 0){ // show form user entered bad username $username_errorone = "Your username must only contain letter and numbers and be at least 5 characters but no longer than 12 characters in length!<br />"; include 'profileuserform.php'; }else{ $query = "UPDATE members SET username = '$newusername' WHERE username = '$username'"; $result= mysql_query ($query) or die ('Could not create user.'); // if suceesfully inserted data into database, send confirmation link to email if($result){ $_SESSION['username'] = $newusername; header('Location: index.php'); } } ?> This should help you in the right direction. I believe this should work. I didn't test it.
  14. function png2gif($pngs, $background = array(255, 255, 255), $dest = 'gif'){ foreach($pngs as $png){ $size = getimagesize($png); $img = imagecreatefrompng($png); $image = imagecreatetruecolor($width = $size[0], $height = $size[1]); imagefill($image, 0, 0, $bgcolor = imagecolorallocate($image, $background[0], $background[1], $background[2])); imagecopyresampled($image, $img, 0, 0, 0, 0, $width, $height, $width, $height); imagecolortransparent($image, $bgcolor); imagegif($image, str_ireplace('.png', '.gif', $dest.DIRECTORY_SEPARATOR.basename($png)), 100); imagedestroy($image); } } // example png2gif(glob("icons/*.png")); Sorry if this doesn't help didn't spend much time on it.
  15. If you know how to use the SELECT feature then just put it in a while loop. This is the easiest way, but this is assuming your using MYSQL.
  16. There is a third option. You could create an image and keep re-creating it and show it that way and use the file name as your counter....haha kinda simple and odd, but it would work.
  17. Have you tried using a switch statement? http://php.net/manual/en/control-structures.switch.php I have no idea what this is so....here is my best shot hahah.
  18. It isn't clear to me what your trying to do.
  19. It is most likely css. Just search on that.
  20. Not sure if I was doing something wrong or not, but I was limited to 4 entries. if (!isset($_POST['name'], $_POST['email'], $_POST['password'], $_REQUEST['submit']) && !isset($_REQUEST['activate'])){ I had to make separate function otherwise it wouldn't work. Kinda strange to me. Never seen that before.
×
×
  • 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.