djchapperz Posted February 12, 2010 Share Posted February 12, 2010 Hello. I am new to PHP, I no HTML and was told PHP easy if you no HTML but I don't agree. Anyway I am currently building my site and I have picked up a script online and I have customized to my likings so far but when i put the links from the readme onto the website some of the PHP don't want to work. I have uploaded all 6 links to my site which lead to user creation, logout and everything but when you click the link there a error on the page. You can find the errors on this page http://www.djchapperz.co.cc/user.html Could someone please point me in the write direction. If this helps I can get PHP on my server and MySql and I have access to files if you need them Many thanks in return Dan Quote Link to comment https://forums.phpfreaks.com/topic/191921-php-user-accounts-problems/ Share on other sites More sharing options...
KevinM1 Posted February 12, 2010 Share Posted February 12, 2010 Looking at your site won't tell us much. We need to actually see the PHP, which isn't visible in the HTML source code. I no HTML and was told PHP easy if you no HTML but I don't agree. Whoever told you this is a moron. If you see/hear from them again, tell them such. PHP is a server side scripting language. HTML is a markup language that cannot perform any logic. PHP can write HTML, but it has no similarity to HTML at all. Quote Link to comment https://forums.phpfreaks.com/topic/191921-php-user-accounts-problems/#findComment-1011560 Share on other sites More sharing options...
djchapperz Posted February 13, 2010 Author Share Posted February 13, 2010 Thank you for your reply. The script has alot of PHP code but I guess you only need the ones with the page's in question. Please find them below. register.php <?php /************* Membership V2.0 *******************/ /* Released by AwesomePHP.com, under the GPL License, a copy of it should be attached to the zip file, or you can view it on http://AwesomePHP.com/gpl.txt */ /************* Membership V2.0 *******************/ /* The next line is to be placed on top-most of your site: */ //require_once('extensions/register.php'); require_once('languages/language.php'); ?> <form name="register" id="register" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" style="display:inline;"> <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr> <td colspan="2"><div align="center"><font color="#999999" size="4">Register for an account</font></div></td> </tr> <?php if($message != NULL){ ?> <tr bgcolor="#FFDDDD"> <td colspan="2"><strong><font color="#FF0000"><?php echo $message;?></font></strong></td> </tr> <?php } ?> <tr> <td width="50%">Your name: </td> <td width="50%"><input name="user_name" type="text" id="user_name" value="<?php echo $_POST['user_name'];?>"> [Required] </td> </tr> <tr> <td width="50%">Your email: </td> <td width="50%"><input name="user_email" type="text" id="user_email" value="<?php echo $_POST['user_email'];?>"> [Required<?php if($CF_E_VER == 1){echo ' AND requires confirmation';}?>] </td> </tr> <tr> <td width="50%">Keep yourself updated on new stuff, care to join our mailing list? </td> <td width="50%"><?php if($_POST['user_in_list'] == '1' || $_POST['user_in_list'] == NULL){$sel = ' checked';}else{$sel=NULL;}?> <input name="user_in_list" type="radio" value="1"<?php echo $sel;?>> Yes <?php if($_POST['user_in_list'] == '2'){$sel = ' checked';}else{$sel=NULL;}?> <input name="user_in_list" type="radio" value="2"<?php echo $sel;?>> No</td> </tr> <tr> <td>Please select a password: </td> <td width="50%"><input name="user_password" type="password" id="user_password" value=""> [Required] </td> </tr> <tr> <td>Re-enter the password: </td> <td width="50%"><input name="user_password2" type="password" id="user_password2"> [Required] </td> </tr> <?php foreach($array_custom as $field){ ?> <tr> <td><?php echo $field['field_name'];?></td> <td width="50%"><input name="fieldxy_<?php echo $field['field_id'];?>" type="text" id="fieldxy_<?php echo $field['field_id'];?>" value="<?php echo $_POST['fieldxy_'.$field[field_id]];?>"> <?php if($field['is_required'] == 1){ echo '[Required]';} ?> </td> </tr> <?php } if($CF_CAPTHCA == 'IMAGE'){?> <tr> <td>Enter Verification Code: </td> <td><table border="0" cellspacing="0" cellpadding="5"> <tr> <td class="acont"><div align="center"> <?php $referenceid = md5(mktime()*rand()); //Generate the random string $chars = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k", "K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v", "V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8","9"); $length = $CF_LENGH; $textstr = ""; for ($i=0; $i<$length; $i++) { $textstr .= $chars[rand(0, count($chars)-1)]; } $new_string = encode_decode($textstr,$CF_ENCDEC); $image_link = bin2hex($new_string); ?> <img src="captcha.php?code=<?php echo $image_link;?>"> <input name="registration_id" type="hidden" id="registration_id" value="<?php echo $image_link;?>"> </div></td> </tr> <tr> <td class="acont"><div align="center"> <input name="answer" type="text" id="answer"> </div></td> </tr> </table></td> </tr> <?php } else { $f = fopen($CF_QUESTIONFILE,'r'); while($t = fread($f,102465)){ $content .= $t; } fclose($f); $content = trim(preg_replace('/\/\*.*\*\//ism', '', $content)); $temp = explode("\n",$content); $random = rand(0,count($temp)-1); $rand = $temp[$random]; list($question,$registration_id) = explode('\n\\',$rand); $registration_id = bin2hex(encode_decode($registration_id,$CF_ENCDEC)); ?> <tr> <td>Answer this: <strong><?php echo $question;?></strong> </td> <td><input name="answer" type="text" id="answer" value="<?php echo $_POST['answer'];?>"> <input name="registration_id" type="hidden" id="registration_id" value="<?php echo $registration_id;?>"></td> </tr> <?php } ?> <tr> <td colspan="2"><div align="center"> <input type="submit" name="Submit" id="Submit" value="Register"> <input name="S_ID" type="hidden" id="S_ID" value="4"> </div></td> </tr> <tr> <td colspan="2"><div align="center">[<a href="login.php">Login</a> - <a href="forgotpass.php">Forgot Password</a>] </div></td> </tr> </table> </form> login.php <?php /************* Membership V2.0 *******************/ /* Released by AwesomePHP.com, under the GPL License, a copy of it should be attached to the zip file, or you can view it on http://AwesomePHP.com/gpl.txt */ /************* Membership V2.0 *******************/ /* Login header - The following line MUST be included on TOPMOST of your website then put the form whereever you want. This is so, because we might need to redirect and PHP CAN NOT redirect after any output to the browser */ /* The next line is to be placed on top-most of your site: */ //require_once('extensions/login.php'); require_once('languages/language.php'); ?> <form name="login" id="login" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" style="display:inline;"> <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><font color="#999999" size="4">User Login </font></div></td> </tr> <?php if($message != NULL){ ?> <tr bgcolor="#FFDDDD"> <td colspan="2"><strong><font color="#FF0000"><?php echo $message;?></font></strong></td> </tr> <?php } ?> <tr> <td>Select Membership: </td> <td width="50%"><font size="2"> <select id="membership_id" name="membership_id" class="hiddenText"> <?php foreach($membershipList as $em){ if($_POST['membership_id'] == $em['membership_id']){ $sel= ' selected';}else{$sel=NULL;} echo '<option value="'.$em['membership_id'].'"'.$sel.'>'.$em['membership_title'].'</option>'; } ?> </select> </font></td> </tr> <tr> <td width="50%">Please enter Email: </td> <td width="50%"><input name="user_email" type="text" id="user_email" value="<?php echo $_POST['user_email'];?>"> </td> </tr> <tr> <td>Please enter Password: </td> <td width="50%"><input name="user_password" type="password" id="user_password"></td> </tr> <?php if($CF_CAPTHCA == 'IMAGE'){?> <tr> <td>Enter Verification Code: </td> <td><table border="0" cellspacing="0" cellpadding="5"> <tr> <td class="acont"><div align="center"> <?php $referenceid = md5(mktime()*rand()); //Generate the random string $chars = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k", "K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v", "V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8","9"); $length = $CF_LENGH; $textstr = ""; for ($i=0; $i<$length; $i++) { $textstr .= $chars[rand(0, count($chars)-1)]; } $new_string = encode_decode($textstr,$CF_ENCDEC); $image_link = bin2hex($new_string); ?> <img src="captcha.php?code=<?php echo $image_link;?>"> <input name="registration_id" type="hidden" id="registration_id" value="<?php echo $image_link;?>"> </div></td> </tr> <tr> <td class="acont"><div align="center"> <input name="answer" type="text" id="answer"> </div></td> </tr> </table></td> </tr> <?php } else { $f = fopen($CF_QUESTIONFILE,'r'); while($t = fread($f,102465)){ $content .= $t; } fclose($f); $content = trim(preg_replace('/\/\*.*\*\//ism', '', $content)); $temp = explode("\n",$content); $random = rand(0,count($temp)-1); $rand = $temp[$random]; list($question,$registration_id) = explode('\n\\',$rand); $registration_id = bin2hex(encode_decode($registration_id,$CF_ENCDEC)); ?> <tr> <td>Answer this: <strong><?php echo $question;?></strong> </td> <td><input name="answer" type="text" id="answer" value="<?php echo $_POST['answer'];?>"> <input name="registration_id" type="hidden" id="registration_id" value="<?php echo $registration_id;?>"></td> </tr> <tr> <td colspan="2"><div align="center"> <input id="persistent" name="persistent" value="yes" checked="checked" type="checkbox"> Keep me signed in<br> <font color="#999999" size="2">for <select name="persistentFor" id="persistentFor" style="border:0px;color:#999999;font-size:10px;"> <?php if($_POST['persistentFor'] == NULL){$_POST['persistentFor'] = 2;} for($x=1;$x<=480;$x++){ if($x == $_POST['persistentFor']){$sel= ' selected';}else{$sel=NULL;} echo '<option value="'.$x.'"'.$sel.'>'.$x.'</option>'; } ?> </select> week unless I sign out.<br/> [uncheck if on a shared computer] </font> </div></td> </tr> <?php } ?> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"> <input type="submit" name="Submit" id="Submit" value="Login"> <input name="S_ID" type="hidden" id="S_ID" value="2"> </div></td> </tr> <tr bgcolor="#CAFFCA"> <td colspan="2"><div align="center">[<a href="forgotpass.php">Forgot Password </a> - <a href="register.php">Register</a>] </div></td> </tr> </table> </form> forgotpass.php <?php /************* Membership V2.0 *******************/ /* Released by AwesomePHP.com, under the GPL License, a copy of it should be attached to the zip file, or you can view it on http://AwesomePHP.com/gpl.txt */ /************* Membership V2.0 *******************/ /* The next line is to be placed on top-most of your site: */ //require_once('extensions/forgotpass.php'); /* Check forgot password (your form must have S_ID set to 1 */ require_once('languages/language.php'); ?> <form name="forgotpass" id="forgotpass" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" style="display:inline;"> <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr> <td colspan="2"><div align="center"><font color="#999999" size="4">Forgot password</font></div></td> </tr> <?php if($message != NULL){ ?> <tr bgcolor="#FFDDDD"> <td colspan="2"><strong><font color="#FF0000"><?php echo $message;?></font></strong></td> </tr> <?php } ?> <tr> <td width="50%">Please enter your email: </td> <td width="50%"><input name="user_email" type="text" id="user_email" value="<?php echo $_POST['user_email'];?>"> </td> </tr> <?php if($CF_CAPTHCA == 'IMAGE'){?> <tr> <td>Enter Verification Code: </td> <td><table border="0" cellspacing="0" cellpadding="5"> <tr> <td class="acont"><div align="center"> <?php $referenceid = md5(mktime()*rand()); //Generate the random string $chars = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G","h","H","i","I","j","J","k", "K","l","L","m","M","n","N","o","O","p","P","q","Q","r","R","s","S","t","T","u","U","v", "V","w","W","x","X","y","Y","z","Z","1","2","3","4","5","6","7","8","9"); $length = $CF_LENGH; $textstr = ""; for ($i=0; $i<$length; $i++) { $textstr .= $chars[rand(0, count($chars)-1)]; } $new_string = encode_decode($textstr,$CF_ENCDEC); $image_link = bin2hex($new_string); ?> <img src="captcha.php?code=<?php echo $image_link;?>"> <input name="registration_id" type="hidden" id="registration_id" value="<?php echo $image_link;?>"> </div></td> </tr> <tr> <td class="acont"><div align="center"> <input name="answer" type="text" id="answer"> </div></td> </tr> </table></td> </tr> <?php } else { $f = fopen($CF_QUESTIONFILE,'r'); while($t = fread($f,102465)){ $content .= $t; } fclose($f); $content = trim(preg_replace('/\/\*.*\*\//ism', '', $content)); $temp = explode("\n",$content); $random = rand(0,count($temp)-1); $rand = $temp[$random]; list($question,$registration_id) = explode('\n\\',$rand); $registration_id = bin2hex(encode_decode($registration_id,$CF_ENCDEC)); ?> <tr> <td>Answer this: <strong><?php echo $question;?></strong> </td> <td><input name="answer" type="text" id="answer" value="<?php echo $_POST['answer'];?>"> <input name="registration_id" type="hidden" id="registration_id" value="<?php echo $registration_id;?>"></td> </tr> <?php } ?> <tr> <td colspan="2"><div align="center"> <input type="submit" name="Submit" id="Submit" value="Get Pass"> <input name="S_ID" type="hidden" id="S_ID" value="1"> </div></td> </tr> <tr> <td colspan="2"><div align="center">[<a href="login.php">Login</a> - <a href="register.php">Register</a>] </div></td> </tr> </table> </form> profile.php <?php /************* Membership V2.0 *******************/ /* Released by AwesomePHP.com, under the GPL License, a copy of it should be attached to the zip file, or you can view it on http://AwesomePHP.com/gpl.txt */ /************* Membership V2.0 *******************/ /* The next line is to be placed on top-most of your site: */ //require_once('extensions/profile.php'); require_once('languages/language.php'); ?> <form name="profile" id="profile" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" style="display:inline;"> <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><strong><font color="#999999" size="4">Your Profile </font></strong></div></td> </tr> <?php if($message != NULL){ ?> <tr bgcolor="#FFDDDD"> <td colspan="2"><strong><font color="#FF0000"> <?php echo $message;?> </font></strong></td> </tr> <?php } ?> <tr> <td width="50%">Username:</td> <td width="50%"><input name="user_name" type="text" id="user_name" value="<?php echo $_POST['user_name'];?>"> [Required] </td> </tr> <tr> <td width="50%">Your email: </td> <td width="50%"><input name="user_email" type="text" id="user_email" value="<?php echo $_POST['user_email'];?>"> [Required <?php if($CF_E_VER == 1){echo ' AND requires confirmation if changed.';}?> ] </td> </tr> <tr> <td width="50%">Keep yourself updated on new stuff, care to join our mailing list? </td> <td width="50%"><?php if($_POST['user_in_list'] == '1' || $_POST['user_in_list'] == NULL){$sel = ' checked';}else{$sel=NULL;}?> <input name="user_in_list" type="radio" value="1"<?php echo $sel;?>> Yes <?php if($_POST['user_in_list'] == '2'){$sel = ' checked';}else{$sel=NULL;}?> <input name="user_in_list" type="radio" value="2"<?php echo $sel;?>> No</td> </tr> <?php if($recrod_nums <= 0){ echo '<tr><td colspan="2"><strong>No custom fields on system.</strong></td></tr>'; } else { $array_list = explode("\n",$_POST['custom_fields']); foreach($array_list as $line){ $line = trim($line); if($line){ //Format list($id,$value) = explode('{+|%|+}',$line); $id = substr($id,1,-1);$value = substr($value,1,-1); $_POST["cusfield_$id"] = $value; } } foreach($arrayFields as $each){?> <tr> <td><?php echo $each['field_name'];?>:</td> <td width="50%"><input name="cusfield_<?php echo $each['field_id'];?>" type="text" id="cusfield_<?php echo $each['field_id'];?>" value="<?php echo $_POST['cusfield_'.$each['field_id']];?>"></td> </tr> <?php } } if($CF_E_DEL == 1 AND $_POST['allow_delete'] == 1){?> <tr> <td><strong><font color="#FF0000">DELETE ACCOUNT (can't be undone): </font></strong> <div align="center"> </div></td> <td><input name="deleteaccount" type="checkbox" id="deleteaccount" value="yes"> Check To Delete Account <strong><font size="2">[You will be automatically loged out] </font></strong></td> </tr> <?php } ?> <tr> <td>Enter current password to update profile:</td> <td width="50%"><input name="user_password" type="password" id="user_password" value=""> </td> </tr> <tr> <td colspan="2"><font color="#0000FF">Create a new password: </font></td> </tr> <tr> <td>Enter new password: </td> <td width="50%"><input name="new_password" type="password" id="new_password"></td> </tr> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><strong><font color="#999999" size="4">Membership Info </font></strong></div></td> </tr> <tr> <td>Current Membership: </td> <td><strong><?php echo $get_membership['membership_title'];?></strong></td> </tr> <?php if($get_membership['membership_free'] != 1){ ?> <tr> <td>Current Membership Rate: </td> <td><strong><?php if($get_payment['rate_amount'] <= 0){ echo 'You paid nothing.'; } else { echo 'You paid $'.$get_payment['rate_amount'].' On: '. format_date($get_payment['payment_date']); ?></strong></td> </tr> <tr> <td>Membership Expires: </td> <td><strong><?php echo $daysDiffer.' Days'; ?></strong></td> </tr> <?php } }?> <tr> <td colspan="2"><div align="center">[<a href="upgrade.php">Upgrade Membership</a>]</div></td> </tr> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"> <input type="submit" name="Submit" id="Submit" value="Update Profile"> <input name="S_ID" type="hidden" id="S_ID" value="3"> </div></td> </tr> <tr bgcolor="#CAFFCA"> <td colspan="2"><div align="center"><a href="logout.php">[Log out]</a> </div></td> </tr> </table> </form> upgrade.php <?php /************* Membership V2.0 *******************/ /* Released by AwesomePHP.com, under the GPL License, a copy of it should be attached to the zip file, or you can view it on http://AwesomePHP.com/gpl.txt */ /************* Membership V2.0 *******************/ /* The next line is to be placed on top-most of your site: */ //require_once('extensions/upgrade.php'); /* Language File */ require_once('languages/language.php'); ?> <form name="upgrade" id="upgrade" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" style="display:inline;"> <table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><strong><font color="#999999" size="4">Upgrade Your Membership </font></strong></div></td> </tr> <?php if($message != NULL){ ?> <tr bgcolor="#FFDDDD"> <td colspan="2"><strong><font color="#FF0000"> <?php echo $message;?> </font></strong></td> </tr> <?php } ?> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><strong><font color="#999999" size="4">Current Membership Info </font></strong></div></td> </tr> <tr> <td width="50%">Current Membership: </td> <td width="50%"><strong><?php echo $get_membership['membership_title'];?></strong></td> </tr> <?php if($get_membership['membership_free'] != 1){?> <tr> <td>Current Membership Rate: </td> <td><strong><?php if($get_payment['rate_amount'] <= 0){ echo 'You paid nothing.'; } else { echo 'You paid $'.$get_payment['rate_amount'].' On: '. format_date($get_payment['payment_date']); ?></strong></td> </tr> <tr> <td>Membership Expires: </td> <td><strong><?php echo $daysDiffer.' Days'; ?></strong></td> </tr> <?php } }?> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><strong><font color="#999999" size="4">Avaiable Memberships</font></strong></div></td> </tr> <tr> <td>Membership Types: </td> <td><select id="membership_id" name="membership_id" onChange="document.upgrade.submit();"> <option value="">-----------</option> <?php foreach($membershipList as $em){ if($em['membership_id'] == $_POST['membership_id']){$sel= ' selected';}else{$sel=NULL;} echo '<option value="'.$em['membership_id'].'"'.$sel.'>'.$em['membership_title']; if($em['membership_free'] == 1){ echo ' [Free]';} echo '</option>'; } ?> </select> <noscript><input type="submit" name="Submit" value="Get Rates"></noscript></td> </tr> <tr> <td>Membership List: </td> <td><select id="rate_id" name="rate_id" onChange="document.upgrade.submit();"> <option value="">-----------</option> <?php foreach($membershipRates as $em){ if($em['rate_id'] == $_POST['rate_id']){$sel= ' selected';}else{$sel=NULL;} echo '<option value="'.$em['rate_id'].'"'.$sel.'>'.$em['rate_title']; echo ' [ '.$em['rate_amount']. ' Payable Every: '.$em['rate_term'].' '.showTerm($em['rate_term_c']).' ]'; echo '</option>'; } ?> </select></td> </tr> <?php if($_POST['rate_id'] != NULL){ ?> <tr> <td colspan="2"><table width="100%" border="1" cellspacing="0" cellpadding="5"> <tr bgcolor="#BEDEDE"> <td colspan="2"><div align="center"><font color="#999999" size="4"><strong>Membership Info </strong></font></div></td> </tr> <tr> <td width="50%"><font size="2">Membership Title:</font></td> <td width="50%"><font size="2"><?=$get_rate['rate_title'];?> </font></td> </tr> <tr> <td width="50%"><font size="2">Membership Description: </font></td> <td width="50%"><font size="2"> <?=$get_rate['rate_desc'];?> </font></td> </tr> <tr> <td width="50%"><font size="2">Membership Rate: </font></td> <td><font size="2"> <?php echo 'Payment Of: '.$get_rate['rate_amount']. ' [Payable Every: '. $get_rate['rate_term'].' '.showTerm($get_rate['rate_term_c']).']'; ?> </font></td> </tr> <tr> <td><font size="2">Renewal: </font></td> <td><font size="2"> <?php if($get_rate['rate_automatic'] == '1'){echo 'Automatic';} else { echo 'Not Automatic';} ?></font></td> </tr> <tr bgcolor="#CAFFCA"> <td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#999999"> <td width="50%"><div align="center"> <blockquote> <p><strong><font size="2">Pay Via PAYPAL </font></strong></p> </blockquote> </div></td> <td width="50%"><div align="center"><strong><font size="2">Pay Via 2CHECKOUT </font></strong></div></td> </tr> <tr> <td width="50%"><div align="center"> <iframe src="payments/paypal/subscribe.php?rate_id=<?=$get_rate['rate_id'];?>" align="middle" width="100%" height="75" frameborder="0"></iframe> <noframes>Please <a href="payments/paypal/subscribe.php?rate_id=<?=$get_rate['rate_id'];?>">click here</a> to process your payment.</noframes></div> </td> <td width="50%"><div align="center"> <iframe src="payments/2checkout/subscribe.php?rate_id=<?=$get_rate['rate_id'];?>" align="middle" width="100%" height="75" frameborder="0"></iframe> <noframes>Please <a href="payments/paypal/subscribe.php?rate_id=<?=$get_rate['rate_id'];?>">click here</a> to process your payment.</noframes> </div></td> </tr> </table> </td> </tr> </table></td> </tr> <?php } ?> <tr bgcolor="#CAFFCA"> <td colspan="2"><div align="center">[<a href="profile.php">My Profile</a>] [<a href="logout.php">Log out</a>] </div></td> </tr> </table> </form> logout.php <?php /************* Membership V2.0 *******************/ /* Released by AwesomePHP.com, under the GPL License, a copy of it should be attached to the zip file, or you can view it on http://AwesomePHP.com/gpl.txt */ /************* Membership V2.0 *******************/ //Call Database & Connect require_once('headers/database.php'); connect(); @session_start(); $last_day = time() - (1 * 0 * 0 * 0); $check_date = date('Y-m-d G:i:s', $last_day); $remove_user = @mysql_query("DELETE FROM `memb_usersessions` WHERE `session_id`='$_SESSION[usersession]' OR `session_date` < '$check_date'"); disconnect_data(); $_SESSION['usersession'] = NULL; $_COOKIE['usersession'] = NULL; $_SESSION = array(); session_destroy(); header('Location: login.php'); exit(); ?> I hope someone can help me I shall really appreciate it. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/191921-php-user-accounts-problems/#findComment-1011712 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.