Jump to content

hell_yeah

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Male

hell_yeah's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. In addition to Mahngiel's suggestions, in your login function, since you only need to check if the user name is valid or not and not using the data, you can do something like this instead of returning the whole data public function login($username,$password){ $encode = $this->encrypt->encode($password); $query = $this->db->get_where('blog_user', array('username' => $username, 'securepass' => $encode)); if ($query->num_rows() == 1){ return TRUE; }else{ return FALSE; } }
  2. In order to remove an identity from persistent storage, you need to call the following method during your logout routine Zend_Auth::getInstance()->clearIdentity();
  3. I looked at your code and there are few odd things, sorry for saying that. when do you get the blank page? is it when you leave the $firstname initial? or all the time? You may need to review your if statement: if ($firstname == '') { } else { $bad_folder = array (
  4. That's because foreach expect an array as argument and you are just passing a normal variable. The above code I have given was supposed to be an example that you can follow in order to fix your issue. If your dropdawn lists have only yes/no values, then you can follow the below code and modify it in order to fit your needs: <?php // This value is supposed to have whatever stored in the database. I am just using it here to // set it to the value I need in order to demonstrate the concept for you $yesNoValue = "no"; ?> <select name="test"> <option value="yes" <?php echo ($yesNoValue=="yes") ? 'selected="selected"': '' ?> >yes</option> <option value="no" <?php echo ($yesNoValue=="no") ? 'selected="selected"': '' ?> >no</option> </select>
  5. Sorry, you have a missing parenthesis after the if statement, it should be this way if($databasePcontact == $pcontact ) { and try to have different variables name as shown in my example as your statement will be always true.
  6. You can simply create a class property by just giving it a valid variable name, example: class MyClass{ // Variable Declaration Example $classVar1; Public $classVar2; private $classVar3; } If you don't specify the visibility keywords (i.e. public, protected, or private), then the variable will be considered as public by default. However, for consistency reason, it is always advisable to specify the visibility keyword before the variable declaration. If you have no intention to restrict access to that variable, just use the public
  7. So if I understood you well, you are trying to get the selected value of each dropdown list and update the database, right? Assuming that you have a select option in your form, example <select name="myColor"> <option selected="selected">- color -</option> <option value="red">Red</option> <option value="blue">Blue</option> <option value="green">Green</option> <option value="black">Black</option> </select> Then, in your PHP script, you can reference this field and get its value this way: $mySelectedColor = $_POST['myColor'] Now in order to reflect what is in the database when you show you form again, you can do something like this: Assuming that the field $mySelectedColor has your data from the database: <select name="myVar"> <?php foreach($colors as $color){ if($mySelectedColor == $color){ $selected = 'selected="selected"'; }else{ $selected = ''; }?> <option <?php echo $selected?> value="<?php echo $color?>"><?php echo $color?></option> <?php } ?> </select> There might be other better solution but this is what i can think of at this moment
  8. So if I understood you well, you are trying to get the selected value of each dropdown list and update the database, right? Assuming that you have a select option in your form, example <select name="myColor"> <option selected="selected">- color -</option> <option value="red">Red</option> <option value="blue">Blue</option> <option value="green">Green</option> <option value="black">Black</option> </select> Then, in your PHP script, you can reference this field and get its value this way: $mySelectedColor = $_POST['myColor'] Now in order to reflect what is in the database when you show you form again, you can do something like this: Assuming that the field $mySelectedColor has your data from the database: <select name="myVar"> foreach($colors as $color){ if($mySelectedColor == $color){ }else{ } } </select>
  9. You may also apply the same concept explained by Jessica but having a separate table for user online, just an opinion
  10. I guess this is something related to myphpadmin configurations, try to change the $cfg['ExecTimeLimit'] variable and increase the amount of time set there. You may find your file "config.inc.php" under phpMyadmin folder in your web server.
  11. Hi, I guess it should be this way: function centeralign() { lol.document.execCommand('justifycenter', false, null); };
  12. Hi there, Welcome aboard. Good to hear that your are preparing for the zend certification exam. Which exam are you planning to attend?
  13. hell_yeah

    Hi All!

    Hi ritzi, Welcome aboard!!...I hope you enjoy your stay at PHPFreaks
  14. Hi parvysage, welcome aboard!!... excuse my language as I am not a native speaker You are definitely at the right place. Soon, you would become a freak as well . The best thing to do in order to get started with PHP is to read the PHP manual at the www.php.net. It is a good learning resource and you can start your code and ask any question. I am pretty sure, you will get the help you are seeking
  15. Hi Jack, glad to have here with us. Happy coding to you as well
×
×
  • 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.