Jump to content

Atlanticas

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Atlanticas's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Not a forum but some kind of PHP based MySQL database, not good with lingo and terms. You can login, access a Myacct area where you can change your password, email, etc.
  2. How can I do this? The web site is closed to only members, so they must login first.
  3. I would like to do surveys and special contests for my members, but somehow control them from not submiting too many times. I would love to redirect them to a page or message that indicated they've already entered this survey. Is this complex or simple? And what info would you need from my database/php to help me?
  4. Basically my site only notifies members "Wrong Username or Password" but I would like to somehow add an option where it would instead say "Membership expired" or even better 'Membership expired on 00/00/0000" when they attempt to access the site. Here is the part of the coding that shows up, so not sure if this is enough. [code]<?php /*                                                                                                                                              * ************************************************************************* *                                                                                                                      * ************************************************************************/ class auth { /**************************************************************** * function login(&$ld)                                          * ***************************************************************** * @Description:                                                * *                                                              * ***************************************************************** * @Parameters:                                                  * *              &$ld                                              * ***************************************************************** * @return                                                      * ****************************************************************/ function login(&$ld)         {             $dbu= new mysql_db;             $now=strtotime("now");             $dbu->query("select member_id, password from member where username='".$ld['login']."' and active2='1' and active1='1' and exp_date > '".$now."'");             if($dbu->move_next())             {                 if($ld['password']==$dbu->f('password'))                     {                             session_start();                             $_SESSION['uid']=1;                             $_SESSION['u_id']=$dbu->f('member_id');                             $ld['u_id']=$dbu->f('member_id');                             $ld['pn']="redirect";                                                         return true;                     }             }             //$ld['error'].=gettext("Invalid Login or Password provided! <br>");             $ld['error'].=gettext("Wrong Username or Password <br>");             return false;           } /**************************************************************** * function logout(&$ld)                                                * ***************************************************************** * @Description:                                                * *                                                              * ***************************************************************** * @Parameters:                                                  * *              &$ld)                                              * ***************************************************************** * @return                                                      * ****************************************************************/ function logout(&$ld)         {                 $_SESSION['uid']=0;                 $_SESSION['u_id']=0;                 unset ($ld['fn']);                 $ld['pn']='login';                 session_destroy();           return true;         } }//end class ?> [/code]
  5. I changed the [code]$directory = "http://www.mysite.com/test/";[/code], I copied the code to a blank page and named it upload.php When I went to visit it, I was told: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: syntax error, unexpected $end in /home/.sabastian/atlanticas/mysite.com/test/upload.php on line 48[/quote] What did I do wrong? Thx :)
  6. I have a database with active users and wanted to know if is it possible to have my database send an email to a member when they are within 30 days of expiry? And finally, is it possible to create an area where I could email everyone? Like perhaps news/updates? Here is some coding that already sends an email when the member first registers that might help or what info is needed? [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php /************************************************************************ *************************************************************************/ class member { var $dbu; function member() { $this->dbu=new mysql_db; } /**************************************************************** * function add(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ /**************************************************************** * function add(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function add(&$ld) { if(!$this->add_validate($ld)) { return false; } $join_date=strtotime("now"); $ld['exp_date']=date ("n/d/Y", mktime (0,0,0,date("n")+DEFAULT_EXPIRATION_INTERVAL,date("d"),date("Y"))); $exp_date = strtotime($ld['exp_date']); $birthdate = $ld['year']."-".$ld['month']."-".$ld['day']; $ld['member_id']=$this->dbu->query_get_id("insert into member ( name, country, address, address2, city, state, zip, email, username, password, join_date, exp_date, birthdate, phone, active1, active2 ) values ( '".$ld['name']."', '".$ld['country']."', '".$ld['address']."', '".$ld['address2']."', '".$ld['city']."', '".$ld['state']."', '".$ld['zip']."', '".$ld['email']."', '".$ld['username']."', '".$ld['password']."', '".$join_date."', '".$exp_date."', '".$birthdate."', '".$ld['phone']."', '0', '0' ) "); $this->send_client_notiffication_mail($ld); $ld['pn']="reg_success1"; return true; } /**************************************************************** * function update(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function update(&$ld) { if(!$this->update_validate($ld)) { return false; } $birthdate = $ld['year']."-".$ld['month']."-".$ld['day']; $this->dbu->query("update member set country='".$ld['country']."', address='".$ld['address']."', address2='".$ld['address2']."', city='".$ld['city']."', state='".$ld['state']."', zip='".$ld['zip']."', email='".$ld['email']."', birthdate='".$birthdate."', phone='".$ld['phone']."', password='".$ld['password']."' where member_id='".$ld['member_id']."'" ); $ld['error'].=gettext("Your Profile has been successfully updated."); $ld['pn']="view_profile"; return true; } /**************************************************************** * function activate1(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function activate1(&$ld) { if(!$this->activate1_validate($ld)){ return false; } $this->dbu->query("update member set active1='1' where member_id='".$ld['member_id']."'"); $this->send_admin_notiffication_mail($ld); //$ld['error'].="You have succesfully confirmed your Subscription Request.<br> Your account will be activated soon. "; $ld['pn']="reg_success"; return true; } /**************************************************************** * function forgot(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function forgot(&$ld) { if(!$this->forgot_validate($ld)) { return false; } $this->dbu->query("select password, email from member where username='".$ld['username']."'"); $this->dbu->move_next(); $mail=$this->dbu->f('email'); $body= "Hi ".$ld['username']." Here is your membership password: ".$this->dbu->f('password'); $header = "MIME-Version: 1.0\r\n"; $header.= "Content-Type: text\n"; $header.= "From: ".ADMIN_EMAIL." \n"; $mail_subject="Password Request"; @mail ( $mail , $mail_subject, $body , $header); $ld['pn']="forgot_success"; return true; } /**************************************************************** * function send_admin_notiffication_mail(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function send_admin_notiffication_mail(&$ld) { $this->dbu->query("select * from member where member_id='".$ld['member_id']."'"); $this->dbu->move_next(); $body= "There is a new Registration Request. User's data: Name - ".$this->dbu->f('name')." Address - ".$this->dbu->f('address')." Address 2 - ".$this->dbu->f('address2')." City - ".$this->dbu->f('city')." State - ".$this->dbu->f('state')." ZIP - ".$this->dbu->f('zip')."; Country - ".$this->dbu->f('country')." Email - ".$this->dbu->f('email')." Username - ".$this->dbu->f('username')." Password - ".$this->dbu->f('password')." Please Check "; $header = "MIME-Version: 1.0\r\n"; $header.= "Content-Type: text\n"; $header.= "From: ".ADMIN_EMAIL." \n"; $mail_subject="New Registration Request"; @mail ( ADMIN_EMAIL , $mail_subject, $body , $header); return true; } /**************************************************************** * function send_client_notiffication_mail(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function send_client_notiffication_mail(&$ld) { global $site_url, $site_name; $this->dbu->query("select * from member where member_id='".$ld['member_id']."'"); $this->dbu->move_next(); $mail=$this->dbu->f('email'); $body= "You have made a Registration Request. Here is the data you submited: Name - ".$this->dbu->f('name')." Address - ".$this->dbu->f('address')." Address 2 - ".$this->dbu->f('address2')." City - ".$this->dbu->f('city')." State - ".$this->dbu->f('state')." ZIP - ".$this->dbu->f('zip')." Country - ".$this->dbu->f('country')." Email - ".$this->dbu->f('email')." Username - ".$this->dbu->f('username')." Password - ".$this->dbu->f('password')." To confirm your Registration Request please click the link below: ".$site_url."index.php?fn=member-activate1&member_id=".$ld['member_id']." "; $header = "MIME-Version: 1.0\r\n"; $header.= "Content-Type: text\n"; $header.= "From: ".ADMIN_EMAIL." \n"; $mail_subject="Confirmation for ".$site_name; @mail ( $mail , $mail_subject, $body , $header); return true; } /**************************************************************** * function add_validate(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function add_validate(&$ld) { $is_ok=true; if(!$ld['name']) { $ld['error'].="Please enter Your Name."."<br>"; $is_ok=false; } if(!$ld['address']) { $ld['error'].="Please enter Your Address."."<br>"; $is_ok=false; } if(!$ld['city']) { $ld['error'].="Please enter Your City."."<br>"; $is_ok=false; } if(!$ld['state']) { $ld['error'].="Please enter Your State."."<br>"; $is_ok=false; } if(!$ld['zip']) { $ld['error'].="Please enter Your Zip."."<br>"; $is_ok=false; } if(!$ld['country']) { $ld['error'].="Please enter Your Country."."<br>"; $is_ok=false; } if(!$ld['email']) { $ld['error'].="Please enter Your Email Adderss."."<br>"; $is_ok=false; } if($ld['email'] && !secure_email($ld['email'])) { $ld['error'].="Please insert a valid email address."."<br>"; $is_ok=false; } if(!$ld['username']) { $ld['error'].="Please enter Your Username."."<br>"; $is_ok=false; } elseif (!secure_string_no_spaces($ld['username'])) { $ld['error'].="Please enter a valid Username (no spaces)."."<br>"; $is_ok=false; } elseif (strlen($ld['username'])<6) { $ld['error'].="Please enter a valid Username (min. 6 chars)."."<br>"; $is_ok=false; } else { $this->dbu->query("select member_id from member where username='".$ld['username']."'"); if($this->dbu->move_next()) { $ld['error'].="There is another Member with this Username. Please change it."."<br>"; $is_ok=false; } } if(!$ld['password']) { $ld['error'].="Please enter a Password."."<br>"; $is_ok=false; } elseif (strlen($ld['password'])<6) { $ld['error'].="Please enter a valid Password (min. 6 chars)."."<br>"; $is_ok=false; } elseif (!secure_string_no_spaces($ld['password'])) { $ld['error'].="Please enter a valid Password (no spaces)."."<br>"; $is_ok=false; } elseif ($ld['password']!=$ld['password1']) { $ld['error'].="Password does not match."."<br>"; $is_ok=false; } return $is_ok; } /**************************************************************** * function update_validate(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function update_validate(&$ld) { $is_ok=true; if (!is_numeric($ld['member_id'])) { $ld['error'].=gettext("Invalid Id.")."<br>"; return false; } $this->dbu->query("select member_id from member where member_id='".$ld['member_id']."'"); if(!$this->dbu->move_next()) { return false; } if(!$ld['address']) { $ld['error'].="Please enter Your Address."."<br>"; $is_ok=false; } if(!$ld['city']) { $ld['error'].="Please enter Your City."."<br>"; $is_ok=false; } if(!$ld['state']) { $ld['error'].="Please enter Your State."."<br>"; $is_ok=false; } if(!$ld['zip']) { $ld['error'].="Please enter Your Zip."."<br>"; $is_ok=false; } if(!$ld['country']) { $ld['error'].="Please enter Your Country."."<br>"; $is_ok=false; } if(!$ld['email']) { $ld['error'].="Please enter Your Email Adderss."."<br>"; $is_ok=false; } if($ld['email'] && !secure_email($ld['email'])) { $ld['error'].="Please insert a valid email address."."<br>"; $is_ok=false; } if ($ld['password'] && strlen($ld['password'])<6) { $ld['error'].="Please enter a valid Password (min. 6 chars)."."<br>"; $is_ok=false; } elseif (!secure_string_no_spaces($ld['password'])) { $ld['error'].="Please enter a valid Password (no spaces)."."<br>"; $is_ok=false; } elseif ($ld['password']!=$ld['password1']) { $ld['error'].="Password does not match."."<br>"; $is_ok=false; } if($is_ok && !$ld['password']) { $this->dbu->query("select password from member where member_id='".$ld['member_id']."'"); $this->dbu->move_next(); $ld['password']=$this->dbu->f('password'); } return $is_ok; } /**************************************************************** * function activate1_validate(&$ld) * ***************************************************************** * @Description: * * * ***************************************************************** * @Parameters: * * &$ld * ***************************************************************** * @return * ****************************************************************/ function activate1_validate(&$ld) { if (!is_numeric($ld['member_id'])) { return false; } $this->dbu->query("select member_id from member where member_id='".$ld['member_id']."'"); if(!$this->dbu->move_next()) { return false; } return true; } //******************************forgot_validate******************* function forgot_validate(&$ld) { $this->dbu->query("select email from member where username='".$ld['username']."'"); if($this->dbu->move_next()) { $wrong_email=1; if($this->dbu->f('email')==$ld['email']) { $wrong_email=0; } if($wrong_email) { $ld['error']="Email Address does not match. <br>"; return false; } } else { $ld['error']="This Username does not exist in our database. <br>"; return false; } return true; } }//end class ?> [/quote]
  7. Basically looking for a free or low-cost script/tool that I can install on my site, where visitors can upload a picture to a directory on my site. No login needed or access to the file, I just need to be able to desginate where the image is stored and if possible control the format and size. Thanks!
  8. Wow, thank you so much! I spent many hours on this and never would have guessed. Thank you, I am very appreciative and can't say thanks enough!!!! :)
  9. Basically this coding adds a color desgination for each of my registered users based on how long they have joined. Example: Mike joins on 3/1/06 and is considered Orange during his first 90 days of joining, then turns Blue, etc. However I want to do the opposite. Instead I want the code to determine the color based on how much membership time is left. For example within the last 90 days of membership, I would like it to put someone as Orange. I hope I am making sense, I had someone do the code for me however he is on vacation and wont be back for a month. Thanks. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]function get_status_color($member_id) { $_db = new mysql_db; $now=strtotime("now"); $_db->query("SELECT exp_date, join_date FROM member WHERE member_id='".$member_id."'"); $_db->move_next(); $exp_date=$_db->f('join_date'); $sec_left=$now - $exp_date; if($sec_left <= 0) { return 'WHITE'; } $days_left=$sec_left / 86400; //echo $days_left; if($days_left <= 90 ) { $color='ORANGE; } elseif($days_left <= 180 ) { $color='BLUE'; } elseif($days_left <= 851 ) { $color='PURPLE'; } if($days_left > 851 ) { $color='PURPLE'; } return $color; } ?>[/quote]
×
×
  • 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.