Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-13-2005, 05:25 PM help with postback
Junior Talker

Posts: 2
Trades: 0
I'm trying grab and insert into a mysql database table some users info when they sign up using ccbill. here's what i'm using....can someone direct me to some sources or help fix this. I'm willing to pay someone who can write one that works.

basically....i'm trying to do a postback with ccbill.
PHP Code:
<?php 
### LISTING OF ipn.php 
define ("DBHOST""localhost"); 
define ("DBNAME""mydb"); 
define ("DBUSER""myuser"); 
define ("DBPASS""mypass"); 

### CONNECT TO THE DATABASE 
function DatabaseConnect() { 
    if (!(
$mylink mysql_connect(DBHOSTDBUSERDBPASS))) { 
        echo 
mysql_error(); 
        exit; 
    } 
//fi 
    
mysql_select_db(DBNAME) or die(mysql_error()); 
// end function 

DatabaseConnect(); // this will automatically connect us 

// below supported vals that CC Bill posts to us, this list is exhaustive.. but 
// without notify_version and verify_sign NOTE: if in is not in this array, it 
// is not going in the database. 

$ccbill_vals = array("customer_fname""customer_lname""email"
    
"username""password""price""start_date""phone_number" 
    
); 

// build insert statement 
while (list ($key$value) = each ($HTTP_POST_VARS)) { 
    if (
in_array ($key$ccbill_vals)) { 
        if (
is_numeric($value)) { 
            
$addtosql .= $key=$value,"
        } else { 
            
$newval urlencode($value); 
            
$topost .= "&$key=$newval"//used later in reposting 
            
$value addslashes($value); 
            
$addtosql .= $key='$value',"
        } 
//fi 
    
//fi 
    
$entirepost .= "[$key]='$value',"
//wend 

$entirepost addslashes($entirepost); // just in case.. 

$addtosql substr("$addtosql"0, -1).";"//chop trailing "," replace with ";" 

$sql1 
    INSERT INTO users
    SET date=now(), entirepost='
$entirepost',"$addtosql
mysql_db_query(DBNAME$sql1) or die($sql1); 


//fi     
### END LISTING OF ipn.php 
?>

Last edited by 0beron; 08-13-2005 at 06:14 PM..
mathieu67 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to help with postback
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09351 seconds with 12 queries