Re: [PHP] Calculate # of minutes during working hours between two dates

2001-06-20 Thread Jon Rosenberg

sloppy psuedocode:(but you get the idea)
numdays = date2 - date1
minperday = 60 * 9.5(hrs)
totalminutes for interval = numdays * minperday


- Original Message -
From: Wim Koorenneef [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, June 20, 2001 11:25 AM
Subject: [PHP] Calculate # of minutes during working hours between two dates


 Hi all,

 I want to calculate the number of minutes between two dates, but only
 those minutes on monday through friday between 08.00 and 17.30.

 I could evaluate every minute in the interval against all known minutes
 during working hours, but that's a bit much :-) Any suggestions for a
 better, more efficient algorithm? Tia.

 --
 Greetinx,

 Wim Koorenneef [EMAIL PROTECTED] Boxtel, the Netherlands


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




[PHP] --register-globals - dev question

2001-05-04 Thread Jon Rosenberg

Can someone on the dev team remind me at what version --register-globals
became the default way PHP works?  I looked in the config manual, but it
looks like that config optoin has been completely removed from the list.  I
think now it is in the php.ini file.  Is this correct?  Thanks

Jon


-- 
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] hdml simulator?

2001-05-04 Thread Jon Rosenberg

The up.sdk phone sim works for me with both wml and hdml as well.  You just
have to make sure you are sending the correct headers, etc...

Jon


- Original Message -
From: Data Driven Design [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, May 04, 2001 1:39 PM
Subject: [PHP] hdml simulator?


 I'm writing some wireless content in PHP and I've found several wml
 simulators but none for hdml. The up.sdk says it works for hdml but
displays
 my wml content. Anybody know where to find a hdml simulator?

 Data Driven Design
 P.O. Box 1084
 Holly Hill, Florida 32125-1084

 http://www.datadrivendesign.com
 http://www.rossidesigns.net


 --
 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] php/mySql SELECT where clause using dates.

2001-05-03 Thread Jon Rosenberg

Take out the order by clause or chaqnge it.  You can't order by a column you
aren't selecting.


- Original Message -
From: Dan Eskildsen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 03, 2001 10:30 AM
Subject: [PHP] php/mySql SELECT where clause using dates.


 ***NEWBIE ALERT***  (I am only very new at this)

 PHP and MySQL

 OK - I have a table with data and one of the fields is a Date field.

 Now I would like to SELECT all records where the date is less that 45 days
 old.

 Eh, How do I do that?

 I have tried this:

 #Declaring variables
 $today=date(Y-m-d);
 $lastmonth = $today-30

 $query = SELECT * FROM customers WHERE Site='egebjergnet' AND
 DatoOprettet'$lastmonth' ORDER BY FirmaNavn;


 AND I get an error, of course.  hmmm
 --
 ==
 Regards from Denmark, Europe
 Please cc your reply to [EMAIL PROTECTED]
 ==
 I haven't lost my mind, I've got it backed up on TAPE somewhere...



 --
 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] php/mySql SELECT where clause using dates. ooops

2001-05-03 Thread Jon Rosenberg

i'm sorry, I looked at the wrong part.  You need to use the PHP functions to
convert your date to a timestamp, then subtract 30 days from it, then
reconvert to a MySQL date format.

Jon


- Original Message -
From: Jon Rosenberg [EMAIL PROTECTED]
To: Dan Eskildsen [EMAIL PROTECTED]
Cc: PHP General List [EMAIL PROTECTED]
Sent: Thursday, May 03, 2001 10:28 AM
Subject: Re: [PHP] php/mySql SELECT where clause using dates.


 Take out the order by clause or chaqnge it.  You can't order by a column
you
 aren't selecting.


 - Original Message -
 From: Dan Eskildsen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, May 03, 2001 10:30 AM
 Subject: [PHP] php/mySql SELECT where clause using dates.


  ***NEWBIE ALERT***  (I am only very new at this)
 
  PHP and MySQL
 
  OK - I have a table with data and one of the fields is a Date field.
 
  Now I would like to SELECT all records where the date is less that 45
days
  old.
 
  Eh, How do I do that?
 
  I have tried this:
 
  #Declaring variables
  $today=date(Y-m-d);
  $lastmonth = $today-30
 
  $query = SELECT * FROM customers WHERE Site='egebjergnet' AND
  DatoOprettet'$lastmonth' ORDER BY FirmaNavn;
 
 
  AND I get an error, of course.  hmmm
  --
  ==
  Regards from Denmark, Europe
  Please cc your reply to [EMAIL PROTECTED]
  ==
  I haven't lost my mind, I've got it backed up on TAPE somewhere...
 
 
 
  --
  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]




-- 
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] Your opinion on security issue: file extension

2001-05-01 Thread Jon Rosenberg

Not really, I mean it may deter a very novice hacker.  But, if the people
want in, they can very easily find out what server and server software you
are running.  For example, goto www.netcraft.com and click on 'What's that
site running?' and put in your www.domain.com address.  It will tell ou
everything about the server, even uptime.  So, if they want to know, they
can find out, file extensions just make it a bit easier...


- Original Message -
From: Johnson, Kirk [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 01, 2001 12:08 PM
Subject: [PHP] Your opinion on security issue: file extension


 I would like opinions on a security question.

 A co-worker suggested we rename our application files to some extension
 other than .php (for example, .htm). The reasoning being that the .php
 extension tells a cracker that we are using PHP, and not ASP, or
ColdFusion,
 etc. The cracker can focus immediately on vulnerabilities of PHP.

 So, is there something to be gained by masking our server setup by
changing
 our filename extension?

 TIA

 Kirk

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




[PHP] date list

2001-05-01 Thread Jon Rosenberg

I need to make a select list for a web page in the following format:

01/01/01-01/07/01
01/08/01-01/14/01
01/15/01-01/21/01
etc
etc
till the end of 2002 and further in the future eventually

I'd like to make PHP generate this for me so I don't have to handcode it for
each year in the future.  I've looked at the date/time functions and I'm a
bit confused.  Any help would be appreciated.  Thanks!

Jon


-- 
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] re : date list

2001-05-01 Thread Jon Rosenberg

Thanks everyone for the help!


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

2001-04-30 Thread Jon Rosenberg

This is how I do it:
in DB:
usertable
username,etc,tzone
where tzone = EST,PST,MNT,CNT
when the user logs in just grab the tzone, register it in the session.  Also
make them constants, so you know if the server is in CA, then EST = 10800

now when they do something, all you have to do is calc the time.  Like
result = mktime() - EST

Is this what you were talking about?

Jon


- Original Message -
From: Joe Stump [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 30, 2001 2:56 PM
Subject: [PHP] timezones


 I have a quick question regarding timezones ...

 On the local side a record is inserted into the DB by someone in Michigan,
while
 the server rests in CA. Thus a three hour difference. The local mktime()
will
 create a timestamp for say 9:00am when in reality it was entered at
12:00noon
 in MI. I have 2 character timezones for all my users so it should be easy
to
 convert the two.

 putenv() won't work because of the fact that the timestamp created will be
 9:00 no matter what timezone you put it in. So what needs to be done is
some
 recognition that 10800 seconds needs to be added to adjust the PST
timestamp
 to an EST timestamp. Are there any functions out ther that do this?

 --Joe

 Joe Stump [EMAIL PROTECTED]
 
 One is taught by experience to put a premium on those
 few people who can appreciate you for what you are.


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

2001-04-30 Thread Jon Rosenberg

http://www.worldtimeserver.com/
has them all..then you can just assign your constants to them in a way that
makes sense to you


- Original Message -
From: Joe Stump [EMAIL PROTECTED]
To: Mark Maggelet [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, April 30, 2001 3:24 PM
Subject: Re: [PHP] timezones


 Thanks to everyone who sent in the info. The problem is as follows:

 1.) the mktime()'s are stored as PST in the DB.
 2.) we have users ALL OVER the world - is there a place to find all of the
 timezones at?

 --Joe

 On Mon, Apr 30, 2001 at 12:11:55PM -0700, Mark Maggelet wrote:
  On Mon, 30 Apr 2001 13:56:20 -0500, Joe Stump ([EMAIL PROTECTED])
  wrote:
  I have a quick question regarding timezones ...
  
  On the local side a record is inserted into the DB by someone in
  Michigan, while
  the server rests in CA. Thus a three hour difference. The local
  mktime() will
  create a timestamp for say 9:00am when in reality it was entered at
  12:00noon
  in MI. I have 2 character timezones for all my users so it should be
  easy to
  convert the two.
 
  you could use gmmktime() instead and add or subtract the offset.
 
  $offsets=array(
  PST=1000,  // not actual values
  EST=-2000,
  );
 
  $localtime=gmmktime()+$offsets[$timezone];
 
  putenv() won't work because of the fact that the timestamp created
  will be
  9:00 no matter what timezone you put it in. So what needs to be done
  is some
  recognition that 10800 seconds needs to be added to adjust the PST
  timestamp
  to an EST timestamp. Are there any functions out ther that do this?
  
  --Joe
  
  Joe Stump [EMAIL PROTECTED]
  -
 
  ---
  One is taught by experience to put a premium on those
  few people who can appreciate you for what you are.
  
  
  --
  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: php-list-
  [EMAIL PROTECTED]
 

 Joe Stump [EMAIL PROTECTED]
 
 Dyslexics of the world

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




[PHP] MySQL broken in 4.0.5RC6

2001-04-09 Thread Jon Rosenberg

I know this belongs in the developers list..but for some reason, it's not
allowing me to subscribwe, so I'm posting it here.

When I upgrade to 4.0.5rc6, i get the following error:

Warning: MySQL Connection Failed: Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (111) in
/home/sites/site1/web/intranet/main.php on line 309

When I reinstall 4.0.4pl1, all works perfectly.  I'm using RH Linux 6.2,
Mysql 3.23.36 from RPMs on mysql.com.
Here is my configure line I used for both 4.0.4pl1 and 4.0.5rc6
./configure --with-mysql --with-imap=/usr/lib --enable-trans-sid --with-apxs
=/usr/sbin/apxs

Here is the code it chokes on when using RC6, but not 4.0.4pl1
303 - function pull_emp_db($username,$password)
304{
305$user = "***";   //username needed to access db
306$pass = "";   //password needed to access db
307$db_server = "localhost";   //the mysql db server
308$db = "lrefined";//Name of the database where information is
stored
309$db_connect = mysql_connect("$db_server", "$user", "$pass");
310  if (! $db_connect)
etc.


-- 
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] Select case equivelent

2001-04-04 Thread Jon Rosenberg

switch ($i) {
case 0:
print "i equals 0";
break;
case 1:
print "i equals 1";
break;
case 2:
print "i equals 2";
break;
}


- Original Message - 
From: "Allen May" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 04, 2001 2:07 PM
Subject: [PHP] Select case equivelent


 I have a list of conditions I want to test against. 
 In ASP, I would do:
 
 Select Case foo
 case "bar1"
 foobar = "fooey"
 case "bar2"
 foobar = "fooey2"
 case "bar3"
 foobar = "fooey3"
 case else
 foobar = "NoBar"
 End Select
 
 How do I do the equivelent in PHP?
 
 Thanks
 
 -Allen
 [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]
 


-- 
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] login without database

2001-03-30 Thread Jon Rosenberg

you could use flat files, another words store the user information in a text
file like below:
username|pass|email
bob|fgffsdg|[EMAIL PROTECTED]
foo|bar|[EMAIL PROTECTED]


and then just read and write the file with PHP.

Jon


- Original Message -
From: "Jan Grafstrm" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 30, 2001 11:15 AM
Subject: [PHP] login without database


 Hi!
 Can I use php to make a login system for users? I dont have a databas
 on my server. I only want to have a few users. When I send variables to
 php the string is always cached by IE5.5 and its very easy to se the
 username and password if you look i cache. Is there a way to get this
 done only on the server?


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

2001-03-29 Thread Jon Rosenberg

what version of PHP are you using?


- Original Message -
From: "Theo Richel" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, March 29, 2001 8:08 AM
Subject: [PHP] fatal error


 Can anyone please tell me why I get the following message: Fatal error:
Call
 to unsupported or undefined function session_start() in
 /www/richel/authent/index.php3 on line 22

 Thank you,

 Theo Richel



-- 
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 broken when redirected?

2001-03-29 Thread Jon Rosenberg

I don't know 100 for sure, but I believe since it is going to an https
link, it considers it a new domain(or something) and that's why the sessions
aren't persisting.  The same thing happens if you redirect from say
www.domain.com to www2.domain.com.  I odn't know any way around it, except
encoding, passing in URL and decoding on the other side.

jon


- Original Message -
From: [EMAIL PROTECTED]
To: "Php-General@Lists. Php. Net" [EMAIL PROTECTED]
Sent: Thursday, March 29, 2001 2:57 PM
Subject: [PHP] sessions broken when redirected?


 I've searched the archives and relevant web sites to no avail, so as a
 last resort I'm turning to this knowledgeable group of people.

 I'm working to set up a user authentication system using native PHP 4
 sessions on a box running Apache, mod_perl, mod_ssl, PHP (the lastest),
 etc.

 PHP was compiled with the following options:

 './configure' '--with-sybase-ct=/usr/local/freetds'
 '--with-config-file-path=/usr/local/lib' '--with-
 apache=../apache_1.3.19' '--enable-track-vars' '--enable-memory-
 limit=yes'

 Here's the problem:
 The browser is redirected by Apache (in the current setup, which for
 other reasons won't be changed) from a URL like
 http://somebody.com/foo/bar to a URL like https://somebody.com/bar.

 I have had no luck getting sessions, session ids, HTTP_POST_VARS, etc to
 successfully survive the redirect when the user moves between pages in
 the site. (passing variables through the url works, but we need
 something more secure than that).

 My feeling is that I'm missing something obvious. Cookies are enabled
 and working. I can start sessions and store variables, but only within
 one page. Once the user goes through a redirect (to the same server),
 everything is lost. It doesn't _seem_ like this should be a limitation
 of PHP, but maybe it is.

 Can anyone help clarify this?

 Thanks,
 Andrew Elliston


 --
 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] removing $HTTP_POST_VARS

2001-03-28 Thread Jon Rosenberg

You could just check the referrer, as pseudo-code below shows.

if refferer is not valid{
exit;
}
else{
do my stuff;
}


- Original Message - 
From: "Matt Williams" [EMAIL PROTECTED]
To: "PHP General List" [EMAIL PROTECTED]
Sent: Wednesday, March 28, 2001 9:20 AM
Subject: [PHP] removing $HTTP_POST_VARS


 Hi
 
 Is there a way I can remove all the values of $HTTP_POST_VARS?
 
 I'm trying to check where a form has been posted from and if it's not the
 right plac I want to remove all the post vars so they can't any damage.
 
 I've tried unset($HTTP_POST_VARS) but it doesn't seem to do anything.
 
 TIA
 
 M@
 
 
 -- 
 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] Q: php.ini

2001-03-28 Thread Jon Rosenberg

You need to restart your web server (apache, most likely).

Jon


- Original Message - 
From: "Joe Rice" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 28, 2001 11:34 AM
Subject: [PHP] Q: php.ini


 
 
 Hi,
   I made a change to my php.ini and
 phpinfo() doesn't reflect the change?
 
 i set
 sendmail_path   =   "/usr/lib/sendmail -OIgnoreDots -t"
 
 and phpinfo() still shows the default 
 sendmail_path   =   "/usr/lib/sendmail -t -i"
 
 
 how can i get this to work correctly?
 
 Thanks,
 joe
 
 Web Admin
 www.bigidea.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] Is it odd or even???

2001-03-05 Thread Jon Rosenberg

You could divide it by 2, odd numbers will always have a remainder even
umbers never will.

here are math functions, but none for odd/even that i see.

Jon

- Original Message -
From: "Brandon Orther" [EMAIL PROTECTED]
To: "PHP User Group" [EMAIL PROTECTED]
Sent: Monday, March 05, 2001 3:17 PM
Subject: [PHP] Is it odd or even???


 Hello,

 Is there an easy way to check and see if a number is odd or even?

 Thank you,

 
 Brandon Orther
 WebIntellects Design/Development Manager
 [EMAIL PROTECTED]
 800-994-6364
 www.webintellects.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] switch statement

2001-02-25 Thread Jon Rosenberg

Here is a basic example.

switch ($option)
{

case "optiona":
statements;
statements;
break;

case "optionb":
statements;
break;

}




- Original Message -
From: "Peter Houchin" [EMAIL PROTECTED]
To: "PHP MAIL GROUP" [EMAIL PROTECTED]
Sent: Sunday, February 25, 2001 9:03 PM
Subject: [PHP] switch statement


 Does any one know where there are some tutorials for the switch statement?

 Peter Houchin
 Sun Rentals
 [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]




[PHP] session_register in function

2001-02-24 Thread Jon Rosenberg

The variable I register before the function becomes available in the session
to other pages...the variable I register inside the function are not
accessible in the session to ohter pages.  Is this normal?  How can I work
around this?  Thanks!  PHP4.0.4pl1 on Linux.

sample code:

?
session_Start();

$foo = "bar";
session_register("foo");

function bob($user){
$username = $user . "one";
$username2 = $user . "two";
session_register("username");
session_register("username2");
return true;
}
?


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

2001-02-23 Thread Jon Rosenberg

I have a form that submits to abc.php which then calls db.php and db.php
then redirects to a new URL.  I have session_start(); on all these files and
I'm registering the variables I need.  It seems that the session dies or
gets lost on it's way through all the included files.  I then tried to pass
the SID in the URL that the db.php file creates, but the SID is empty once
it gets here...though, there is a SID befoer then.  Can sessions not be used
with multple include files?  What could I be doing wrong?  This is my first
forray into sessions...be gentle!

thanks!

Some code below, it's prettry straight forward.  I still have cookies
enabled, as well.  Do I need to disable cookies for the SID in URL method to
work?

index.php where they log in from
?
session_start();  //first line of file
?
form method="POST" action="main.php"
input type="hidden" value="lrlogin" name="form_action"
Usernamenbsp;nbsp;input type="text" name="username" class="color"br /
Passwordnbsp;nbsp;input class="color" type="password" name="password"br
/
input type="reset"nbsp;nbsp;nbsp;input type="submit" value="Login"

code from main.php
?
session_register();
require ("db.php");
if $form_action == "lrlogin"
{
get_user($username,$password);
}
?

code from db.php
?
session_start();
SQL to select user info from db
$access = $row[access_level]; //etc getting vars from db
session_register("username");
session_register("password");
session_register("access");
session_register("active");
header("Location:http://www.blah.com/index2.php?=".SID);
exit;
?

index2.php code
?
session_start();

print "Welcome $username";
?

it only prints Welcome ...no username :(


-- 
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] session heads up

2001-02-16 Thread Jon Rosenberg

I just spent about 5 hours trying everything i could think of to get
sessions to workends up it was a simple problem that I should have
realized before i even started.
So, learn my oversight, save yourself 5 hours of going nuts.
I have several scripts that all pass vars between themselvesONE of those
scripts is on www.domain.com all the rest are on subdomain.domain.com well,
all the scripts that are forms have the form action set as
action=http://www.domain.com/script.php  nevertheless, I couldn't grasp what
was wrong...the problem is that the session information is trying to be
passed among more than one domain (www and subdomain)...coookies don't like
this and weren't releasing the info to the subdomain that was created in the
www domain.  So, heads up to anyone else...keep all your scripts in the same
domain when using sessions/cookies.  By moving hte one script to the
subdomain as well, all the problems went away and PHP is once again my
favorite we language :)

jon


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

2001-02-09 Thread Jon Rosenberg

I'm about to upgrade to mysql 3.23  on a production installation on linux
with PHP 4.0.4pl1, has anyone had any problems with this combination, as
compared to 4.0.4pl1 with 3.22.xx?  Thanks!

Jon


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

2001-01-10 Thread Jon Rosenberg

I know this is kinda silly.  but, if I have the following, will the file
only be included when the case is matched or does require always bring in
the file regarless?

case blah:
require('include.php');
do something
break;

-
Jonathan Rosenberg
Be fierce, be fabulous, change the world!





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