[PHP] MySQL, MD5 and SHA1

2009-04-21 Thread Grega Leskovsek
provided I want to store hash of a password in MySQL ... Using MySQL, the whole check can be achieved with a SQL query, since the MD5 function is provided as part of the database query language ... Can I use also SHA1 or must I use MD5? Thanks in advance, -- When the sun rises I receive and

[PHP] how to write /textarea element in textarea?

2009-05-01 Thread Grega Leskovsek
I am writing CMS, that will be able to edit files. For editing I put file inside textarea, but when I open file that has textarea element inside it I lose (read: don't show data in the textarea element.) the data after the inside /textarea element. Any suggestions how can I fix this? Thanks in

[PHP] how to delete part of string

2009-05-23 Thread Grega Leskovsek
I have a POST string field and I want to skip some fields before id= How do I simply delete operation=nekajprice=fddfid=deid=ta ... into id=deid=ta ... Thanks in advance, -- When the sun rises I receive and when it sets I forgive - http://users.skavt.net/~gleskovs/ All the Love, Grega

Re: [PHP] how to delete part of string

2009-05-23 Thread Grega Leskovsek
Marc Steinert li...@bithub.net: I guess you mean GET parameters instead of POST. $string = preg_replace('/^(.*?)id=/', 'id=', $_SERVER['QUERY_STRING']); Don't know, if that's exactly what you wanted. Greetings from Germany Marc Grega Leskovsek wrote: I have a POST string field and I

[PHP] getting file location

2009-05-27 Thread Grega Leskovsek
I have made a CMS with editing files. When I display the file name it shows something like ../subdir/filename.php How can I display the actual filename that's on the web: like http://localhost/subdir/filename.php or even better if it is possible: http://domainname/subdir/filename.php ? Thanks in

Re: [PHP] Re: mysql create table with date or timestamp

2009-05-28 Thread Grega Leskovsek
you can use: insert into diary (when) values (str_to_date(10:55:14Thursday28509, %T%W%e%c%y)); -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br Grega Leskovsek mavri...@gmail.com escreveu na mensagem news

Re: [PHP] Re: mysql create table with date or timestamp

2009-05-28 Thread Grega Leskovsek
INT NOT NULL AUTO_INCREMENT. 2009/5/28 João Cândido de Souza Neto j...@consultorweb.cnt.br: It´s not auto_increment, it´s auto increment. -- João Cândido de Souza Neto SIENS SOLUÇÕES EM GESTÃO DE NEGÓCIOS Fone: (0XX41) 3033-3636 - JS www.siens.com.br Grega Leskovsek mavri...@gmail.com

[PHP] mysql connections

2009-06-01 Thread Grega Leskovsek
how do I make a permanent connection to mysql database and what is difference between mysql_connect() and permanent one? If I make connections in one file and redirect it to another file do I keep connection (permanent / standard)? Do I lose connection only when I type mysql_close (permanent/

[PHP] mail and mysql confirmation of that [double-opt in]

2009-06-29 Thread Grega Leskovsek
how is the best way to check if email address is valid: is this preg_match() OK? preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/', $email); How can I make double opt-in mail system? My idea: 1.) I remember the email entered and user data and the sha1($email);

[PHP] setting cookie doesn't work

2009-08-03 Thread Grega Leskovsek
Here is one of my final objectives at PHP introductory course ot O'Reilly. The strange thing that setting a cookie in that program les13uadownload.php doesn't work. I don't have a clue - sometimes in other programs when I run them they set cookies and sometimes not. To see the full functionality

[PHP] Re: setting cookie doesn't work

2009-08-03 Thread Grega Leskovsek
cookies to detect whether the user has already registered, and to ensure that the user downloads the file only once within 7 days of registering. As always, validate the forms, comment your code, and explain your results! 2009/8/3 Grega Leskovsek mavri...@gmail.com: Here is one of my final

[PHP] Re: setting cookie doesn't work

2009-08-03 Thread Grega Leskovsek
in advance, Grega from Slovenia 2009/8/3 Grega Leskovsek mavri...@gmail.com: And here is the objective: Alter your Acme, Inc. download interface from the previous lesson(I had to not to allow users on computers straing IP with 202 and allow only IE for Win and FF for Mac to download file) so