vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   AddNew User Into........ (https://vborg.vbsupport.ru/showthread.php?t=64549)

Logitech-2004 04-29-2004 08:57 PM

AddNew User Into........
 
I Build A Nifty Little Shoping Cart, And It Has It's Own Member Management System, But I Wanted To Add A Small Code To Add The User Into The VB3 Database, But My SQL Query Must Be Wrong.... Or Something. Worked Great In Vb2.3.3.

Code:

        $query="INSERT INTO user (usergroupid,username,password,passworddate,email,styleid,usertitle,salt,daysprune,reputation,pmpopup,startofweek,pmtotal,pmunread,threadedmode,autosubscribe,maxpost,referrerid,birthday_search,option,autosubscribe) VALUES ('$usergroupid','$username','$saltedpassword','$transactiondate','$email','0','$title','$salt','0','10','1','1','0','0','0','-1','-1','0','0000-00-00','6487','-1')";
        mysql_query($query);
        $userid=mysql_insert_id();
        $query="INSERT INTO userfield SET userid='$userid'";
        mysql_query($query);
        mysql_close();

Any Ideas?

Mr. HillBilly 04-29-2004 09:01 PM

Wrong area.

Xenon 04-29-2004 09:02 PM

*moved*

Logitech-2004 05-01-2004 06:34 PM

Anybody?

insanctus 05-01-2004 06:38 PM

Are you getting any errors ?

Or is it just not inserting?

Logitech-2004 05-01-2004 07:49 PM

Not Inserting.

Logitech-2004 05-01-2004 07:52 PM

Heres Some The Info:
Code:

                                $membershipstatus="Active";
                                $membershipexp=date('Ymd',time()+365*24*3600);
                                $membershippackage="PackageC";
                                $transactiontype="PackageC";
                                $transactiondate=date('Ymd',time());
                                $transactionamount=$HTTP_POST_VARS['mvc_MONEY'];
                                $transactionid=$HTTP_POST_VARS['transaction_id'];
                                $usergroupid="9";
                                $transactionprocessor="MVC";
                                $softwarekeys=2;
                                $title='Private Memeber';

        $username=$HTTP_POST_VARS['mvc_NICK'];
        $password=$HTTP_POST_VARS['mvc_PASSWORD'];
        $nomd5pass=$HTTP_POST_VARS['mvc_PASSWORD'];
        $password=md5(md5($password));
        $email=$HTTP_POST_VARS['mvc_EMAIL'];
        $salt='AbC'; <- I Change That Every Day.
        $saltedpassword=md5(md5($password) . $salt);


Logitech-2004 05-02-2004 03:57 AM

Well I Got That Fixed... Next Problem Is, Am I Doing The Password Encoding Correctly?
Code:

$nomd5pass=$HTTP_POST_VARS['mvc_PASSWORD'];
$salt="AbC";
$saltedpassword=md5(md5($nomd5pass) . $salt);


Logitech-2004 05-02-2004 06:11 AM

Ok I Think I Got The Passwird Thing Worked Out. But VBull. Is Saying The Password Is Wrong Or The User Name Is Invalid.... :(

Heres The Entire Code.
Code:

//POST Vars.
        $username=$HTTP_POST_VARS['mvc_NICK'];
        $nomd5pass=$HTTP_POST_VARS['mvc_PASSWORD'];
        $password=md5(md5($password));
        $email=$HTTP_POST_VARS['mvc_EMAIL'];
        $salt="AbC";

//PASSWORD
        if (strlen(md5($nomd5pass)) == 32) {
                $saltedpassword=md5($nomd5pass . $salt);
        } else {
                $saltedpassword=md5(md5($nomd5pass) . $salt);
        }

//Add User To The VB3 Database.
        $query="INSERT INTO user (usergroupid,displaygroupid,username,password,passworddate,email,parentemail,usertitle,salt) VALUES ('$usergroupid','$usergroupid','$username','$password','$transactiondate','$email','$email','$title','$salt')";
       
        mysql_query($query);
        $userid=mysql_insert_id();
        $query="INSERT INTO userfield SET userid='$userid'";
        mysql_query($query);
        $query="INSERT INTO usertextfield (userid) VALUES ($userid)";
        mysql_query($query);

Help......

Logitech-2004 05-16-2004 04:45 AM

Did I Ask To Hard Of A Question? It Must Be Simple For You Advace Coders ;)


All times are GMT. The time now is 08:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01010 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete