Jump to content

NSW42

Members
  • Posts

    110
  • Joined

  • Last visited

    Never

Everything posted by NSW42

  1. Not sure if i'm posting in the right section so bare with me, I have install a ircx server with aspx files on a windows server, chat side it is running fine and can enter chat via a client with no problems, but if a member or guest goes to enter chat via the web flash chat, it just continues to try and connect but wont, some how I think it is being blocked via the socket, I'm not sure what could be wrong but with what reading I have been doing suggests some kind of policy server etc, any help with this in the right direction would be helpful. Many Thanks
  2. Fixed it and thanks anyway Changed this mysql_query("delete from facebook_collapsed_ip where userip=".$userip." AND post_id = ".$_REQUEST['postId']); to this mysql_query("delete from facebook_collapsed_ip where post_id ='".$_REQUEST['postId']."' AND userip ='".$userip."'");
  3. Actually there is no errors showing, it is an like unlike script, if you unlike a comment it works, but when you refresh the page it shows unlike again, this is because it is not deleting the userip or post id, and i'm at a loss as to why it wont.
  4. Could anyone tell me why this is not deleting the userip and post id from the database at all. Thanks <?php include('dbcon.php'); if($_REQUEST['postId']) { $userip = $_SERVER['REMOTE_ADDR']; mysql_query("update collapsed_likes set likes=likes-1 where post_id= ".$_REQUEST['postId']); mysql_query("delete from collapsed_ip where userip=".$userip." AND post_id = ".$_REQUEST['postId']); $total_likes = mysql_query("SELECT * FROM collapsed_likes where post_id = ".$_REQUEST['postId']." "); $likes = mysql_fetch_array($total_likes); $likes = $likes['likes']; } echo $likes; ?>
  5. I have a comments script similar to facebook, is there anyway when a user posts a comment, that it detects it was done from a iphone ipad etc, hope this is the correct place to post this one.
  6. Anyone able to help on this issue at all.
  7. Ok I did a cross browser check and it seems to work fine in IE, but the refresh issue remains the same in in other none MS browsers.
  8. Ok will post one last time before I finally give up on this, below is the other jquery script and the timer below that, as I stated prior, on refresh the values from the main jquery script aren't shown any longer nor can anyone comment post or delete anything, just remember this only happens once the contents refreshs, if I cant get it fixed the the whole project is useless to me, so I hope someone can help. <script type="text/javascript"> // <![CDATA[ $(document).ready(function(){ $('#shareButton').click(function(){ var a = $("#watermark").val(); if(a != "What's on your mind?") { $.post("posts.php?value="+a, { }, function(response){ $('#posting').prepend($(response).fadeIn('slow')); $("#watermark").val("What's on your mind?"); }); } }); $('.commentMark').livequery("focus", function(e){ var parent = $(this).parent(); $(".commentBox").children(".commentMark").css('width','320px'); $(".commentBox").children("a#SubmitComment").hide(); $(".commentBox").children(".CommentImg").hide(); var getID = parent.attr('id').replace('record-',''); $("#commentBox-"+getID).children("a#SubmitComment").show(); $('.commentMark').css('width','300px'); $("#commentBox-"+getID).children(".CommentImg").show(); }); //showCommentBox $('a.showCommentBox').livequery("click", function(e){ var getpID = $(this).attr('id').replace('post_id',''); $("#commentBox-"+getpID).css('display',''); $("#commentMark-"+getpID).focus(); $("#commentBox-"+getpID).children("img.CommentImg").show(); $("#commentBox-"+getpID).children("a#SubmitComment").show(); }); //SubmitComment $('a.comment').livequery("click", function(e){ var getpID = $(this).parent().attr('id').replace('commentBox-',''); var comment_text = $("#commentMark-"+getpID).val(); if(comment_text != "Write a comment...") { $.post("add_comment.php?comment_text="+comment_text+"&post_id="+getpID, { }, function(response){ $('#CommentPosted'+getpID).append($(response).fadeIn('slow')); $("#commentMark-"+getpID).val("Write a comment..."); }); } }); //more records show $('a.more_records').livequery("click", function(e){ var next = $(this).attr('id').replace('more_',''); $.post("posts.php?show_more_post="+next, { }, function(response){ $('#bottomMoreButton').remove(); $('#posting').append($(response).fadeIn('slow')); }); }); //deleteComment $('a.c_delete').livequery("click", function(e){ if(confirm('Are you sure you want to delete this comment?')==false) return false; e.preventDefault(); var parent = $(this).parent(); var c_id = $(this).attr('id').replace('CID-',''); $.ajax({ type: 'get', url: 'delete_comment.php?c_id='+ c_id, data: '', beforeSend: function(){ }, success: function(){ parent.fadeOut(200,function(){ parent.remove(); }); } }); }); /// hover show remove button $('.friends_area').livequery("mouseenter", function(e){ $(this).children("a.delete").show(); }); $('.friends_area').livequery("mouseleave", function(e){ $('a.delete').hide(); }); /// hover show remove button $('a.delete').livequery("click", function(e){ if(confirm('Are you sure you want to delete this post?')==false) return false; e.preventDefault(); var parent = $(this).parent(); var temp = parent.attr('id').replace('record-',''); var main_tr = $('#'+temp).parent(); $.ajax({ type: 'get', url: 'delete.php?id='+ parent.attr('id').replace('record-',''), data: '', beforeSend: function(){ }, success: function(){ parent.fadeOut(200,function(){ main_tr.remove(); }); } }); }); $('textarea').elastic(); jQuery(function($){ $("#watermark").Watermark("What's on your mind?"); $(".commentMark").Watermark("Write a comment..."); }); jQuery(function($){ $("#watermark").Watermark("watermark","#369"); $(".commentMark").Watermark("watermark","#EEEEEE"); }); function UseData(){ $.Watermark.HideAll(); //Do Stuff $.Watermark.ShowAll(); } }); // ]]> </script> <script> $(document).ready(function() { $("#responsecontainer").load("index.php"); var refreshId = setInterval(function() { $("#responsecontainer").load('index.php?randval='+ Math.random()); }, 60000); $.ajaxSetup({ cache: false }); }); </script> <div id="responsecontainer">
  9. I should be a bit more clear on what is happening, it is blocking values from the other script from showing and this is only when it does a refresh.
  10. Hey I have a comment script coded in jquery similar to fb one, it works perfect etc, but I just added in a jquery timer so it updates the div for recent posts and again that works fine, but what it does when the code is added, it blocks a user from commenting or deleting anything. <script> $(document).ready(function() { $("#responsecontainer").load("index.php"); var refreshId = setInterval(function() { $("#responsecontainer").load('index.php?randval='+ Math.random()); }, 9000); $.ajaxSetup({ cache: false }); }); </script> The below part goes in the body and is the one causing the issue, i'm new to jquery so please take it easy on me many thanks. <div id="responsecontainer">
  11. I have been actually and is something that isnt right in that part ?
  12. Script is below if you or anyone can see where the issue is thanks. <?php ob_start("ob_gzhandler"); include('db-conn.php'); $displaynickname = $_SESSION["member_id"]; $sqlnick = mysql_query("SELECT * FROM members WHERE member_id = '$displaynickname'") OR DIE("Sorry there is a mysql error."); $rownick = mysql_fetch_array($sqlnick); $nickdoname = $rownick[member_id]; ?> <?php function checkValues($value) { $value = trim($value); if (get_magic_quotes_gpc()) { $value = stripslashes($value); } $value = strtr($value,array_flip(get_html_translation_table(HTML_ENTITIES))); $value = strip_tags($value); $value = mysql_real_escape_string($value); $value = htmlspecialchars ($value); return $value; } function clickable_link($text = '') { $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text); $ret = ' ' . $text; $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret); $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret); $ret = substr($ret, 1); return $ret; } $next_records = 10; $show_more_button = 0; if(checkValues($_REQUEST['value'])) { $userip = $_SESSION["member_id"]; echo "INSERT INTO facebook_posts (post,f_name,userip,date_created) VALUES('".checkValues($_REQUEST['value'])."','".$nickdoname."','".$userip."','".strtotime(date("Y-m-d H:i:s"))."')"; mysql_query("INSERT INTO facebook_posts (post,f_name,userip,date_created) VALUES('".checkValues($_REQUEST['value'])."','".$nickdoname."','".$userip."','".strtotime(date("Y-m-d H:i:s"))."')"); $result = mysql_query("SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM facebook_posts order by p_id desc limit 1"); } elseif($_REQUEST['show_more_post']) // more posting paging { $next_records = $_REQUEST['show_more_post'] + 10; $result = mysql_query("SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM facebook_posts order by p_id desc limit ".$_REQUEST['show_more_post'].", 10"); $check_res = mysql_query("SELECT * FROM facebook_posts order by p_id desc limit ".$next_records.", 10"); $show_more_button = 0; // button in the end $check_result = mysql_num_rows(@$check_res); if($check_result > 0) { $show_more_button = 1; } } else { $show_more_button = 1; $result = mysql_query("SELECT *, UNIX_TIMESTAMP() - date_created AS TimeSpent FROM facebook_posts order by p_id desc limit 0,10"); } while ($row = mysql_fetch_array($result)) { $comments = mysql_query("SELECT *, UNIX_TIMESTAMP() - date_created AS CommentTimeSpent FROM facebook_posts_comments where post_id = ".$row['p_id']." order by c_id asc"); ?> <div class="friends_area" id="record-<?php echo $row['p_id']?>"> <?php $gogetname = $row['f_name']; $sqlgonick = mysql_query("SELECT * FROM members WHERE member_id = '$gogetname'") OR DIE("Sorry there is a mysql error."); $rowgonick = mysql_fetch_array($sqlgonick); $gonickdoname = $rowgonick[display_name]; ?> <?php $sql="select * from photos where member_id = $gogetname and main_image='1'"; $res=mysql_query($sql); $num_rows=mysql_num_rows($res); if($num_rows==0) { $sql="select * from photos where member_id = $gogetname"; $res=mysql_query($sql); $data_set=mysql_fetch_array($res); } else { $sql="select * from photos where member_id = $gogetname and main_image='1'"; $res=mysql_query($sql); $data_set=mysql_fetch_array($res); } $postersdtartimg = $data_set["photo_url"]; ?> <a href="../view_profile.php?member_id=<?php echo $gogetname; ?>" target="_blank" border="0"><img src="../<?php echo $postersdtartimg;?>" width="60" style="float:left;" alt="" border="0" /></a> <label style="float:left" class="name"> <b><?php echo $gonickdoname;?></b> <br> <em><?php echo clickable_link($row['post']);?></em> <br clear="all" /> <span> <?php // echo strtotime($row['date_created'],"Y-m-d H:i:s"); $days = floor($row['TimeSpent'] / (60 * 60 * 24)); $remainder = $row['TimeSpent'] % (60 * 60 * 24); $hours = floor($remainder / (60 * 60)); $remainder = $remainder % (60 * 60); $minutes = floor($remainder / 60); $seconds = $remainder % 60; if($days > 0) echo date('F d Y', $row['date_created']); elseif($days == 0 && $hours == 0 && $minutes == 0) echo "few seconds ago"; elseif($days == 0 && $hours == 0) echo $minutes.' minutes ago'; else echo "few seconds ago"; ?> </span> <a href="javascript: void(0)" id="post_id<?php echo $row['p_id']?>" class="showCommentBox">Comments</a> </label> <?php $userip = $_SESSION["member_id"]; if($row['userip'] == $userip){?> <a href="#" class="delete"> Remove</a> <?php }?> <br clear="all" /> <div id="CommentPosted<?php echo $row['p_id']?>"> <?php $comment_num_row = mysql_num_rows(@$comments); if($comment_num_row > 0) { while ($rows = mysql_fetch_array($comments)) { $days2 = floor($rows['CommentTimeSpent'] / (60 * 60 * 24)); $remainder = $rows['CommentTimeSpent'] % (60 * 60 * 24); $hours = floor($remainder / (60 * 60)); $remainder = $remainder % (60 * 60); $minutes = floor($remainder / 60); $seconds = $remainder % 60; ?> <?php $getposternick = $rows['userip']; $sqlgetposternick = mysql_query("SELECT * FROM members WHERE member_id = '$getposternick'") OR DIE("Sorry there is a mysql error."); $rowgetposternick = mysql_fetch_array($sqlgetposternick); $showposternick = $rowgetposternick[display_name]; ?> <?php $sql="select * from photos where member_id = $getposternick and main_image='1'"; $res=mysql_query($sql); $num_rows=mysql_num_rows($res); if($num_rows==0) { $sql="select * from photos where member_id = $getposternick"; $res=mysql_query($sql); $data_set=mysql_fetch_array($res); } else { $sql="select * from photos where member_id = $getposternick and main_image='1'"; $res=mysql_query($sql); $data_set=mysql_fetch_array($res); } $posterimg = $data_set["photo_url"]; ?> <div class="commentPanel" id="record-<?php echo $rows['c_id'];?>" align="left"> <img src="../<?php echo $posterimg; ?>" width="25" class="CommentImg" style="float:left;" alt="" /> <label class="postedComments"> <font color="#6A6A72"><?php echo $showposternick; ?>:</font> <?php echo clickable_link($rows['comments']);?> </label> <br clear="all" /> <span style="margin-left:43px; color:#666666; font-size:11px"> <?php if($days2 > 0) echo date('F d Y', $rows['date_created']); elseif($days2 == 0 && $hours == 0 && $minutes == 0) echo "few seconds ago"; elseif($days2 == 0 && $hours == 0) echo $minutes.' minutes ago'; else echo "few seconds ago"; ?> </span> <?php $userip = $_SESSION["member_id"]; if($rows['userip'] == $userip){?> <a href="#" id="CID-<?php echo $rows['c_id'];?>" class="c_delete">Delete</a> <?php }?> </div> <?php }?> <?php }?> </div> <div class="commentBox" align="right" id="commentBox-<?php echo $row['p_id'];?>" <?php echo (($comment_num_row) ? '' :'style="display:none"')?>> <img src="send.gif" width="25" class="CommentImg" style="float:left;" alt="" /> <label id="record-<?php echo $row['p_id'];?>"> <textarea class="commentMark" id="commentMark-<?php echo $row['p_id'];?>" name="commentMark" cols="60"></textarea> </label> <br clear="all" /> <a id="SubmitComment" class="small button comment"> Comment</a> </div> </div> <?php } if($show_more_button == 1){?> <div id="bottomMoreButton"> <a id="more_<?php echo @$next_records?>" class="more_records" href="javascript: void(0)">Older Posts</a> </div> <?php }?>
  13. I have a script for members to comment, how it works is they post a comment and the time is inserted, kinda like facebook, so it says a few secs ago mins ago hrs ago days etc, but the issue is that once the time hits 1hr it reverts back to a few secs ago and wont change again, I haven't posted the script yet, but just putting a feeler out to see if there maybe a simple answer to this. Thanks
  14. Ok solved, Firefox is a nice browser still but didnt reconise the extension.
  15. Tried it all dude, no matter what codes I put in that file, ff wont redirect it and shows the coding, I still keep thinking it's server side for some reason, but cant put my finger on it.
  16. This is my issue, I have a redirection for firefox users when they view a members profile, the problem is the below code works fine for IE users but in FF it shows the code of the script and does not redirect, now I thought it may have been a server side issue with the text/print but text/html is enabled so I'm at one big loss as to what the hell is going on, just a heads up, the said file has a slightly different ext the normal "profile.msnw", but as I said it works fine in IE and certain other sites I know that use the exact same code and file name. <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language=javascript> <!--// function go_redirect() { location.href="./proredirect.php?" + document.location.search.substring(1); } //--> </script> </head> <BODY Onload="go_redirect()"></BODY> </html>
  17. Hey Guys, I just purchased a chat panel and im having trouble adding in some of my own login codes to a functions file for the chat panel, the functions file uses your sessions when a user logins into the site and it logs them into the panel at the same time, I will post the function EXAMPLE below and then post my login and if anyone can help me out as to what im suppose to add in from mine to the function script would be HUGELY appreciated. The 1st example is untouched and is what needs editing: function getUserID() { $userid = 0; if (!empty($_SESSION['userid'])) { $userid = $_SESSION['userid']; } return $userid; } Next example is what has been edited for phpbb function getUserID() { $userid = 0; $sql = ("SELECT config_value c FROM ".TABLE_PREFIX."config WHERE config_name = 'cookie_name'"); $query = mysql_query($sql); $cookie = mysql_fetch_array($query); if (!empty($_COOKIE[$cookie['c'].'_sid'])) { $sql = ("SELECT session_user_id FROM ".TABLE_PREFIX."sessions WHERE session_id = '".mysql_real_escape_string($_COOKIE[$cookie['c'].'_sid'])."'"); $query = mysql_query($sql); $session = mysql_fetch_array($query); if ($session['session_user_id'] != 1) { $userid = $session['session_user_id']; } } return $userid; } below is my login and need some details added into the function file as aboves examples <?php ob_start("ob_gzhandler"); session_start(); include("includes/conn.php"); $email = mysql_real_escape_string(str_replace("'","",$_POST["email"])); $password=str_replace("'", "", $_POST["password"]); $password=md5($password); $sql="select * from members where member_email like '$email' and member_password like '$password' and enabled = '1'"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); $RSUser=mysql_fetch_array($result); if ($num_rows==0) { print ("<script language='JavaScript'> window.location='index.php?err=1'; </script>"); } else { //if($RSUser["email_verify"]==0) //{ // print ("<script language='JavaScript'> window.location='login.php?err=2'; </script>"); //} //else //{ $posted_on=date("m/d/Y"); $ip_address=$_SERVER['REMOTE_ADDR']; $sql="update members set last_login = '$posted_on', last_ip = '$ip_address' where member_id = $RSUser[member_id]"; $upd=mysql_query($sql); $sql="update members set next_email = 0 where member_id = $RSUser[member_id]"; $upd = mysql_query($sql); $now_time = strtotime("now"); $sql="update members set last_login_time = $now_time where member_id = $RSUser[member_id]"; $upd_member = mysql_query($sql); $_SESSION["logged_in"]="yes"; $_SESSION["member_id"]=$RSUser["member_id"]; $_SESSION["member_name"]=$RSUser["member_name"]; $_SESSION["member_lname"]=$RSUser["member_lname"]; $_SESSION["member_email"]=$RSUser["member_email"]; $_SESSION["member_password"]=$password; $_SESSION["package"]=$RSUser["pack_id"]; $_SESSION["selected_package"]=$RSUser["pack_id"]; $_SESSION["enabled"]=$RSUser["enabled"]; include("includes/packages.class.php"); $pack = new packages; $id=$RSUser["pack_id"]; $allowed_info=$pack->get_pack_value($id,'Search'); if($allowed_info["id"]!=Null) { $_SESSION["search_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Invite'); if($allowed_info["id"]!=Null) { $_SESSION["invite_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Forum'); if($allowed_info["id"]!=Null) { $_SESSION["forum_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Groups'); if($allowed_info["id"]!=Null) { $_SESSION["groups_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Events'); if($allowed_info["id"]!=Null) { $_SESSION["events_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Mails'); if($allowed_info["id"]!=Null) { $_SESSION["mails_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Journal'); if($allowed_info["id"]!=Null) { $_SESSION["journal_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Address Book'); if($allowed_info["id"]!=Null) { $_SESSION["address_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Blogs'); if($allowed_info["id"]!=Null) { $_SESSION["blog_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Classified'); if($allowed_info["id"]!=Null) { $_SESSION["classified_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Music'); if($allowed_info["id"]!=Null) { $_SESSION["music_allowed"]="yes"; } $allowed_info=$pack->get_pack_value($id,'Videos'); if($allowed_info["id"]!=Null) { $_SESSION["videos_allowed"]="yes"; } if($_POST["remember_email"]=="on") { setcookie("exact[email]","$RSUser[member_email]", time()+60*60*24*30); } setcookie("exact[logged]",1,time()+60*60*24*30); setcookie("exact[member_email]","$RSUser[member_email]",time()+60*60*24*30); setcookie("exact[member_password]","$password",time()+60*60*24*30); print "<p align='center'>Your account has been validated.<br>You are being taken to the members area.<br><a href='logincomplete.php'>Click here</a> if you are not redirected.</p>"; print ("<script language='JavaScript'> window.location='logincomplete.php'; </script>"); //} } ?>
  18. can you give me a quick example jack, so I dont screw it up Thanks
  19. yeh i realise this, but is there an easy way round to editing the code in the script.
  20. heya all, my script below works to a point that is, but I seem to be having issues with the cookie part, sometimes if you drop the browser, you have to log back in again, and the other issue i seem to be having is, when the stroke of midnight comes, anyone and everyone gets logged out and has to log back in again, seems to me that the cookies are not working for some unknown reason, in one of my other sites I use cookie login and never have to login again unless I actually delete the cookies, any help on this brain draining issue is really appreciated. $email = mysql_real_escape_string(str_replace("'","",$HTTP_POST_VARS["email"])); $password=str_replace("'", "", $HTTP_POST_VARS["password"]); $password=md5($password); $sql="select * from members where member_email like '$email' and member_password like '$password' and enabled = '1'"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); $RSUser=mysql_fetch_array($result); if ($num_rows==0) { print ("<script language='JavaScript'> window.location='index.php?err=1'; </script>"); } else { //if($RSUser["email_verify"]==0) //{ // print ("<script language='JavaScript'> window.location='login.php?err=2'; </script>"); //} //else //{ $posted_on=date("d/m/Y"); $ip_address=$_SERVER['REMOTE_ADDR']; $sql="update members set last_login = '$posted_on', last_ip = '$ip_address' where member_id = $RSUser[member_id]"; $upd=mysql_query($sql); $sql="update members set next_email = 0 where member_id = $RSUser[member_id]"; $upd = mysql_query($sql); $now_time = strtotime("now"); $sql="update members set last_login_time = $now_time where member_id = $RSUser[member_id]"; $upd_member = mysql_query($sql); $_SESSION["logged_in"]="yes"; $_SESSION["member_id"]=$RSUser["member_id"]; $_SESSION["member_name"]=$RSUser["member_name"]; $_SESSION["member_lname"]=$RSUser["member_lname"]; $_SESSION["member_email"]=$RSUser["member_email"]; $_SESSION["member_password"]=$password; $allowed_info=$pack->get_pack_value($id,'Mails'); if($allowed_info["id"]!=Null) { $_SESSION["mails_allowed"]="yes"; } if($HTTP_POST_VARS["remember_email"]=="on") { setcookie("exact[email]","$RSUser[member_email]", time()+30000000); } setcookie("exact[logged]",1,time()+30000000); setcookie("exact[member_email]","$RSUser[member_email]",time()+30000000); setcookie("exact[member_password]","$password",time()+30000000);
  21. actually cal I fixed it, the code is actually in what I pasted, but was disabled, if you take a good look it hits you right between the eyes again thanks for any help provided to me and thats why I love this place. Regards
  22. thanks for your help so far, and in the members table verify email, its default setting is 0, so im guessing a code in the above file to allow login only if there is "1" instead of "0". but to be very honest I have no clue on how to go about it, hence asking for help here.
  23. Heya, when a user joins mysite they get sent an email to verify there email address, which is what its suppose to do, but if even if they dont validate the email, they can still login to the site, again this is what the script allows, but what I want is, unless they verify there account via the email they get sent, I dont want them to be able to login to the site as it defeats the purpose of even sending the email in the 1st place to make sure its a valid email, the code below works on 1 or 0 for verified emails, but im sure it can be done in a way to stop members logging in until they verify there email address, any help on this is appreciated. <?php ob_start("ob_gzhandler"); session_start(); include("includes/config.php"); $email=str_replace("'","",$HTTP_POST_VARS["email"]); $password=str_replace("'", "", $HTTP_POST_VARS["password"]); $password=md5($password); $sql="select * from members where member_email like '$email' and member_password like '$password' and enabled = '1'"; $result=mysql_query($sql); $num_rows=mysql_num_rows($result); $RSUser=mysql_fetch_array($result); if ($num_rows==0) { print ("<script language='JavaScript'> window.location='index.php?err=1'; </script>"); } else { //if($RSUser["email_verify"]==0) //{ // print ("<script language='JavaScript'> window.location='login.php?err=2'; </script>"); //} //else //{ $posted_on=date("m/d/Y"); $ip_address=$_SERVER['REMOTE_ADDR'];
  24. scrapped it, to many headaches and no pills to fix it
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.