Jump to content

dsartain

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Everything posted by dsartain

  1. No, it's testing the same field for either values "" (NULL) or " " (space)...so or should be the right word...
  2. Hey guys, I'm having some trouble with this if statement. I'm writing a text file (yes, has to be a text file) and some items have three keywords, some have between 4 and 7. I've written this if statement to filter out where keywords 4-7 are blank, but so far it's not working. Both below if statements still print the keywords 4-7 even when there isn't a word there. if(stripslashes($row['keyword4'])!=NULL or stripslashes($row['keyword4']) !=" ") { $stringData2 = "".stripslashes($row['network'])."2, ".stripslashes($row['advertiser']).", ".stripslashes($row['keyword4']).", ".stripslashes($AdURL).", 0.20, Active\n"; fwrite($fh2, $stringData2); } if(stripslashes($row['keyword4'])!="" or stripslashes($row['keyword4']) !=" ") { $stringData2 = "".stripslashes($row['network'])."2, ".stripslashes($row['advertiser']).", ".stripslashes($row['keyword4']).", ".stripslashes($AdURL).", 0.20, Active\n"; fwrite($fh2, $stringData2); } I have also tried the above with single quotes instead of double. When I run SELECT * FROM ad_links3.link_table l WHERE keyword4=" "; on the DB, I get results. So this if statement should eliminate those if the mysql is responding to " " for keyword4, but it's not... This is what this code produces when run through a loop, lines 4-7 should not be there as there is no keyword... CB2, Google.com, Google.com, http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active CB2, Google.com, Google com, http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active CB2, Google.com, Googlecom, http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active CB2, Google.com, , http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active CB2, Google.com, , http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active CB2, Google.com, , http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active CB2, Google.com, , http://www.adclicktracking.com/CB/Google.html?keyword={keyword}G, 0.20, Active Any ideas??
  3. Make sure you've created a new path for PHPRC in the environment variables...look at the first couple of postings and you should see the value of PHPRC.
  4. Hey guys, I'm trying to get PHP 5 and IIS 7 to talk to each other...but I can't find any documentation on how to get this to work...can someone shed some light on this for me?? Thanks.
  5. Hey guys, I'm working on a project in which I need to compare two text files for similarities. Kind of like an email content filter would do, but dumbed way down. I know there is a PEAR text_diff package that looks for differences, but I need something like that package that looks for similarities...ideas??? Alternatively, can I use the php string function to loop through both files and search for the similarities?? Thanks.
  6. I'm working on a website for my family and they want to be able to use paypal to process transactions, but still want the ability to go in and update the shopping cart with new prices and such...Paypal's business account only lets me set the values when I create the buttons, and that's annoying as hell to change... Does anyone know how to pass values to paypal so that when they click the paypal "buy" button that it updates the information automatically???? Thanks!
  7. Which user actually runs PHP scripts in IIS?? For some reason I'm not being able to write to C:\inetpub\wwwroot...I've disabled simple file sharing, but can't figure out which user needs to have write access to the folders????
  8. whoops!!! I forgot one minor thing.... function thumbnail($image_path,$thumb_path,$image_name,$thumb_width) { $src_img = imagecreatefromjpeg("$image_path/$image_name"); $origw=imagesx($src_img); $origh=imagesy($src_img); $new_w = $thumb_width; $new_h=($origh*($new_w))/$origw; //added to get better proportions $diff=$origw/$new_w; $dst_img = imagecreatetruecolor($new_w,$new_h); //I left this line out...doh!! imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); imagejpeg($dst_img, "$thumb_path/$image_name", 100); return true; } Thanks a lot for the help!!!
  9. function thumbnail($image_path,$thumb_path,$image_name,$thumb_width) { $src_img = imagecreatefromjpeg("$image_path/$image_name"); $origw=imagesx($src_img); $origh=imagesy($src_img); $new_w = $thumb_width; $new_h=($origh*($new_w))/$origw; //added to get better proportions $diff=$origw/$new_w; //$new_h=$new_w; //removed to get better proportions $dst_img = imagecreate($new_w,$new_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); //just added 100 for $quality...no change in display though imagejpeg($dst_img, "$thumb_path/$image_name", 100); return true; }
  10. well, this seems to work as far as the resizing goes when it comes to the JPEG format...but worthless if the image quality keeps being reduced...any other ideas??
  11. Nope, same thing happened....see above link...
  12. One other thing...the actual mime type is "image/pjpeg"...I don't know if that makes a difference...and this fuction won't handle .gif or .png...though it would be amazing if I could get it to do that...
  13. Go to http://www.the24hourshow.net/dsartain/gallery.php The two images with "Blue Wall" Captions and the one with "Swimming Lessons"...all are towards the bottom...images as colors should appear are on that page also (though I didn't use GD2 for those...)
  14. I've got a function that I'm using to make thumbnails out of images....but the problem is that it's fading the images....I can't figure out why though....please help!! // actual function function thumbnail($image_path,$thumb_path,$image_name,$thumb_width) { $src_img = imagecreatefromjpeg("$image_path/$image_name"); $origw=imagesx($src_img); $origh=imagesy($src_img); $new_w = $thumb_width; $new_h=($origh*($new_w))/$origw; //added to get better proportions $diff=$origw/$new_w; //$new_h=$new_w; //removed to get better proportions $dst_img = imagecreate($new_w,$new_h); imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img)); imagejpeg($dst_img, "$thumb_path/$image_name"); return true; } //usage thumbnail("/var/www/html/dsartain/images/gallery/", "/var/www/html/dsartain/images/gallery/thumbnails/", $userfile_l_name, 150) ;
  15. As I said, I installed it when I installed FC 6, so I have no idea what it did beyond that...but I found a php-mysql.rpm package and installed that, so now I'm good to go. One other question, anyone know where to find a php-gd2 package??
  16. I wound up using a while loop where while ($result = mysql_fetch_array($runquery) and $result2 = mysql_fetch_array($runquery2)) yes...I added another array...
  17. but the user does exist on the machine...I just checked the passwd file to make sure...but I guess I could always put a delete button under the pic (inside some sort of control panel) so when she wanted to delete it she would just do it from there, and then apache would end up deleting it anyway....
  18. Yeah, I saw that just before you mentioned it...I put the echo tag in there....but all I get are red X boxes.... To test it I did: foreach($result as $k=>$v) { echo $v['pic_link']."<br />"; // echo '<img src="'.$v['pic_link'].'" /> '; //This line isn't valid code either. } but the pic_link field in the table gives me a full URL for each one....what am I missing?? The output was... 1 1 1 1 h h Entire code as is now: <?php //vars for $dbconn omitted $dbconn=mysql_connect($hostname, $user, $password); mysql_select_db($dbname, $dbconn); echo mysql_error(); if (!$dbconn) { echo "Could Not Connect to DB!"; } $sql="SELECT * FROM `thumbnail_table`"; $runquery=mysql_query($sql); $result=mysql_fetch_array($runquery); foreach($result as $k=>$v) { echo $v['pic_link']."<br />"; // echo '<img src="'.$v['pic_link'].'" /> '; //This line isn't valid code either. } /* foreach($result as $value) { '<img src="'.$result['pic_link'].'" /> <br />'; } */ ?>
  19. Is this the correct syntax?? I've never done one of these before....I'm trying to dynamically display images...work on making it pretty later... $dbconn=mysql_connect($hostname, $user, $password); mysql_select_db($dbname, $dbconn); $sql="SELECT * FROM `thumbnail_table`"; $runquery=mysql_query($sql); $result=mysql_fetch_array($runquery); echo mysql_error(); foreach($result) { '<img src="'.$result['pic_link'].'" /> <br />'; }
  20. I'm running an FC 6 server with PHP/mysql installed...I'm making a php page/script that will allow a user to upload images. The problem is that I want all images uploaded to be chmod 0644 so that no one else can delete them, I got that to work, but the user that uploads the images is apache. So I'm trying to do a chown (see below) to give the actual user ownership, but I get the error below... if(is_uploaded_file($userfile_t)) { if(!move_uploaded_file($userfile_t, $upfile1)) { echo "Could not move files to destination directory"; exit; } if(!chmod($upfile1, 0644)) { echo "Could not modify file permissions"; } chown($upfile1, 'username'); $pic_link_t='http://www.the24hourshow.net/jjhughes/images/gallery/thumbnails/'.$userfile_t_name; echo "File uploaded successfully! <br />"; } else { echo "Possible file upload attack Filename: ".$userfile_t_name; exit; } Any ideas on how to work this out...other than chmod 0777???
  21. I installed php and mysql when I installed Fedora Core 6, and I thought I had included the mysql option for php, but it's not connecting. Can someone point me in the right direction?? I can't find a mysql.so file in php.d, and there is no ext directory in php.d either Here's some of the php.ini file... there is an ldap.ini file in php.d, but no mysql.ini....
  22. Nah, don't worry about it...if I really need to edit both the passwd file and the DB then I'll just find a way to make VSFTPD check against a DB instead of using pam
  23. Who do you have as your broadband provider?? What kind of cable/dsl box are you hooked up to??  Get back to me and I'll dig around and see what I can find...
×
×
  • 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.