Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Everything posted by cmgmyr

  1. I will give you some help too if you need it. I like your logo. -Chris
  2. Looks pretty good so far, you should work on your logo a little more. I think that it would look a little better with a lighter blue and less of the shadows. Also if the user has javascript disabled you should have a <noscript> notification showing them how to turn it on. -Chris
  3. Yeah, I was right. Check this out: http://www.zend.com/manual/language.operators.comparison.php
  4. I believe it is "not equal to" try replacing it with != and see if you get the same result. -Chris
  5. double check your phpinfo.php if the changes have been made in that. Go through the config file in phpMyAdmin there might be some sort of max size associated. Hope this helps, -Chris
  6. No problem, I hope it worked out for you. -Chris
  7. I agree with steviewdr with all of his points. Please get rid of the scrolling text, if you still want something like that make something in flash so it looks a little more professional. The site is coming a long though. -Chris
  8. When your request is processing you can add some html with a button in it linked to myRequest.transport.abort(); that should kick it out of what it's doing -Chris
  9. no problem, you'll get the hang of it after a while...just keep asking your self "is this as efficient as I can make it?" Just add the delete products under your delete man and it will take care of everything. -Chris
  10. no your mysql_connect it just looked like host generated information...Just trying to save your skin if it was your real info  :)
  11. To load them in a single array try... [code]<?php //Find total number of ips $query = "SELECT ip FROM table"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); $count = mysql_numrows($result); $ips = array(); $x = 0; while ($x < $count): $ipaddress = mysql_result($result, $x, 'ipaddress'); $ips[$x] = $ipaddress; $x++; endwhile; ?>[/code] Is that what you were looking for? -Chris
  12. I hope that isn't your real connect information...if it is, I would edit that out ASAP!!!
  13. Why do you have the id and name of the manufacturer in both tables, it would be a lot easier to just have the name in the "man" table. It will also cut down the amount of space your databse uses and actually make it faster. you can use $sql = ("DELETE FROM man WHERE manid = '$Manufacturer'"); to delete the manufacturer and $sql = ("DELETE FROM products WHERE manid = '$Manufacturer'"); Hope that helps. -Chris
  14. cmgmyr

    PHP MyAdmin

    Thank you for that! I like phpMyAdmin it is a great tool to have and use. It saves soooo much time!
  15. It just keeps doing a page refresh for me.
  16. can you please show us some code?
  17. cmgmyr

    PHP MyAdmin

    you can also go to "Operations" in phpMyAdmin
  18. try looking at some photoshop layout tutorials. those are a good place to start. After you get a good layout, then you can just plug in all of the php elements
  19. yeah...needs lots - o - work
  20. at the bottom of the ipn.php
  21. yes, so why isn't it getting back?
  22. I don't believe so. Since it's not updating the database, I'm assuming that it's not coming back.
  23. anyone?
  24. Ok, here is what I got... donations table: CREATE TABLE `donations` ( `id` BIGINT NOT NULL AUTO_INCREMENT , `UID` BIGINT NOT NULL , `item_name` MEDIUMTEXT NOT NULL , `item_number` MEDIUMTEXT NOT NULL , `payment_status` TEXT NOT NULL , `payment_amount` TEXT NOT NULL , `payment_currency` TEXT NOT NULL , `txn_id` LONGTEXT NOT NULL , `receiver_email` MEDIUMTEXT NOT NULL , `payer_email` MEDIUMTEXT NOT NULL , INDEX ( `id` ) ) ENGINE = MYISAM ; I have a donations part in the users table also. donation.php [code=php:0]<?php echo "<form action=\"https://www.sandbox.paypal.com/cgi-bin/webscr\" method=\"post\"> <input type=\"hidden\" name=\"cmd\" value=\"_xclick\"> <input type=\"hidden\" name=\"business\" value=\"Business Name\"> <input type=\"hidden\" name=\"item_name\" value=\"item name\"> <input type=\"hidden\" name=\"item_number\" value=\"1\"> <input type=\"hidden\" name=\"currency_code\" value=\"USD\"> <input type=\"hidden\" name=\"receiver_email\" value=\"email\"> <input type=\"hidden\" name=\"mrb\" value=\"R-3WH47588B4505740X\"> <input type=\"hidden\" name=\"pal\" value=\"ANNSXSLJLYR2A\"> <input type=\"hidden\" name=\"no_shipping\" value=\"1\"> <input type=\"hidden\" name=\"no_note\" value=\"1\"> <input type=\"hidden\" name=\"notify_url\" value=\"http//www.URL to script/ipn.php?UID=$userid\"> <input type=\"hidden\" name=\"cancel_return\" value=\"http//www.URL to users script/users.php\"> <input type=\"image\" name=\"submit\" src=\"http://images.paypal.com/images/x-click-butcc-donate.gif\" border=\"0\" alt=\"Make payments with PayPal, it's fast, free, and secure!\"> </form>"; ?>[/code] ipn.php [code=php:0]<?php include "connect.php"; function ipn_verify($seller_email = '', $item_price = '', $currency = ''){   if(!$_POST){     return array('result' => 0);   }   //seed random generator   mt_srand((double)microtime() * 1000000);   $charset = "abcdefghijklmnopqrstuvwxyz12_-34567890ABCDE_FGHIJKLMNOPQRSTWXYZ";   // 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.sandbox.paypal.com', 80, $errno, $errstr, 30);   // assign posted variables to local variables   $item_name = $_POST['item_name'];   $item_number = $_POST['item_number'];   $payment_status = $_POST['payment_status'];   $payment_amount = $_POST['mc_gross'];   $payment_amount = sprintf("%.2f", $payment_amount);   $payment_currency = $_POST['mc_currency'];   $txn_id = $_POST['txn_id'];   $receiver_email = $_POST['receiver_email'];   $payer_email = $_POST['payer_email'];   $trans_details = array('item_name' => $item_name, 'item_number' => $item_number, 'payment_status' => $payment_status, 'payment_amount' => $payment_amount, 'payment_currency' => $payment_currency, 'txn_id' => $txn_id, 'receiver_email' => $receiver_email, 'payer_email' => $payer_email);   if(!$fp){     // HTTP ERROR   }else{     fputs($fp, $header . $req);     while(!feof($fp)){       $res = fgets($fp, 1024);       fclose ($fp);       if((strcmp($res, 'VERIFIED') == 0)){         $failed = 0;         if(($seller_email) && ($seller_email != $receiver_email)){           $failed = 1;         }         if(($item_price) && (sprintf("%.2f", $item_price) < sprintf("%.2f", $payment_amount))){           $failed = 1;         }         if(($currency) && ($currency != $payment_currency)){           $failed = 1;         }         if(!$failed){           $trans_details['result'] = 1;           return $trans_details;         }else{           $trans_details['result'] = 0;           return $trans_details;         }       }elseif(strcmp ($res, 'INVALID') == 0){         $trans_details['result'] = 0;         return $trans_details;       }     }   } } $trans_details = ipn_verify('email'); //same e-mail address as above if($trans_details['result']){   @mysql_query("insert into donations (UID, item_name, item_number, payment_status, payment_amount, payment_currency, txn_id, receiver_email, payer_email) values ('". $_GET['UID'] ."', '". $trans_details['item_name'] ."', '". $trans_details['item_number'] ."', '". $trans_details['payment_status'] ."', '". $trans_details['payment_amount'] ."', '". $trans_details['payment_currency'] ."', '". $trans_details['txn_id'] ."', '". $trans_details['receiver_email'] ."', '". $trans_details['payer_email'] ."')");   $getter = @mysql_fetch_object(mysql_query("SELECT * FROM users WHERE userid='". $_GET['UID'] ."' limit 1"));   $donations = sprintf("%.2f", ($trans_details['payment_amount'] + $getter->donations));   @mysql_query("update users set donations='". $donations ."' where userid='". $_GET['UID'] ."' limit 1");   echo '<center>Thank you for your donation.</center>'; }else{   echo '<center>We\'re sorry but your donation has failed.</center>'; } include "disconnect.php"; ?>[/code] In my sandbox account I went to Profile>Instant Payment Notification> I enabled it and used http//www.URL to script/ipn.php as the URL and saved it. The payments are going in and out of the right accounts as they should, but it's not updating the database. Am I missing something? Thanks, -Chris
  25. yeah good one ChaosXero
×
×
  • 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.