PHP
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists PHP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 17th, 2008, 03:32 PM
Miles Thompson
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Randomly missing a function

An online signup script is randomly missing part of the task. These scripts
are involved:
sub_signup.php
include/cc_proc.php - does the CC (credit card) processing
include/user_maint.php - inserts the new subscriber into the database

When the CC processing finishes, with the success flag, user_maint.php is
included, and a few lines later the createUser($params) function therein is
called to create the user. Every mysql_ function in user_maint.php is
backstopped with a die() if it fails. But sometimes it appears that the call
to this script, or the createUser() function just isn't made.

What seems to happen, randomly, is that the script "charges on" so to speak,
sending an advisory email to the office manager that there is a new
subscriber, and calling sub_signup_thanks.php, which displays a completion
message, etc.

In all of these cases the credit card processing has succeeded. Sometimes
people have tried to sign up two or three times, the card processes, but no
addition is made to the database. It's driving us nuts! Any thoughts?

Regards - Miles

Infrastructure: Apache 2.2, PHP 5.x, MySQL 5

Code:
switch ($ret) {
case CC_SUCCESS:
require 'include/user_maint.php';
$cctype = cc_getCardType($cc);
if ($cctype == 'Visa') $cctype = 'VISA';
elseif ($cctype == 'MasterCard') $cctype = 'M-C';
//Shouldn't happen in case CC_SUCCESS, but better safe than sorry
else die('We don\'t support this credit card');

$params = array(
'firstname' =$first,
// various fields
'postal_code' =$postal_code,
'pay_method' =$cctype
);
// createUser is a function in user_maint
createUser($params);
// sendEmail is func in user_maint, advises office manager
sendEmail('New subscriber!!!', "Already paid $amount by credit
card", $fields);
require 'sub_signup_thanks.php'; //Grabs authCode from $result
return;

} //other situations dealt with, and properly closed

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists PHP > Randomly missing a function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
Stay green...Green IT