when the cookie is not set, the $HTTP_COOKIE_VARS will not have an index
'getdwgnum'

maybe you should try it this way

<?php

  $cook = mt_rand (5, 50000) ;
  if isset($HTTP_COOKIE_VARS["getdwgnum"]))


      $cookieinfo = $HTTP_COOKIE_VARS["getdwgnum"];
 }
  if ($cookieinfo > "")
  {
         $str = "where Cook = $cookieinfo";
         $cx=odbc_pconnect("doc","","");
   }
   else
          setcookie ("getdwgnum", $cook,time()+28800);

?>

this code is not checked by executing. but I guess this should be the
reason.

hope that helps

best regards

Ankur Verma
HCL Technologies
A1CD, Sec -16
Noida, UP
India.


"Gary" <[EMAIL PROTECTED]> wrote in message
96bo38$1j7$[EMAIL PROTECTED]">news:96bo38$1j7$[EMAIL PROTECTED]...
> I am getting the following error message from the code below.
>
> Warning: Undefined index: getdwgnum in d:\apache\htdocs/getdwgnum.php on
> line 4
>
>
> <?php
>
>  $cook = mt_rand (5, 50000) ;
>  $cookieinfo = $HTTP_COOKIE_VARS["getdwgnum"];
>  if ($cookieinfo > "")
>  {
>         $str = "where Cook = $cookieinfo";
>         $cx=odbc_pconnect("doc","","");
>   }
>   else
>          setcookie ("getdwgnum", $cook,time()+28800);
>
> ?>
>
>
> I want to look for a cookie and if it is not there I want to set one. Any
> ideas?
>
> Thanks, Gary
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to