Jump to content

kirkh34

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by kirkh34

  1. hello all, i have a function to copy a png 24 while preserving transparency and recolor the image and save a new file. the color works but the image edges become fuzzy. i'm not entirely sure what is causing this. i'd like to have the same quality as the original image with clean edges. love to hear suggestions. thanks a lot <?php function color_png($src_string, $directory, $r, $g, $B){ $im = imagecreatefrompng($src_string); imageantialias($im, true); $width = imagesx($im); $height = imagesy($im); $imn = imagecreatetruecolor($width, $height); imagealphablending($imn,false); $col=imagecolorallocatealpha($imn,255,255,255,127); imagesavealpha($imn,true); imagefilledrectangle($imn,0,0,$width,$height,$col); imagealphablending($imn,true); imagecopy($imn, $im, 0, 0, 0, 0, $width, $height); imagefilter($imn, IMG_FILTER_NEGATE); imagefilter($imn, IMG_FILTER_COLORIZE, $r, $g, $B); imagepng($imn, $directory); imagedestroy($imn); } ?>
  2. I'm confused at what you mean? run one query at the start of what? I need the title_id in the array. I must use that loop?
  3. thank you for your replies. I understand that it is wrong to run queries in loops, but I am not sure how I would complete it otherwise? I have to run that foreach loop in order to get the title_id needed to run the query. Can you explain a different structure that would work for what I need?
  4. Hello. I have a table title_views with each row being a "view" with a user_id, title_id, prog_id, date, and id. I want to gather just the user_ids without it returning duplicate user_ids. Right now I'm receiving duplicate user_id. Any help is appreciated. Thank you. <?PHP include("db.php"); $qry= mysql_query("SELECT * FROM programs") or die (mysql_error()); while($row = mysql_fetch_array($qry)){ $prog_titles = $row['titles']; $prog_titles = explode(',' , $prog_titles); $prog_id = $row['prog_id']; array_shift($prog_titles); foreach($prog_titles as $prog_title){ $trimmed = trim($prog_title); $qry= mysql_query("SELECT DISTINCT user_id FROM title_views WHERE title_id = '$trimmed' and prog_id = '$prog_id' ") or die(mysql_error()); $row = mysql_fetch_array($qry); echo $row['user_id'] . "<br />"; } // end foreach } //end while ?>
  5. I'm trying to find a good function that allows me to resize an image and specify the paths, the dimensions, and the quality about the image. Does anyone have any suggestions? Thanks
  6. how dumb of me!! see what happens when you don't code for a few months... that's easy! thanks a lot i feel really dumb but i appreciate the quick response! i still don't understand why it hangs up...oh well the problem is fixed
  7. I've been getting this error: Fatal error: Maximum execution time of 30 seconds exceeded in... (gives file and line number) I've cut out most of the code in the for loop to narrow it down specifically to the $i variable messing it up somehow... The 2nd part of the if statement where I try to append the $i variable to the new $row_ variable is causing it to hang like this. I want to be able to make 5 new variables... $row_1...$row_2...etc... but for some reason when I try to append the $i to it, it hangs. and throws that error eventually. Does anyone know why it does this? Any help is appreciated. Thank you! for ($i=1;$i<6;$i++){ if ($row['bef_remarks' . $i] != "Description"){ $row_.$i = 1;
  8. i'm trying to figure out where in the graph you can change the photos in the top row of a user profile page...the ones you "hide" there is no documentation for this but there are apps that do so...any suggestions?
  9. yeah... and really I'd really like to keep everything with the ID as far as the database goes... for now I just have domain.com/title-goes-here-0983 <--id number... It's not a big deal i suppose... I mainly just wanted it like this for SEO...so I think I'm good to go... thanks a lot for your responses johnny! i appreciate it
  10. I was thinking of it backwards, as if you could do the rewrite and it change all your urls... i get it now... I will have to change all the urls myself... so...another question, is there anyway I can have the title as the url domain.com/photo-title-goes-here i added a get variable to the url for the title with the hyphens in between each word... can I somehow hide the ID variable and only show the name variable?
  11. so what I'm really trying to do is get it to show in the url... right now if you type in domain.com/photo/(id) it goes to the old url.. i want the opposite really... how can this be done?
  12. im not sure what to do. the module is enabled... shouldn't this change my url when i access the page? am i missing any steps?
  13. nope... still no go...just seems very strange... i've tried so many options and none of them work
  14. i have been on dozens of sites trying different code for a mod rewrite so I can have a friendlier url for seo... i have no idea why it's not working i am stumped.. i am using a rewrite to redirect to www and that works fine... help is appreciated Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc] RewriteRule http://www.domain.com/photo/(.*)/(.*)/$ /photo.php?$1=$2 i have also tried it with the carrot at the beginnign with no luck... and with the full url.. i have tried countless ways from googling and never does it work
  15. that's strange if you made a live payment and all you did was change the pricing... submit a ticket on x.com, one of their specialists will look at your situation and respond within 24 hours.. https://ppmts.custhelp.com/app/ask/session/L3RpbWUvMTI5MjY0NDMyOS9zaWQvRFdpWE1OaGs%3D
  16. I believe I found code on a forum and manipulated it... they also have a really good script generator you could use...this is my working code: include("includes/db_connect.php"); $txn_id = $_POST['txn_id']; $r1 = mysql_query("SELECT * FROM orders WHERE txn_id='$txn_id' ") or die(mysql_error()); if(mysql_num_rows($r1) == 1) exit(); // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // If possible, securely post back to paypal using HTTPS // Your PHP server will need to be SSL enabled // $fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30); if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { ////// //////do stuff here ///// } //close if else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation } ///close else if } } fclose ($fp); Check out this link for the script generator... https://www.paypaltech.com/sg2/ What hosting do you have? I DID have godaddy and had major problems with godaddy allowing POST data to be sent to my server. I was on a shared hosting plan. The only way I could fix it was to buy a dedicated IP address.. I just switched hosting providors and everything is fine now.
  17. of course... wow how can my mind stray from such the simplest solution!! thanks!
  18. I'm not sure if you are set on using ssl but i use $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); just remove the ssl: and change to port 80... this works for me just fine
  19. i recommend lynda.com for any kind of tutorial they are very good
  20. the array at the top is the array combine printed out when nothing is arranged differently...
  21. okay I am using a jquery plugin to re-arrange images which are in mysql and they have their own "order_number" ... when i re-arrange stuff the new order is put into a hidden field in a form and i have it along with another hidden field with their current order... when submitted I combine these two fields in an array so the key is the original order and the value is the new order ....i have 12 images... Array ( [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 ) this is what is what the array looks like... i have a foreach loop with a mysql query but things get kind of weird when you try to do it this way $num = $_POST['old_num']; $num = unserialize($num); $sort = $_POST['sortOrder']; $sort = explode(',', $sort); if ($_POST){ $combine = array_combine($num, $sort); foreach($combine as $key => $value){ mysql_query("UPDATE shirts SET order_number='$value' WHERE order_number='$key' ") or die(mysql_error()); } when you do this lets say for example we have the image with order number "1" get switched with the image order number "2"..... the database first updates with number 1 which becomes 2... then when it goes to number "2"... at this point... the first image gets switched back to number 1.... so 1 becomes 2 then the new 2 becomes 1 again and the other 2 becomes 1 also. I can not think of another way I could update mysql with the correct order numbers... If anyone has any ideas or other solutions I am open to all suggestions... thank you!
  22. Yes I tried all of the above plus changing the filename... I've been stuck on this for 4 days and probably tried everything possible.. If you see this thread and read the last post...https://www.x.com/message/121905?tstart=0 ... he is having the same problem I have and realized that it's not working on shared hosting. But I don't have a VPS. I don't believe there is a problem with the script or their servers or the settings of the IPN... it's the godaddy shared hosting that is not allowing it for some reason.
  23. yes... the url I enter is http://www.swellshirt.com/ipn.php This is the URL I give that if I upload to the vps...it works but on the shared it doesn't... but if I go to that it parses and in my database "yes" gets inserted along with that single variable. No I'm positive they are getting the correct URL because in the instant payment notification history (where you see the details w/ the 408 error) it shows the URL I specified and it's right on. EDIT: What do mean by protocol and subdomain/host name? Are you talking about the absolute path with the IP address of my server? If so, no I can't.
  24. I'm trying to set up paypal payment processing on my website. I have godaddy shared hosting (<--mistake) and I'm trying my hardest to not switch hosts. The payments process fine, it is the listener that I'm having problems with. Paypal POSTs data to a script for which you set the url to a "listener" script in your settings. When a payment is made.... they POST the data to the listener script... you encode the data...append it all together plus another variable and send it back to be verified that it matches... Well I'm not too worried about the script working and all that... the problem is I'm not even RECEIVING the post. I have a simple foreach loop gather and append the data into a string. I have it set up right now to insert into MYSQL just so I can SEE if it's working....You can check your IPN history and I can see that payments are made but paypal is sending it over and over it's in a "retrying" state with a 408 error. My server is not sending a 200ok response. After 4 days of bashing my head against the wall I figured out that there's a problem with godaddy shared hosting.. If I use a virtual private server with the SAME script from godaddy it works just fine. But on the shared hosting it blocks it for some reason...After calling paypal and godaddy countless times with them pointing their finger at each other... one godaddy support rep tells me that I should set my script up with a proxy and he gave me info which I will show you in the script... This is what I need help with right. How can I receive POST data through a proxy in my script.... I want to add that this doesn't make sense to me because in my script I also have the word "yes" insert into MYSQL even if the script is hit at all... All this time my script is NEVER even touched by paypal... So.. if I add this proxy stuff... how will let my script even be accessed? I'm not sure how servers work together too well to process things. It just didn't seem like the proxy thing would even help when my script can't even be accessed it seems. Any help is appreciated. Here's the simple code I'm working with: $con = mysql_connect("","","") or die(mysql_error()); $db = mysql_select_db("swellshirt",$con); $ip = "64.202.165.130"; // proxy IP <-- IP... $port = 3128; // proxy port $url_proxy = 'http://proxy.shr.secureserver.net'; // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } mysql_query("INSERT INTO orders (description, street) VALUES ('$req', 'yes') ") or die(mysql_error());
  25. well haku let me explain my thoughts... what is it about my question that is not understandable? is it the part where i use php to echo out the html?... listen... i come onto these forums because there are intelligent people who like helping people who don't understand programming at your genius level yet... it's not like my situation is complicated.... ... i have a simple select with sizes that if you look closely... the XL size needs to add $2.00 to the price when selected....this seems like it could be accomplished simply but I can't figure it out...which brings me to the forum i'm not asking anyone to write me a whole new working function or anything...i came here for ADVICE...like "yeah you could try doing this or this..." and if it's something I don't understand yet I can look it up....i appreciate everyones responses that gave their time and i appreciate the ones who chose to waste my time to not post...
×
×
  • 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.