RE: [PHP] not null

2001-08-08 Thread Slavomir Slizik

if (empty($value)) { ... }


On Wed, 1 Aug 2001, Craig Vincent wrote:


  When a field is declared as an integer, not null and is the primary,
  how would I address it's empty set?
 
  ex: if($value == ???)
  {
  bla
  bla
  bla
  }
 
 
  My condition wants there to be nothing in $value.

 Are you referring to the (INT, NOT NULL, PRIMARY) field being in a database?

 Sincerely,

 Craig Vincent


 --
 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]




Re: [PHP] fopen - warnings

2001-07-27 Thread Slavomir Slizik


...
if ($datei = @fopen($file[$i], r+))
...


On Thu, 26 Jul 2001, Vanessa wrote:

 Hello List,

 this is probably a very stupid question, but I dont know how to solve this
 little problem:
 I have a script with which text files (exported access db data sheets) can
 be uploaded to the mysql tables.
 It all works fine, but very annoyingly I get warning messages, if the text
 file is not resident on the server. But I want it in a way that it doesnt have
 to be on the server...a catch. The php manual says that if the file
 cannot be opened fopen returns false. All nice and good working, but I get
 those additional warning messages. Im not sure if it has maybe something
 to do with the server, but I am not convinced. Ill put the code below.
 Any suggestions are highly appreciated (I tried die command but it somehow
 messed up the routine).

 [schnipp]

 $file = array (colours.txt, categories.txt, stockmain.txt,
 stockcolours.txt);
 $i = 0;
 while ($file[$i])
 {
 //öffne das textfile
  $datei = ;

  if ($datei = fopen($file[$i], r+))
  {
  $zaehler = 0;
 //check wieviele zeilen das textfile hat
 //um zu verhindern, dass es leer ist!
  while (!feof ($datei)) //liest jede zeile einzeln mit fget()
  {
  $buffer = fgets($datei, 1000);
  //echo $buffer;
  //echo br;
  $zaehler++;
  } //end while (!feof ($datei))

  // MORE CODE AFTER THIS
  // .

  }
  else
  {
 ?
  tr
  tdThe file ? echo $file[$i]; ? could not be
 opened: no Mysql insert./td
  /tr
 ?
  }
  $i++;
  if ($datei)
  { fclose($datei); }
 }

 [/schnipp]

 Warning messages are:

 Warning: fopen(categories.txt,r+) - No such file or directory in *some
 directory* on line 32


 I hope anybody can help...

 - Nessi -




--
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]




Re: [PHP] Prevent user to close web browser

2001-07-19 Thread Slavomir Slizik

So, try to surf some free erotic,porn sites. They're full of that
window-spawing stuff :(

slavko


On Thu, 19 Jul 2001, kath wrote:

 Not with PHP.  Maybe some Javascript could.

 But why would you want this?  Planning some infinite spawning pop up website?
 =)

 - k

 On Thursday 19 July 2001 08:28 am, you wrote:
  Hello,
 
  I need to prevent user to close the web browser on close button or by
  pressing ALT+F4.
 
  Is this possible?
 
  Thanks,
  Mihailo.
 
 
  _
  Do You Yahoo!?
  Get your free @yahoo.com address at http://mail.yahoo.com

 --
 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]




Re: [PHP] Sessions + Variables + includes

2001-07-19 Thread Slavomir Slizik

On the title page:

session_register(loggedin);
then:
session_start(); on every page
better to test session availability on every page:
if (!session_is_registered(loggedin)) {
// redirect user to title page where the session is registered
}

But your method of handling sessions and logins is very strange and
insecure :)

slavko


On Thu, 19 Jul 2001, dosenbrei wrote:



 Hi

 Sorry for my bad english ;-)

 I'm writing an application using php and sessions.
 In the first include file i'm writing something like this

 session_start();
 session_register(loggedin);

 The i have another include file with the functions.
 When i'm submitting the username and passwort to the function
 which checks them i'd like to set loggedin to 1 how does this work?

 function CheckLogin($username,$password)
 {
 if($username=='test'  $password=='user')
 {
 $loggedin=1;
 header(location:secretpage.php);
 }
 else
 {
 $loggedin =0;
 header(location:login.php)
 }

 Can i user include with sessions or doe i have to use requiere?
 I also tried to set the $loggedin to 1 this way:

 $HTTP_SESSION_VARS[loggedin]=1;

 This doesn't work too.

 Please help me


 THX

 --
 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]




Re: [PHP] set var in PHP

2001-07-18 Thread Slavomir Slizik

Hello,

it isn't regular html, it is only server-parsed stuff .. Server Side
Includes.
You won't need that in PHP, just do:

?
$TITLE=This is my title.;
?

htmlhead
title?=$TITLE?/title

blah blah blah ..


SSL



On Wed, 18 Jul 2001, jessica lee tishmack wrote:

 In html, I can do

 !--#set var=TITLE value=some title here--

 How do I do this in PHP?

 Thanks,
 Jessica


 --
 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]