News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

smf external registration problem

Started by aksun, April 29, 2013, 08:54:12 AM

Previous topic - Next topic

aksun

Hi, i'm making webpage with registration form. I'd like to know how can i connect smf registration and my site registration. It is easier to users, when they have to fill just one registration form. Here is my code:
<?php 

// ALKAA

// ASETUKSET

// hae kaikki lomakemuuttujat (get form variables):
$nimi $_POST['nimi'];
$tunnus $_POST['tunnus'];
$posti $_POST['posti'];
$salis $_POST['salis'];
$vahvista $_POST['vahvista'];
$julk $_POST['postijulkaisu'];

// kello asetus(set the clock)
$aika date('H:i d:m:Y');

// aseta ip-tiedot (set ip info)

$ip $_SERVER['REMOTE_ADDR'];

$ip_tiedostossa in_array($iparray_map("trim"file("../kayttajatiedot/ipt.data")));

// KOODIA

// tarkista ip(check ip address that users can register only once)

if ($ip_tiedostossa) {
echo ('IP-osoitteellasi on jo rekisteröity pelaaja. Et voi rekisteröityä uudelleen!');
}

// jos ip ei ole käytetty, rekisteröi käyttäjä
else {
// listaa käyttäjä(put userinfo to files)
// salasanaa ei listata turvallisuus syistä

file_put_contents("../kayttajatiedot/kayttajat.data""{$nimi} | {$tunnus} | {$posti} | {$julk} | {$aika} \n"FILE_APPEND);

// tee foorumi tunnus(make forum user)

include('foorumi/Sources/Subs-Members.php');

registerMember(); // ??????

// näytä onnistuminen
echo ('joo');

// tallenna ip (save ip)

file_put_contents("../kayttajatiedot/ipt.data""{$ip} \n"FILE_APPEND);
}
// PÄÄTTYY

?>


So how can i make that?

Kindred

look at the sticky posts?

Specifically the API.

However, your registration seems significantly less secure than SMF.   

What are you using your "site" registration for?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

aksun

Actually this is a very early version of the system :D, so this is not very secure. Well i don't have any other "softwares" in my site than the smf, so this "registration form" doesn't actually make anything else, than register to smf and save some information to files. So my explanation was a bit confusing i guess. :D Well, i check stiky posts -->.

Kindred

if you are just starting and you expect the forum to be the primary thing on the site, then why don't you use SMF's registration and security?


You can do that by using SSI.php

If you absolutely must have your own system, then I suggest using the integration hooks instead of the API.
with the API, the outside system is primary and SMF is seconded to that system's actions...
with the hooks, SMF is primary, but performs additional actions (like - write collected user data to a second database) within SMF itself and thus, never leaves the SFM security and flow.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

aksun

I checked the integration hooks, but i'm really newbie of those things. I can't use them cuz i don't know, how to setup the integration system, and registeration feature. Can somebody give me some instructions?

Arantor

In fact what is on your site that can't be done with SMF and a portal?

Advertisement: