Anyone used Zubrag.com's Password Protect Advanced?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CyndiSmith
Forum Newbie
Posts: 2
Joined: Sat May 10, 2008 9:20 pm

Anyone used Zubrag.com's Password Protect Advanced?

Post by CyndiSmith »

Hi, all - I hope this is the right place to post this... I've just plugged Zubrag.com's Password Protect Advanced into my website and am testing it for a client's site. Everything is working just peachy, but I added some new fields to the signup form. I tried to follow the directions in updating the other relevant files and the code, but I'm doing SOMETHING wrong. MY DATA IS NOT POSTING TO THE DATABASE.

I also asked this question in Zubrag's forum here:
http://www.zubrag.com/forum/index.php/t ... ml#msg1717

Hi! Thanks again for this great code… I’m quite the NEWBIE at this, but have found your instructions very easy to follow and extremely helpful. Here’s where I am now:

1. The "Password Protect Advanced" program is set up and it’s working great. E-mail retrieval of username & password works great, too.

2. I’ve added new fields to the signup form, plus I’ve added an “access code” that requires people to have that special code before they can sign up. Hopefully, all the required code updates have been made in the user.def file, signup_form.php, and signup.php. (see code below)

3. After following all the instructions for adding elements to the signup form,
I am still not getting data posted to the users file (so that I can see it in managers.php).

**When I access the managers page, all the database columns are blank except for user, password – I need to capture their first and last names.




Here's my code:

user.def file

Login,STRING,15
Password,STRING,12
Email,STRING,30
First Name,STRING,20
Last Name,STRING,20
Redirect URL,STRING,10

signup_form.php (note, I’m also using the “access code” function, and it works great!)

<form method="post">
<h3>User Registration and Authentication</h3>
<font color="red"><?php echo $this->error; ?></font>
<br />
Login: ( Create User Name)<br /><input type='input' name='access_login' value='<?php echo $this->login ?>'/>
<br />
Password:<br />
<input type="password" name="access_password" />
<?php if (USE_EMAIL && !LOGIN_AS_EMAIL) echo "<br />Email:<br /><input type='input' name='access_email' value='$this->email' />"; ?>
<br>
<span class="style4">First Name:</span><br />
<input type='input' name='FirName' value='<?php echo $this->FirName ?>' />
<br />
<span class="style4">Last Name:</span><br />
<input type='input' name='LasName'value='<?php echo $this->LasName ?>' />
<br />
<br />
<span class="style4">Secret Access Code:</span><br />
<input type='input' name='access_code'value= >
<p>
<input type="submit" name="access_submit" value="Sign up" />
</p>
</form>


signup.php file

function parse_user_input() {
$this->login = isset($_POST['access_login']) ? $_POST['access_login'] : '';
$this->pass = $_POST['access_password'];
$this->email = LOGIN_AS_EMAIL
? $this->login
: (isset($_POST['access_email']) ? $_POST['access_email'] : '');
$this->FirName = $_POST['first_name'];
$this->LasName = $_POST['last_name'];
$this->code = $_REQUEST['access_code'];


function save_user() {
// save user to database
$fusers = fopen(USERS_LIST_FILE,'a+');
if (!$fusers) {
$this->error = "Cannot add user to database.";
return false;
}
fputs($fusers, "\n" . $this->login. ',' . $this->pass . ',' . $this->email . ',' . $this->FirName . ',' . $this->LasName);
fclose($fusers);



If there's any way I can help somebody help me here, please let me know. And apologies if this is posted in the wrong place.

MANY THANKS!

Cyndi
Post Reply