php-general Digest 23 Nov 2002 20:55:04 -0000 Issue 1722

Topics (messages 125716 through 125738):

Re: php teleprogramming -- How to avoid being ripped off ?
        125716 by: Khalid El-Kary

How to obtain unique XML Elements
        125717 by: David Pratt
        125718 by: Khalid El-Kary

Undefined Variable
        125719 by: Adriano Santos
        125720 by: Derick Rethans
        125724 by: Adriano Santos
        125725 by: Derick Rethans
        125734 by: Adriano Santos

Re: extension can't be found
        125721 by: Derick Rethans

Re: Post again. question about Animated GIF
        125722 by: Derick Rethans

Re: put result of "include" into a variable
        125723 by: Derick Rethans

Some error in file upload.
        125726 by: Naif Al-Otaibi
        125727 by: Derick Rethans

Re: Some error in file upload.]
        125728 by: Marco Tabini
        125730 by: Marco Tabini

Re: OT- "Private Registrations" for Domains
        125729 by: Ernest E Vogelsinger

Re: echo'ing array contents through reference variable ... why doesn't this work???
        125731 by: -<[ Rene Brehmer ]>-
        125733 by: Ernest E Vogelsinger

Re: dynamic arraynames
        125732 by: John W. Holmes

Re: echo'ing array contents through reference variable
        125735 by: Tularis

Insert file into sql server binary field.
        125736 by: Naif Al-Otaibi

using cookies
        125737 by: Ken Nagorski
        125738 by: Rich Gray

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- hi,
don't be so unhappy withit, because you won however, money comes and goes knowledge stays, through this experience you learned much, right? so you didn't lost much! :-)





_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail

--- End Message ---
--- Begin Message ---
Anyone have a simple technique for obtaining a unique list of elements from
an XML file?

Am looking for something that will identify the first opening tag ie
<thistag> and the single tag <anothertag/> so that I get an array of tags
that I can print out.  Having a bit of trouble with regex to get something
to work.

Basic idea I had is to open file, read through each line with regex, add
matches to array, and then do unique elements of array and write to another
file.

Is there a better way?

--
Regards,
Dave
--- End Message ---
--- Begin Message --- hi,
you can get this parser

http://creaturesx.ma.cx/kxparse/

if you want only this limited functionality (take an old version) 0.2 for example, you may also want to take only particular functions from it

this is valid in all cases (as i think), except that you are developing another parser :)

khalid








_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus

--- End Message ---
--- Begin Message ---
Hi,

I'm with problem: Undefined Variable.
I'm using :
PHP 4.2.3
MySql 3.2.39
Windows 2000

How do I make to soluction my problem ?
thanks


--- End Message ---
--- Begin Message ---
Adriano Santos wrote:
Hi,

I'm with problem: Undefined Variable.
I'm using :
PHP 4.2.3
MySql 3.2.39
Windows 2000

How do I make to soluction my problem ?
at the top of your script:
error_reporting(E_ALL & ~E_NOTICE);

or initialize your variables likes:
$number = 0;
$string = "foo";

Derick


--

-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
My php.ini:  error_reporting = E_ALL & ~E_NOTICE

I have a form to send of the variables, but my page do not receive values.

This my code:

<?php
$nome = StrToLower($nome);
$senha = StrToLower($senha);
?>

thanks


"Derick Rethans" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Adriano Santos wrote:
> > Hi,
> >
> > I'm with problem: Undefined Variable.
> > I'm using :
> > PHP 4.2.3
> > MySql 3.2.39
> > Windows 2000
> >
> > How do I make to soluction my problem ?
>
> at the top of your script:
> error_reporting(E_ALL & ~E_NOTICE);
>
> or initialize your variables likes:
> $number = 0;
> $string = "foo";
>
> Derick
>
>
> --
>
> -------------------------------------------------------------------------
>   Derick Rethans                                 http://derickrethans.nl/
>   PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
> -------------------------------------------------------------------------
>


--- End Message ---
--- Begin Message ---
Adriano Santos wrote:
My php.ini:  error_reporting = E_ALL & ~E_NOTICE

I have a form to send of the variables, but my page do not receive values.

This my code:

<?php
$nome = StrToLower($nome);
$senha = StrToLower($senha);
?>
I guess you use PHP 4.2.0+; since this version the register_globals setting defaults to off. See http://www.php.net/release_4_2_0.php for more info.
This change was necessary as part of our efforts to make PHP scripting more secure and portable.

--

-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Thanks.
--- End Message ---
--- Begin Message ---
Liug wrote:
I just compiled/installed apache/php4.2.3 with postgres
support. the default php.ini-dist is used. I added
extension=pgsql.so
but when I start apache, error_log shows it can't find
pgsql.so.

after some trial and error, I found the following line in
the default php.ini causes the problem:
extension_dir = ./
if I comment this line out, apache can load pgsql.so fine.
I also tried to change to
extension_dir = /usr/local/lib/php/extensions/no-debug-non-zts-20020429
this also solves the problem.

My question is: is the default value in php.ini incorrect
or am I doing something wrong?
Nothing is wrong at all, the default setting in php.ini-dist is that you can load your modules from the current directory, this is needed for some users to provide them with loadable module support on ISPs; if you comment it out it uses the default in the code, which points to "/usr/local/lib/php/extensions/no-debug-non-zts-20020429".

Derick

--

-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Jungsu Heo wrote:
Hello~.

I made a PHP script which resize GIF Image.

But, Animated GIF don't Animate ;-(

Manual says 'use imagecolortransparent() to format GIF89'.
The library that PHP uses, libgd, can't handle multiple frames in a GIF. SO if you resize a GIF with it the result that comes out will only be the first frame in the original GIF file; there is nothing to do about this.


--

-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Ernest E Vogelsinger wrote:
One thing - be warned that some sites (esp. M$) send a redirect at the
index (or default) pages... the fopen() will not honor this redirect. Using
cUrl would be a better way to handle this, IMHO.
fopen() in the upcoming PHP 4.3.0 will support this though.

Derick


--

-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
I copy a complete example from a book to upload file and I got this 
message error when I browse the file:

Parse error: parse error, unexpected '!', expecting T_VARIABLE or '$' 
in c:\inetpub\wwwroot\php5\file_upload.php on line 32

Here is the content of the file (file_upload.php):

<?
// file_upload.php
  $archive_dir = "./docs";
  function upload_form() {
    global $PHP_SELF;
?>

    <FORM METHOD="POST" ENCTYPE="MULTIPART/FORM-DATA"
      ACTION="<? echo $PHP_SELF ?>">
      <INPUT TYPE="HIDDEN" NAME="action" VALUE="upload">
      Upload file!
      <INPUT TYPE="FILE" NAME="userfile">
      <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="upload">
    </FORM>
 
<?
  }
  
  function upload_file() {
    global $userfile, $userfile_name, $userfile_size,
                   $userfile_type, $archive_dir, $WINDIR;
        
        if(isset($WINDIR)) $userfile = str_replace
("\\\\","\\",$userfile);
        
        $filename = basename($userfile_name);
        
        if($userfile_size <= 0) die ("$filename is empty.");
        
        if(!@copy($userfile, "$archive_dir/$filename"))
          die ("Can't copy $userfile_name to $filename.");
        
error-> if(isset(!$WINDIR) && !@unlink($userfile))
          die ("Can't delete the file $userfile_name.");
          
        echo "$filename has been successfully uploaded.<BR>";
        echo "Filesize: " . number_format($userfile_size) . "<BR>";
        echo "Filetype: $userfile_type<BR>";
        
        }
        ?>
        <HTML>
        <HEAD><TITLE>FILE UPLOAD</TITLE></HEAD>
        <BODY>
        <?
        if($action == 'upload') upload_file();
        else upload_form();
        ?>
        </BODY>
        </HTML>

--- End Message ---
--- Begin Message ---
Naif Al-Otaibi wrote:
I copy a complete example from a book to upload file and I got this message error when I browse the file:

Parse error: parse error, unexpected '!', expecting T_VARIABLE or '$' in c:\inetpub\wwwroot\php5\file_upload.php on line 32
Change
if(isset(!$WINDIR)
to
if(!isset($WINDIR)

and it should work. I wonder, which book is this?

--

-------------------------------------------------------------------------
 Derick Rethans                                 http://derickrethans.nl/
 PHP Magazine - The PHP Magazine for Professionals - http://php-mag.net/
-------------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
-----Forwarded Message-----

> From: Marco Tabini <[EMAIL PROTECTED]>
> To: Naif Al-Otaibi <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Some error in file upload.
> Date: 23 Nov 2002 07:56:06 -0500
> 
> I think this needs changing:
> 
> error-> if(isset(!$WINDIR) && !@unlink($userfile))
> 
> into
> 
> if(!isset($WINDIR) && !@unlink($userfile))
> 
> Also, this would only work if you had register_globals on.
> 
> Mind if I ask which book did you copy the example from?
> 
> 
> Marco
> -- 
> ------------
> php|architect - The magazine for PHP Professionals
> The monthly worldwide magazine dedicated to PHP programmers
> Check us out on the web at http://www.phparch.com
> 
> 
> On Sat, 2002-11-23 at 07:41, Naif Al-Otaibi wrote:
> > 
> > I copy a complete example from a book to upload file and I got this 
> > message error when I browse the file:
> > 
> > Parse error: parse error, unexpected '!', expecting T_VARIABLE or '$' 
> > in c:\inetpub\wwwroot\php5\file_upload.php on line 32
> > 
> > Here is the content of the file (file_upload.php):
> > 
> > <?
> > // file_upload.php
> >   $archive_dir = "./docs";
> >   function upload_form() {
> >     global $PHP_SELF;
> > ?>
> > 
> >     <FORM METHOD="POST" ENCTYPE="MULTIPART/FORM-DATA"
> >       ACTION="<? echo $PHP_SELF ?>">
> >       <INPUT TYPE="HIDDEN" NAME="action" VALUE="upload">
> >       Upload file!
> >       <INPUT TYPE="FILE" NAME="userfile">
> >       <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="upload">
> >     </FORM>
> >  
> > <?
> >   }
> >   
> >   function upload_file() {
> >     global $userfile, $userfile_name, $userfile_size,
> >                $userfile_type, $archive_dir, $WINDIR;
> >     
> >     if(isset($WINDIR)) $userfile = str_replace
> > ("\\\\","\\",$userfile);
> >     
> >     $filename = basename($userfile_name);
> >     
> >     if($userfile_size <= 0) die ("$filename is empty.");
> >     
> >     if(!@copy($userfile, "$archive_dir/$filename"))
> >       die ("Can't copy $userfile_name to $filename.");
> >     
> > error->     if(isset(!$WINDIR) && !@unlink($userfile))
> >       die ("Can't delete the file $userfile_name.");
> >       
> >     echo "$filename has been successfully uploaded.<BR>";
> >     echo "Filesize: " . number_format($userfile_size) . "<BR>";
> >     echo "Filetype: $userfile_type<BR>";
> >     
> >     }
> >     ?>
> >     <HTML>
> >     <HEAD><TITLE>FILE UPLOAD</TITLE></HEAD>
> >     <BODY>
> >     <?
> >     if($action == 'upload') upload_file();
> >     else upload_form();
> >     ?>
> >     </BODY>
> >     </HTML>
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 


--- End Message ---
--- Begin Message ---
Naif,

I think your problem is related to register_globals. The authors of the
book probably based their scripts on a version of PHP that had that
option turned on by default, but as 4.2.0, it's been turned off as it is
usually considered a security risk. So, either use the superglobal
arrays (like $_POST) to access your HTML form variables or turn
register_globals on in your php.ini file.

Cheers,


Marco

Marco
-- 
------------
php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com

On Sat, 2002-11-23 at 08:16, Naif Al-Otaibi wrote:
> Thanks, I fix this error but now I have another one:
> Notice: Undefined variable: action in c:\inetpub\wwwroot\php5
> \file_upload.php on line 45
> 
> I have register_globals on
> 
> > -----Forwarded Message-----
> > 
> > > From: Marco Tabini <[EMAIL PROTECTED]>
> > > To: Naif Al-Otaibi <[EMAIL PROTECTED]>
> > > Subject: Re: [PHP] Some error in file upload.
> > > Date: 23 Nov 2002 07:56:06 -0500
> > > 
> > > I think this needs changing:
> > > 
> > > error-> if(isset(!$WINDIR) && !@unlink($userfile))
> > > 
> > > into
> > > 
> > > if(!isset($WINDIR) && !@unlink($userfile))
> > > 
> > > Also, this would only work if you had register_globals on.
> > > 
> > > Mind if I ask which book did you copy the example from?
> > > 
> > > 
> > > Marco
> > > -- 
> > > ------------
> > > php|architect - The magazine for PHP Professionals
> > > The monthly worldwide magazine dedicated to PHP programmers
> > > Check us out on the web at http://www.phparch.com
> > > 
> > > 
> > > On Sat, 2002-11-23 at 07:41, Naif Al-Otaibi wrote:
> > > > 
> > > > I copy a complete example from a book to upload file and I got 
> this 
> > > > message error when I browse the file:
> > > > 
> > > > Parse error: parse error, unexpected '!', expecting T_VARIABLE 
> or '$' 
> > > > in c:\inetpub\wwwroot\php5\file_upload.php on line 32
> > > > 
> > > > Here is the content of the file (file_upload.php):
> > > > 
> > > > <?
> > > > // file_upload.php
> > > >   $archive_dir = "./docs";
> > > >   function upload_form() {
> > > >     global $PHP_SELF;
> > > > ?>
> > > > 
> > > >     <FORM METHOD="POST" ENCTYPE="MULTIPART/FORM-DATA"
> > > >       ACTION="<? echo $PHP_SELF ?>">
> > > >       <INPUT TYPE="HIDDEN" NAME="action" VALUE="upload">
> > > >       Upload file!
> > > >       <INPUT TYPE="FILE" NAME="userfile">
> > > >       <INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="upload">
> > > >     </FORM>
> > > >  
> > > > <?
> > > >   }
> > > >   
> > > >   function upload_file() {
> > > >     global $userfile, $userfile_name, $userfile_size,
> > > >                    $userfile_type, $archive_dir, $WINDIR;
> > > >         
> > > >         if(isset($WINDIR)) $userfile = str_replace
> > > > ("\\\\","\\",$userfile);
> > > >         
> > > >         $filename = basename($userfile_name);
> > > >         
> > > >         if($userfile_size <= 0) die ("$filename is empty.");
> > > >         
> > > >         if(!@copy($userfile, "$archive_dir/$filename"))
> > > >           die ("Can't copy $userfile_name to $filename.");
> > > >         
> > > > error-> if(isset(!$WINDIR) && !@unlink($userfile))
> > > >           die ("Can't delete the file $userfile_name.");
> > > >           
> > > >         echo "$filename has been successfully uploaded.<BR>";
> > > >         echo "Filesize: " . number_format($userfile_size) . "<BR>";
> > > >         echo "Filetype: $userfile_type<BR>";
> > > >         
> > > >         }
> > > >         ?>
> > > >         <HTML>
> > > >         <HEAD><TITLE>FILE UPLOAD</TITLE></HEAD>
> > > >         <BODY>
> > > >         <?
> > > >         if($action == 'upload') upload_file();
> > > >         else upload_form();
> > > >         ?>
> > > >         </BODY>
> > > >         </HTML>
> > > > 
> > > > 
> > > > -- 
> > > > 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
> > 
> > 
> 
> 


--- End Message ---
--- Begin Message ---
At 22:02 22.11.2002, [EMAIL PROTECTED] said:
--------------------[snip]--------------------
>Has anyone heard of or used somthing like this, just received this notice 
>from my registrar?
--------------------[snip]-------------------- 

This simply means:

Buy this domain, pay for this domain, so it will be ours.
_YOU_ have to pay, _WE_ own the domain.

Wonder who would patent this.


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
Hi @ Edwin,

On Fri, 22 Nov 2002 12:34:35 +0900, you wrote about "Re: [PHP] echo'ing
array contents through reference variable ... why doesn't this work???"
something that looked like this:

>> This is my test code:
>> 
>>   $premieredag =
>> array("2002-11-22","2002-11-29","2002-12-06","2002-12-18");
>>   $d20021122 = array("001");
>>   $d20021129 = array("002","003","004");
>>   $d20021206 = array("005","006","007");
>>   $d20021218 = array("008","009");
>> 
>>   for ($i = 0; $i < count($premieredag); $i++) {
>>     echo("<td class=\"date\" width=\"15%\">");
>>     echo date("j. F Y",strtotime($premieredag[$i]));
>>     echo ("</td><td>&nbsp;</td>\n");
>>     echo("</tr><tr>\n");
>>     $pdag = "d".str_replace("-","",$premieredag[$i]);
>>     for ($n = 0; $i < count($$pdag); $n++) {
>
>It seems like $i would always be TRUE here, no?
>
>Just guessing...

DOH! Of course ... totally missed that ... thx

But then ... why doesn't it pull the data correctly from the array???
Now I just get this:

<td class="date" width="15%">22. November 2002</td><td>&nbsp;</td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td class="date" width="15%">29. November 2002</td><td>&nbsp;</td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td class="date" width="15%">6. December 2002</td><td>&nbsp;</td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td class="date" width="15%">18. December 2002</td><td>&nbsp;</td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>
<td colspan="2" class="filmtxt"></td>
</tr><tr>

Shouldn't 
      echo($$pdag[$n]);
be able to pull the string contents of the array? Or is there some extra
needed when using referenced variable?

The manual, atleast haven't found it, doesn't say anything about using
referenced variables at all, and definetely not with arrays...


--- End Message ---
--- Begin Message ---
At 16:50 23.11.2002, -<[ Rene Brehmer ]>- said:
--------------------[snip]--------------------
>Shouldn't 
>      echo($$pdag[$n]);
>be able to pull the string contents of the array? Or is there some extra
>needed when using referenced variable?
--------------------[snip]-------------------- 

This is ambiguous: is it "$$pdag" indexed by "[$n]", or is it "$pdag[$n]"
dereferenced? If you're using an interim variable you'll get what you need
- either use (depends on your data layout which I don't know)
    $temp = $pdag[$n];
    echo $$temp;
or
    $temp = $$pdag;
    echo $temp[$n];


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/


--- End Message ---
--- Begin Message ---
> I am trying to generate arrays to hold inputs to columns.  Column
> titles are input to a table as needed.  They are read by the program
> and placed across the page.  Then an array goes under each column name
> to collect the inputs to the various rows.  Everything works except to
> dynamically change the name of the array.
> 
> 
> while($foo=mysql_fetch_array($mysql_result)){
>     print "<INPUT TYPE=text NAME=correspondingfoo[]>";}

Do you want this??

print "<INPUT TYPE=text NAME=" . $foo['something'] . "[]>";

---John Holmes...


--- End Message ---
--- Begin Message --- echo ${$pdag[$n]}; // is also possible in case the [$n] is the index to pdag. Otherwise use this:
echo ${$pdag}[$n];

- Tularis

PS. This is basicly the same thing as Ernest said, but shorter...

Ernest E Vogelsinger wrote:

At 16:50 23.11.2002, -<[ Rene Brehmer ]>- said:
--------------------[snip]--------------------

>Shouldn't
>     echo($$pdag[$n]);
>be able to pull the string contents of the array? Or is there some extra
>needed when using referenced variable?

--------------------[snip]--------------------

This is ambiguous: is it "$$pdag" indexed by "[$n]", or is it "$pdag[$n]"
dereferenced? If you're using an interim variable you'll get what you need
- either use (depends on your data layout which I don't know)
    $temp = $pdag[$n];
    echo $$temp;
or
    $temp = $$pdag;
    echo $temp[$n];



--- End Message ---
--- Begin Message ---
How can I insert a file into a binary field in sql server 2000. Do I 
need some function in the query like upload or just read the file and 
insert it.

Thanks,
--- End Message ---
--- Begin Message ---
Hi there,

I have never used cookies before, however I am trying to implement them to
make things a little more secure. Rather than passing a sql statement via a
hidden input tag I am setting a cookie. This works fine except that when I
look at the sql after it is pulled from the cookie everything is escaped,
for instance.

SELECT * FROM inventory WHERE name='Watches'
  would become
SELECT manufacturer FROM inventory WHERE name=\'Watches\'

This is a problem cause trying to use preg_replace doesn't seem to work. I
get an error saying that the delimeter must not be a \. What a bummer. I am
a little stuck. I will take any suggestions. Maybe I am just going about
things the wrong way. *** Shrug ***

Thanks
Ken



--- End Message ---
--- Begin Message ---
Ken

Do *not* use hidden form statements or cookies to store any SQL this is
extremely dangerous and a relatively simple hack could destroy your database
completely!

By all means use hidden form fields to store row ID values but your PHP
scripts should treat all user input data via $_GET/$_POST/$_COOKIE/$_FILES
as hostile and you should be rigorous in validating that data coming into
your script is as you would expect...

Having said that it seems your server has magic_quotes_gpc() switched on -
this automatically escapes all incoming data that could upset a SQL query
i.e. the quotes - you can remove them by using stripslashes() or switch off
magic quotes in your php.ini file. But I would repeat *don't* continue down
the path you are going unless you like being hacked!

HTH
Rich
-----Original Message-----
From: Ken Nagorski [mailto:[EMAIL PROTECTED]]
Sent: 23 November 2002 11:52
To: [EMAIL PROTECTED]
Subject: [PHP] using cookies


Hi there,

I have never used cookies before, however I am trying to implement them to
make things a little more secure. Rather than passing a sql statement via a
hidden input tag I am setting a cookie. This works fine except that when I
look at the sql after it is pulled from the cookie everything is escaped,
for instance.

SELECT * FROM inventory WHERE name='Watches'
  would become
SELECT manufacturer FROM inventory WHERE name=\'Watches\'

This is a problem cause trying to use preg_replace doesn't seem to work. I
get an error saying that the delimeter must not be a \. What a bummer. I am
a little stuck. I will take any suggestions. Maybe I am just going about
things the wrong way. *** Shrug ***

Thanks
Ken




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



--- End Message ---

Reply via email to