Jump to content

Actionhooks connecting to DB


stevewilliams

Recommended Posts

Can someone tell me whats wrong with my actionhooks.php?

 

Each time a customer signs up, it gets to step5 in the order process and when they submit their information, the screen goes blank and the information is NOT passed to the DB outlined in actionhooks.php.

 

Here's what I have:

 

define("ACTIONHOOKSINC",true);

function actionhook_ClientSignup($vars) {


# This function runs when a new user signs up through the shopping cart or registration page
# $vars["ID"]     df_users id, df_users_permissions id, df_users_permissions uid 
# $vars["FirstName"]      df_users name
# $vars["LastName"]     
# $vars["CompanyName"]      df_users username
# $vars["Email"]      df_users email
# $vars["Address1"]     
# $vars["Address2"]
# $vars["City"]
# $vars["State"]
# $vars["Postcode"]
# $vars["Country"]
# $vars["PhoneNumber"]
# $vars["Password"]     df_users password

// Make a MySQL Connection
mysql_connect("localhost", "user", "password") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());

mysql_query("INSERT INTO df_users 
(id, username, password, activated, email, name) VALUES('$vars["ID"]', '$vars["CompanyName"]', '1', '$vars["Email"]', '$vars["FirstName"]' ) ") 
or die(mysql_error());  

mysql_query("INSERT INTO df_users_permissions 
(id, uid, admin_type, upload, download, email, share, users_may_see) VALUES('$vars["ID"]', '$vars["ID"]', 'indep', '1', '1', '1', '1', '-ALL-' ) ") 


or die(mysql_error());  


}

 

Of course, I have replaced the DB name, username and password with the correct information.

 

Any help is certianly appreciated.

 

Thank you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated