Jump to content

itaym02

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Everything posted by itaym02

  1. I have a site with tens of thousands of users. I need to implement some kind of private messaging system. I thinking about simply install an email server and use the imap extenstion to work against it, as if it was a DB of messages. Is my approach the correct one, or is it shooting way over the target, and I need to do it using my DB and in the old way (say, like in phpBB or here).
  2. Can you give us the larger picture, as there might be a different approach to your problem. Think of an algorithm that scans one char at a time, and marks when a PHP tag is opened, it's place in the file and it type, and the same for closing tags. This way you would know which PHP tags are opened and do not have content in them, and which PHP tags are closed without first being opened. Some edge cases I can think off of the tip of my mind. <?php //?> echo 'watch out'; ?> <? echo 'watch out, if this is the last line in the file, then this is legit.'; <?='ggg'?>
  3. Have no sleeve answer for you, just notice it is a common practice to leave unclosed PHP tags. This is done to avoid problems with white spaces. Now your problem becomes more complicated :-)
  4. Net Beans or Eclipse+ the PHP plugin give you good service, just make sure your computer is either strong (or running on *nix)
  5. Echo the sql one line before you run it. Take that string and run it manually on the DB (easiest in the SQL panel of phpmyadmin). I guess this will show you the real error.
  6. You can set the includes path to point to the directory of this config (and on the way to your library of code) and from then on, just use the file name in the include command.
  7. I started using Zend Framework a year ago. Have no such problems and almost no includes in my project. Using theire autoload and naming conventions.
  8. Oh, Come on, use full paths...
  9. It searches the file in the directory of the main script (the one you put it's name in the browser). I guess that the file is not in that directory, but rather in the directory of the included file. I like to use absolute paths, and so does Accelerators.
  10. I am biased, as I am an ex-Zender, you can guess what I recommend (and what I use).
  11. In that case SESSION is the wrong choice! If you really think you need a superglobal variable (which, in most cases is a bad idea). Simply define it in the global scope (outside all function and classes) and then call it anywhere in the script like that: $GLOBAL['var_name']
  12. I tend to use a library like Zend Framwork when working with forms, abstracts much of the work. Since you are a veteran .net it will be easy for you to get the idea. But, as a basic thing, I used to write my forms like that: <form method='post' action=''> <input type='text' name='myname' value='<?php echo $_POST['myname']; ?>' /> ... ... ... <input type='submit' value='save' /> </form>
  13. The scenario: A "forgot my password" for is filled with email. On submission email is sent to the user. Due to the way ZF is working, the email is sent in the controller, before anything is thrown to the browser. This makes it look like after the submission the site is stuck (if it takes a long time to send the email). Is there a way to echo a message to the screen, on the lines "Your request is being taken care of...". I can use AJAX to submit this request, I can use cron to send the emails at a later time... But I was wondering if there is a good way to do it built in ZF?
  14. What is the path to your Zend folder? And put here the code of the bootstrap file you use.
  15. This would be a good way to check if an update occurred or not. Since you have no PHP error, it seems you query is not good. Echo the query you try to run (do not write it yourself, it is important you echo it) just before the call to mysql, and see why it does not update anything.
  16. Once is fine. What you have to do now is learn how to debug. Start removing lines and run the program each time, until you remove a line which after no error occurs. But...This is how it should be: " WHERE student_number='$student_number'" );
  17. What you should do is update the user table with it's image filename the moment the user uploads one. Before he uploads one the default should be unknown.jpg etc
  18. In the line " WHERE student_number='$student_number'"; Remove the ; from the end of the line.
  19. I have a Form element: $Form=new Zend_Form; $Form->setAction($this->view->url(array('controller'=>'auth','action'=>'create'),null,true)) ->setMethod('post') ->setAttrib('id','auth-form') ->removeAttrib('enctype'); As can be seen I use the removeAttrib method to remove the default enctype. But, when I echo the form I still get: <form id="auth-form" enctype="application/x-www-form-urlencoded" action="/auth/resetpassword2" method="post">
  20. When SSL is noty available Should I make the extra effort and encrypt on the client side (using js) the password when performing login/registration/password change? I assume this is good to prevent wireless sniffing. Is there a better/simpler solution?
  21. If you can put the minimal code snippet that does not behave the same between browsers, it will be much simpler to help you.
  22. Use the explode function http://php.net/explode to transform the array to a string which will look like that: "1,2,3,4,5,6"
  23. I have the following string: PHP Code: $text="א אב אבי אביהו מדינה שול של"; In which I wish to add 'אאא' to all <4 chars word, so the string will turn into: "אאאא אבאאא אביאאא אביהו מדינה שולאאא שלאאא" The code I am using is: PHP Code: $text="א אב אבי אביהו מדינה שול של"; $pattern='/\s(.{1,6})\s/'; $text=preg_replace($pattern,' $1אאא ',$text); echo $text; Which results in: א אבאאא אבי אביהו מדינה שולאאא של Problems: 1. It seems word boundary is not recognized (hence my use of \s). 2. Why was the אבי not replaced?
×
×
  • 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.