News:

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

Main Menu

integration..sort of...

Started by Street Nova, November 17, 2006, 07:49:02 PM

Previous topic - Next topic

Street Nova

I like the SMF platform but I'm having problems integrating it into my current site.

I can call my info from the DB and echo it to a page in the /forum folder:

<?
## v5.00 -> mar. 20, 2006, 3.39
session_start();
if ($_SESSION['membersarea']!="Active") {
    header ("Location: login.php?redirect=t2");
}

$name2 =  $_SESSION['membername'];



?>

<form name=allusers method="post" action="<?php echo $_SERVER['SCRIPT_NAME']?>">  <INPUT TYPE="text" NAME="username" value="<?php echo "$name2"; ?>"> </FORM>
.
.
.
: but when I try to integrate that into the register page all I get is " $name2 " or "?php echo $name2"

in the text box. can anybody help me "prefill" the registration form so it is a simple click to register on the site?
-Thanks!

Petr1fied

Wouldn't it be easier to create accounts for all your members in one fail swoop using the info in the database and then from that point forward creating their SMF accounts automatically from the post at signup?

Well maybe not easier but I'm working on something exactly like that myself so that I can integrate SMF with my site, I know the password hashing on my current site is just standard MD5 and SMF will update them to it's own hashing system as the member logs in so I can run a php script to copy the relevent data for each member to the smf_members table easy enough.

The next step is adding a small amount of code when they sign up at my site that sends an additional query to the smf_members table hashing the password using the correct SMF algorithm and while I'm at it I'll also create a cookie that logs them in to SMF automatically too.

I've already got the cookie part figured out and in doing that I know how to hash the plain text passwords in the same way SMF requires and generating a random salt string for each user should be easy enough to do.

Once I have all that sorted I can just turn off registration in SMF and let my main site do all the hard work. Well that's the theory anyway but I'm sure I can do it. ;)

Advertisement: