Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. I'm not being rude, it was a serious question. This forum is for help with code YOU wrote. Remove all of that. If you tried that already, you should have said so in your original post.
  2. You seriously looked at that and don't know what to remove? Do you know any PHP at all? Remove the line that has the URL that doesn't exist...
  3. That is sort of what I did. I was going to post the finished solution once I fixed the view for editing the user, but haven't gotten around to it.
  4. See my signature.
  5. You store the current time in their row every time they load a page. When you pull the list of online users, you generally chose a time such as 5 minutes. If their last page view was less than 5 minutes, they're "online". That's the best you can do.
  6. Sounds like you need a password. Did you READ the error?
  7. You probably need a space before ORDER. In the future POST THE ERROR.
  8. I can't imagine what you searched for that you *didn't* find a dozen tutorials on this subject. http://lmgtfy.com/?q=php+resize+image Try again and come back when you get stuck at a bug.
  9. You should put the processing for testing if there is an important message in your main header file. That way it doesn't matter WHAT page they view first, it will be in the same spot (like at the top of the page). For example I am doing a project in CakePHP right now and my layout template looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php echo $this->Html->charset(); ?> <title> <?php echo $title_for_layout; ?> </title> //snip... </head> <body> <div id="container"> <div id="header"> //snip... </div> <div id="content"> <?php echo $this->Session->flash(); ?> // etc etc etc This is specific to CakePHP but the <?php echo $this->Session->flash(); ?> is where any important message flashes onto the screen in bright colors, then fades to grey and stays visible. Does your application have a main file for the header of the page?
  10. What are you doing with $statusMessage? Have you looked into using a templating system like Smarty?
  11. My bad, I forgot I had put the password hashing code in myself. class User extends AppModel { public function beforeSave($options = array()) { if (isset($this->data[$this->alias]['password'])) { $this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['password']); } return true; } } I'll figure out what I need to do from here.
  12. URLs including the entire URL - DO matter for SEO. Search engines DO look at keywords in the URL. Edit: Here's an article that explains more in depth how each part of a URL is interpreted by a search engine. For example it talks about the difference in using _ and -. http://searchengineland.com/seo-friendly-url-syntax-practices-134218
  13. I'm using CakePHP 2.2 with the built-in Auth component. I can add a user, login, etc that all works fine. When I try to save an update to the user, the password gets overwritten with a new hash, I assume the hash of the previous hash. <?php Class MyController extends AppController{ function doStuff($newStuff){ $this->User->read(NULL, $this->user_id); $this->User->set('stuff', $newStuff); $this->User->save(); } } I can't figure out how I'm supposed to prevent the password from getting updated. Here's AppController in case that helps. class AppController extends Controller { public $components = array( 'Session', 'Auth' => array( 'loginRedirect' => array('controller' => 'posts', 'action' => 'index'), 'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home') ) ); public function beforeFilter(){ parent::beforeFilter(); $this->user_id = $this->Auth->user('user_id'); if($this->user_id){ $username = $this->Auth->user('username'); $this->set('username', $username); } } } This is very generic code right now, with no extra processing for sanitizing etc, just trying to get the password to stop being overwritten.
  14. Try changing $HTTP_POST_VARS to $_POST?
  15. I have to say you are really going about this all wrong.
  16. I think you are saying when you try to add another column. Which brings me back to the fact that you *need* to denormalize the data. Each photo should be in it's own row in a table that stores photo file names and product ids.
  17. You cannot use include and concatenate it to a string.
  18. Seriously?? This thread is like watching a Three Stooges sketch. Or Abbott and Costello.
  19. You need to denormalize that data. If you want to keep it the way it is and get help, you should probably explain "the problem".
  20. Still didn't explain what the problem is. If you want to do what you described, then do it. I suggest you read the links you were given, and the one in my signature on how to get good help. Then ask again when you have determined an actual coding problem. If there is a language barrier so bad that neither side can understand, you might look for a forum in your native language. We have several people here who speak English and another language but this is primarily English, and people can't help if they can't understand the problem.
  21. There is absolutely no point in doing that. What the heck are you trying to do, and where is the problem?
  22. yep! Always do die() right after a location redirect. Not all headers, just when you use location.
  23. With your computer and keyboard. You haven't written any code. Or at least you haven't showed it to us. You have the logic, now write the code. When you have an actual problem we can help.
  24. Pretty URLs are used in SEO.
×
×
  • 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.