[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 of this program I had to set cookie
sevendays in another program. Please check where is my bug. Thanks in
advance, Grega from Slovenia

?php
if (!empty($_GET['delete_cookie'])) {
   setcookie(sevendays, , time()-3600); //delete the cookie to
allow to download the file more than 1x in 7days as another user
}

if 
(isset($_POST['check'])AND(isset($_POST['email']))AND(empty($_COOKIE[sevendays])))
{#user clicked form download button
  $email = $_POST['email'];
  setcookie(sevendays, email, time()+60*60*24*7);
  $filepath = $_SERVER['DOCUMENT_ROOT']./.php_files/acme_brochure.pdf;
  if (file_exists($filepath)) {
 header(Content-Type: application/force-download);
 header(Content-Disposition:filename=\brochure.pdf\);
 $fd = fopen($filepath,'rb');
 fpassthru($fd);
 fclose($fd);
  }
}#isset(check)
?
script type=text/javascript
function setcolor(backgcolor,color) {
document.getElementById(file).style.color=color;
document.getElementById(file).style.background=backgcolor;
}

  function setStyle(x) {
document.getElementById(x).style.background=yellow;
  }
  function unSetStyle(x) {
document.getElementById(x).style.background=white;
  }

function isFormValid (formToCheck) {
retVal = true;

if (
(formToCheck.email.value).search(/^[\w!#$%\'*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i)
== -1 )
{
element = document.getElementById (new1Label);
element.style.color = red;
element.style.fontWeight = bold;
retVal = false;
retEmVal = false;
}
else
{
element = document.getElementById (new1Label);
element.style.color = black;
element.style.fontWeight = normal;
retEmVal = true;

}

if (formToCheck.downloaded.value=='no') {
ret7daysVal = true;
}else {
ret7daysVal = false;
}

if (!retEmVal)
{
alert (Please enter a valid e-mail address!);
retVal = false;
}else if (!ret7daysVal)
{
alert (You can download the file only once in
seven days!);
retVal = false;
}

return retVal;

}
/script
?php
require($_SERVER['DOCUMENT_ROOT']./template_top.inc);
$ua = $_SERVER['HTTP_USER_AGENT'].br /;
if (preg_match(/Macintosh/,$ua)) {
  if (!preg_match(/Firefox/,$ua)) {
echo For Macintosh You need to use Firefox! a
href=\http://www.apple.com/downloads/macosx/internet_utilities/mozillafirefox.html\;Download
here .../a;
exit();
  }
}
if (preg_match(/Windows/,$ua)) {
  if (!preg_match(/MSIE/,$ua)) {
echo For Windows You need to use Internet Explorer!;
exit();
  }
}
$ip = $_SERVER['REMOTE_ADDR'];
$ipCheck = substr($ip,0,3);
if ($ipCheck == 202) {echo I don't trust You.; exit();}
?
?php
if (!empty($_COOKIE[sevendays])) echo IN SEVEN
.$_COOKIE[sevendays]. DAYS!!!;
if ($_COOKIE[sevendays]) {
  echo $_COOKIE[sevendays];
  ?
  a href=les13uadownload.php?delete_cookie=1Not my email: ? echo
$_COOKIE[sevendays]; ??/a
  ?php
}else {
  ?
  form method=post name=vnosnaForma action=les12uadownload.php
  span id=new1LabelEnter Your e-mail: /spaninput type=text
size=25 name=email value=? echo $_COOKIE[sevendays]; ?
  input type=button name=button value=Download now! onClick=if
(isFormValid(document.vnosnaForma)) {document.vnosnaForma.submit();}
/
  input type=hidden name=check value=1 /
  input type=text name=downloaded value=?php if
(!empty($_COOKIE[sevendays])) echo $_COOKIE[sevendays]; else echo
no; ?/
  /form
  ?php
}
require($_SERVER['DOCUMENT_ROOT']./template_bottom.inc);
print_r($_COOKIE);
echo XX.$_COOKIE[sevendays].XX;
?


-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: setting cookie doesn't work

2009-08-03 Thread Grega Leskovsek
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 that each user
must register her email address in order to download the file. Use
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 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 of this program I had to set cookie
 sevendays in another program. Please check where is my bug. Thanks in
 advance, Grega from Slovenia

 ?php
 if (!empty($_GET['delete_cookie'])) {
   setcookie(sevendays, , time()-3600); //delete the cookie to
 allow to download the file more than 1x in 7days as another user
 }

 if 
 (isset($_POST['check'])AND(isset($_POST['email']))AND(empty($_COOKIE[sevendays])))
 {#user clicked form download button
  $email = $_POST['email'];
  setcookie(sevendays, email, time()+60*60*24*7);
  $filepath = $_SERVER['DOCUMENT_ROOT']./.php_files/acme_brochure.pdf;
  if (file_exists($filepath)) {
     header(Content-Type: application/force-download);
     header(Content-Disposition:filename=\brochure.pdf\);
     $fd = fopen($filepath,'rb');
     fpassthru($fd);
     fclose($fd);
  }
 }#isset(check)
 ?
 script type=text/javascript
        function setcolor(backgcolor,color) {
                document.getElementById(file).style.color=color;
                document.getElementById(file).style.background=backgcolor;
        }

  function setStyle(x) {
        document.getElementById(x).style.background=yellow;
  }
  function unSetStyle(x) {
        document.getElementById(x).style.background=white;
  }

            function isFormValid (formToCheck) {
                retVal = true;

                if (
 (formToCheck.email.value).search(/^[\w!#$%\'*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i)
 == -1 )
                {
                    element = document.getElementById (new1Label);
                    element.style.color = red;
                    element.style.fontWeight = bold;
                    retVal = false;
                    retEmVal = false;
                }
                else
                {
                    element = document.getElementById (new1Label);
                    element.style.color = black;
                    element.style.fontWeight = normal;
                    retEmVal = true;

                }

                if (formToCheck.downloaded.value=='no') {
                    ret7daysVal = true;
                }else {
                    ret7daysVal = false;
                }

                if (!retEmVal)
                {
                    alert (Please enter a valid e-mail address!);
                    retVal = false;
                }else if (!ret7daysVal)
                {
                    alert (You can download the file only once in
 seven days!);
                    retVal = false;
                }

                return retVal;

            }
 /script
 ?php
//You dont need this line
require($_SERVER['DOCUMENT_ROOT']./template_top.inc);
 $ua = $_SERVER['HTTP_USER_AGENT'].br /;
 if (preg_match(/Macintosh/,$ua)) {
  if (!preg_match(/Firefox/,$ua)) {
    echo For Macintosh You need to use Firefox! a
 href=\http://www.apple.com/downloads/macosx/internet_utilities/mozillafirefox.html\;Download
 here .../a;
    exit();
  }
 }
 if (preg_match(/Windows/,$ua)) {
  if (!preg_match(/MSIE/,$ua)) {
    echo For Windows You need to use Internet Explorer!;
    exit();
  }
 }
 $ip = $_SERVER['REMOTE_ADDR'];
 $ipCheck = substr($ip,0,3);
 if ($ipCheck == 202) {echo I don't trust You.; exit();}
 ?
 ?php
 if (!empty($_COOKIE[sevendays])) echo IN SEVEN
 .$_COOKIE[sevendays]. DAYS!!!;
 if ($_COOKIE[sevendays]) {
  echo $_COOKIE[sevendays];
  ?
  a href=les13uadownload.php?delete_cookie=1Not my email: ? echo
 $_COOKIE[sevendays]; ??/a
  ?php
 }else {
  ?
  form method=post name=vnosnaForma action=les12uadownload.php
  span id=new1LabelEnter Your e-mail: /spaninput type=text
 size=25 name=email value=? echo $_COOKIE[sevendays]; ?
  input type=button name=button value=Download now! onClick=if
 (isFormValid(document.vnosnaForma)) {document.vnosnaForma.submit();}
 /
  input type=hidden name=check value=1 /
  input type=text name=downloaded value=?php if
 (!empty($_COOKIE[sevendays])) echo $_COOKIE[sevendays]; else echo
 no; ?/
  /form
  ?php
 }
//You dont need this line
require($_SERVER['DOCUMENT_ROOT']./template_bottom.inc);
 print_r($_COOKIE);
 echo XX.$_COOKIE

[PHP] Re: setting cookie doesn't work

2009-08-03 Thread Grega Leskovsek
I made two files now of the program: (the main one and the one where I
set the cookie and open pdf)and I noticed that it doesn't work setting
the cookie the first time I call the file where I set the cookie but
only after the second header  redirection.
How do I refresh the page in php?

Thanks 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 that each user
 must register her email address in order to download the file. Use
 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 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 of this program I had to set cookie
 sevendays in another program. Please check where is my bug. Thanks in
 advance, Grega from Slovenia

 ?php
 if (!empty($_GET['delete_cookie'])) {
   setcookie(sevendays, , time()-3600); //delete the cookie to
 allow to download the file more than 1x in 7days as another user
 }

 if 
 (isset($_POST['check'])AND(isset($_POST['email']))AND(empty($_COOKIE[sevendays])))
 {#user clicked form download button
  $email = $_POST['email'];
  setcookie(sevendays, email, time()+60*60*24*7);
  $filepath = $_SERVER['DOCUMENT_ROOT']./.php_files/acme_brochure.pdf;
  if (file_exists($filepath)) {
     header(Content-Type: application/force-download);
     header(Content-Disposition:filename=\brochure.pdf\);
     $fd = fopen($filepath,'rb');
     fpassthru($fd);
     fclose($fd);
  }
 }#isset(check)
 ?
 script type=text/javascript
        function setcolor(backgcolor,color) {
                document.getElementById(file).style.color=color;
                document.getElementById(file).style.background=backgcolor;
        }

  function setStyle(x) {
        document.getElementById(x).style.background=yellow;
  }
  function unSetStyle(x) {
        document.getElementById(x).style.background=white;
  }

            function isFormValid (formToCheck) {
                retVal = true;

                if (
 (formToCheck.email.value).search(/^[\w!#$%\'*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/i)
 == -1 )
                {
                    element = document.getElementById (new1Label);
                    element.style.color = red;
                    element.style.fontWeight = bold;
                    retVal = false;
                    retEmVal = false;
                }
                else
                {
                    element = document.getElementById (new1Label);
                    element.style.color = black;
                    element.style.fontWeight = normal;
                    retEmVal = true;

                }

                if (formToCheck.downloaded.value=='no') {
                    ret7daysVal = true;
                }else {
                    ret7daysVal = false;
                }

                if (!retEmVal)
                {
                    alert (Please enter a valid e-mail address!);
                    retVal = false;
                }else if (!ret7daysVal)
                {
                    alert (You can download the file only once in
 seven days!);
                    retVal = false;
                }

                return retVal;

            }
 /script
 ?php
 //You dont need this line
 require($_SERVER['DOCUMENT_ROOT']./template_top.inc);
 $ua = $_SERVER['HTTP_USER_AGENT'].br /;
 if (preg_match(/Macintosh/,$ua)) {
  if (!preg_match(/Firefox/,$ua)) {
    echo For Macintosh You need to use Firefox! a
 href=\http://www.apple.com/downloads/macosx/internet_utilities/mozillafirefox.html\;Download
 here .../a;
    exit();
  }
 }
 if (preg_match(/Windows/,$ua)) {
  if (!preg_match(/MSIE/,$ua)) {
    echo For Windows You need to use Internet Explorer!;
    exit();
  }
 }
 $ip = $_SERVER['REMOTE_ADDR'];
 $ipCheck = substr($ip,0,3);
 if ($ipCheck == 202) {echo I don't trust You.; exit();}
 ?
 ?php
 if (!empty($_COOKIE[sevendays])) echo IN SEVEN
 .$_COOKIE[sevendays]. DAYS!!!;
 if ($_COOKIE[sevendays]) {
  echo $_COOKIE[sevendays];
  ?
  a href=les13uadownload.php?delete_cookie=1Not my email: ? echo
 $_COOKIE[sevendays]; ??/a
  ?php
 }else {
  ?
  form method=post name=vnosnaForma action=les12uadownload.php
  span id=new1LabelEnter Your e-mail: /spaninput type=text
 size=25 name=email value=? echo $_COOKIE[sevendays]; ?
  input type=button name=button value=Download now! onClick

[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);
in mysql db
2.) I send email with activation link of the sha1($email);
3.) I am not clear how to proceed when the link is activated. How to
update the db and submit the necessary form to the marketing.

Thanks in advance,


-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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/ standard)?

if I select different database between the php program do I need to do
something extra along mysql_select_db(dbname,$link)?

If I opened db in another php file, where do I get the $link variable
from = mysql_connect (when selecting another database)?

Thanks in advance,

-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2009-05-28 Thread Grega Leskovsek
I GOT THIS ERROR when  I tried first sample with when timestamp;


ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual thatcorresponds to your MySQL server version for the right
syntax to use near 'id(iddiary) )' at line 1


2009/5/28 João Cândido de Souza Neto j...@consultorweb.cnt.br:
 If you need date and hour the best way is:

 CREATE TABLE diary (
  iddiary int auto_increment not null,
  imepriimek varchar(50),
  when timestamp,
  action varchar(30),
  onfile varchar(100)
  unique id(iddiary)
 );

Please advice. Thanks in advance, Grega

 if you need only date you can use:

 CREATE TABLE diary (
  iddiary int auto_increment not null,
  imepriimek varchar(50),
  when date,
  action varchar(30),
  onfile varchar(100)
  unique id(iddiary)
 );

 To get formated date you should use:

 select date_format(when, %T%W%e%c%y) from diary;

 To put data in this field 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:1df2d4810905280643y62a0f092p91fa2c57558d8...@mail.gmail.com...
 CREATE TABLE diary(iddiary int auto_increment not null, imepriimek
 varchar(50), when date(%T%W%e%c%y), action varchar(30), onfile
 varchar(100) unique id(iddiary));

 I tried the above and it didn't work. What must I do to create a table
 with full time and date. If I should use timestamp how do I convert
 thee timestamp in php back to normal time? (I also tried the mysql
 command:
 when timestamp
 and
 when date
 in the above first mysql clause but it didnt work
 )

 Please help me. Thanks in advance,
 --
 When the sun rises I receive and when it sets I forgive -
 http://users.skavt.net/~gleskovs/
 All the Love, Grega Leskov'sek



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2009-05-28 Thread Grega Leskovsek
The problem was I  didn't type a comma before unique id(iddary).
Thanks to everybody for helping me on the seminar. Love, Grega

2009/5/28 LinuxManMikeC linuxmanmi...@gmail.com:
 Actually, AUTO_INCREMENT is the correct syntax for MySQL.  I think the
 problem is NOT NULL should come first: iddiary 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 escreveu na mensagem
 news:1df2d4810905280748uec4f425kaf14b6410caa...@mail.gmail.com...
 I GOT THIS ERROR when  I tried first sample with when timestamp;


 ERROR 1064 (42000): You have an error in your SQL syntax; check the
 manual thatcorresponds to your MySQL server version for the right
 syntax to use near 'id(iddiary) )' at line 1


 2009/5/28 João Cândido de Souza Neto j...@consultorweb.cnt.br:
 If you need date and hour the best way is:

 CREATE TABLE diary (
 iddiary int auto_increment not null,
 imepriimek varchar(50),
 when timestamp,
 action varchar(30),
 onfile varchar(100)
 unique id(iddiary)
 );

 Please advice. Thanks in advance, Grega

 if you need only date you can use:

 CREATE TABLE diary (
 iddiary int auto_increment not null,
 imepriimek varchar(50),
 when date,
 action varchar(30),
 onfile varchar(100)
 unique id(iddiary)
 );

 To get formated date you should use:

 select date_format(when, %T%W%e%c%y) from diary;

 To put data in this field 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:1df2d4810905280643y62a0f092p91fa2c57558d8...@mail.gmail.com...
 CREATE TABLE diary(iddiary int auto_increment not null, imepriimek
 varchar(50), when date(%T%W%e%c%y), action varchar(30), onfile
 varchar(100) unique id(iddiary));

 I tried the above and it didn't work. What must I do to create a table
 with full time and date. If I should use timestamp how do I convert
 thee timestamp in php back to normal time? (I also tried the mysql
 command:
 when timestamp
 and
 when date
 in the above first mysql clause but it didnt work
 )

 Please help me. Thanks in advance,
 --
 When the sun rises I receive and when it sets I forgive -
 http://users.skavt.net/~gleskovs/
 All the Love, Grega Leskov'sek



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





 --
 When the sun rises I receive and when it sets I forgive -
 http://users.skavt.net/~gleskovs/
 All the Love, Grega Leskov'sek



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 advance, Grega from Slovenia

-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to delete part of string

2009-05-23 Thread Grega Leskovsek
No, I used POST and manage the data through a stream:

if ($fp = fopen(php://input, 'r')) {
   $content = '';

   // keep reading until there's nothing left
   while ($line = fgets($fp)) {
  $content .= $line;

   }
  }
Please advice on the matter. All the Love, Grega from Slovenia

2009/5/23 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 want to skip some  fields before id=
 How do I simply delete
 operation=nekajprice=fddfid=deid=ta ...
 into
 id=deid=ta ...

 Thanks in advance,


 --
 Synchronize and share your files over the web for free
 http://bithub.net/

 My Twitter feed
 http://twitter.com/MarcSteinert








-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 advance,

-- 
When the sun rises I receive and when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 when it sets I forgive -
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php