cmgmyr
Members-
Posts
1,278 -
Joined
-
Last visited
Never
Everything posted by cmgmyr
-
I will give you some help too if you need it. I like your logo. -Chris
-
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
-
Yeah, I was right. Check this out: http://www.zend.com/manual/language.operators.comparison.php
-
I believe it is "not equal to" try replacing it with != and see if you get the same result. -Chris
-
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
-
No problem, I hope it worked out for you. -Chris
-
Before and After - a major difference or not?
cmgmyr replied to extrovertive's topic in Website Critique
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 -
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
-
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
-
no your mysql_connect it just looked like host generated information...Just trying to save your skin if it was your real info :)
-
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
-
I hope that isn't your real connect information...if it is, I would edit that out ASAP!!!
-
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
-
Thank you for that! I like phpMyAdmin it is a great tool to have and use. It saves soooo much time!
-
It just keeps doing a page refresh for me.
-
can you please show us some code?
-
you can also go to "Operations" in phpMyAdmin
-
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
-
yeah...needs lots - o - work
-
at the bottom of the ipn.php
-
yes, so why isn't it getting back?
-
I don't believe so. Since it's not updating the database, I'm assuming that it's not coming back.
-
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
-
yeah good one ChaosXero