PHP registration PHP registration
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

PHP registration

Started by panner, October 18, 2010, 10:10:01 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

panner

Hi;

Is it possible to automatically register a new user using PHP code?
(for example using an email address as a user name and password)

If so -- do you have any hints about what the code should look like?

Thanks....

Ron

Αndré

Not sure what you're asking for. Please elaborate.

panner

Andre

I want to automatically register customers who purchase my online product into my Coppermine system. Sort of a bonus feature.

To do this I would take their purchase information (i.e. email address and product number) to use for the registration name and password.

Now I need some PHP code that will transmit the purchase information to the Coppermine system. For example -- log into the registration system or perhaps just make entries into the MySQL database (if that would work)...

Ron

Αndré

Just adding a new row to Coppermine's users table should work. Ideally, you would bridge Coppermine with your existing application.

panner

Andre

Sorry, I'm just a newbie -- I don't understand your comments. How do I add a new row to Coppermines user table? Where do I find the user table? What is bridging and how do I do that?

Could you elaborate a bit more or perhaps give me a link to more specific information.

Ron

Αndré

Quote from: panner on October 20, 2010, 04:25:42 PM
How do I add a new row to Coppermines user table? Where do I find the user table?
=
Quote from: panner on October 20, 2010, 04:00:36 PM
make entries into the MySQL database


Quote from: panner on October 20, 2010, 04:25:42 PM
What is bridging and how do I do that?
http://documentation.coppermine-gallery.net/en/bridging.htm


Quote from: panner on October 20, 2010, 04:25:42 PM
Could you elaborate a bit more or perhaps give me a link to more specific information.
http://documentation.coppermine-gallery.net/en/

panner

Thanks Andre -- you've been a really really big help.
I'm sure we all wish we had as much knowledge as you think you have.
Too bad your mamma never taught you about sharing :-)

Does anyone else out there know what Andre is talking about..
Anyone have any idea how to use PHP code to make an entry into a Coppermine table in MySQL...

The key here is that I need some PHP code --

Ron

Αndré

Quote from: panner on October 20, 2010, 05:03:43 PM
The key here is that I need some PHP code --
You don't need that code for Coppermine, but for your other web application while a user registers there. There you have to add just one simple SQL query (almost no PHP knowledge required) that puts the user data in Coppermines user table.

Here's a draft of that magic line:
mysql_query("INSERT INTO {insert coppermine table name here} (user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6, user_language) VALUES ({insert comma seperated values here})");
Of course you have to connect to the correct database (if needed) and selected the correct database (if needed) before executing that line. Please read the PHP docs if you don't know how to do that, e.g. http://www.php.net/manual/en/function.mysql-select-db.php


Quote from: panner on October 20, 2010, 05:03:43 PM
Too bad your mamma never taught you about sharing :-)
Well, maybe you should also share some information about your environment. You haven't followed the board rules, so you should be grateful that you get an answer at all. We cannot help you if you don't tell us what you are using.

panner

Andre;

So what you are saying is that all I need to do is work with the Coppermine MySQL database directly?

BTW: your "magic line" does not show up in Internet Explorer -- but I was able to get it in FireFox
That's exactly what  I was looking for -- some way to tap into the Coppermine database.

Thanks Andre -- this information is much more useful and helpful -- at least it gives me something to work with.

Re: my sharing probably isn't much relative... I'm using a Unix Server "ixwebhosting" and the Coppermine system is not active yet. (I'm still trying to set it up).

Ron

Αndré

Quote from: panner on October 20, 2010, 05:35:03 PM
So what you are saying is that all I need to do is work with the Coppermine MySQL database directly?
Yes. That's basicly what Coppermine does as well. Of course there are additional checks if the user already exists and if the provided information is valid etc.

panner

Thanks Andre; Much appreciated.

... now that wasn't so hard was it?

Ron