[PHP] Upgrade issues

2002-11-25 Thread Chris Knipe
Lo all,

I upgraded from PHP 4.2.1 to 4.2.2, and now all of a sudden the following
code is generating a WARNING???


if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) {
$modpath = "themes/$ThemeSel/";
}

I don't get it?

Warning: Unable to access themes/DeepBlue/modules/News/index.php in
/usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46

Line 46 is the if statement

:/


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




Re: [PHP] Upgrade issues

2002-11-25 Thread Chris Knipe
> > if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php")) {
> > $modpath = "themes/$ThemeSel/";
> > }
> >
> > I don't get it?
> >
> > Warning: Unable to access themes/DeepBlue/modules/News/index.php in
> > /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46
> >
> > Line 46 is the if statement
>
> If you have using a new php.ini file, perhaps you can compare it with an
old
> one and see if there's anything different--might give you a hint.

Yeah, and no.  It's FreeBSD-Ports, my php.ini is unchanged.  FreeBSD
installs the new / updated ini files as ini-dist, so hence, nothing on my
settings has changed.  I did also check to verify this, and it is indeed the
correct ini file, with the correct settings...

> But then again, perhaps the problem is somewhere else... (i.e. file is not
> there, permissions, etc.)

Yes the file does not exist.  But isn't that why file_exists() is there?

--
me


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




Re: [PHP] Upgrade issues

2002-11-25 Thread Chris Knipe
> > > > if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php"))
{
> > > > $modpath = "themes/$ThemeSel/";
> > > > }
> > > >
> > > > I don't get it?
> > > >
> > > > Warning: Unable to access themes/DeepBlue/modules/News/index.php in
> > > > /usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46
> > > >
> > > > Line 46 is the if statement
> > >
> > > If you have using a new php.ini file, perhaps you can compare it with
an
> > old
> > > one and see if there's anything different--might give you a hint.
> >
> > Yeah, and no.  It's FreeBSD-Ports, my php.ini is unchanged.  FreeBSD
> > installs the new / updated ini files as ini-dist, so hence, nothing on
my
> > settings has changed.  I did also check to verify this, and it is indeed
> the
> > correct ini file, with the correct settings...
> >
> > > But then again, perhaps the problem is somewhere else... (i.e. file is
> not
> > > there, permissions, etc.)
> >
> > Yes the file does not exist.  But isn't that why file_exists() is there?
>
> Right, I might be typing faster than I am thinking... :)
>
> Still, just make sure that PHP is using the php.ini file that you think
it's
> using. The file that _you_ check didn't change but _php_ might be looking
> somewhere else... Of course, I could be wrong--haven't used
> FreeBSD/Ports--only linux.

As ridiculous as this sounds...

Turning of safe mode made the warning go away.  Now, I guess the question
is, 1) is this a bug in the file_exists() function, or 2) does the default
warning levels increase when operating under safe mode?

Either way, this never happened to me before, and is only now happening
since upgrading from 4.2.1 to 4.2.2...

Rather peculiar I think...

--
me


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




Re: [PHP] Upgrade issues

2002-11-25 Thread Chris Knipe
All files are owened by my Apache user + Group, set to rw access on files
and rwx on directories...

I do a chown + chmod on my web server's tree every few minutes via cron for
my development system.

Just to proove my point...

root@netsonic:~# ls -l
/usr/local/www/v-webs/games.savage.za.org/html/index.php
-rw-r-  1 www  www  2512 Nov 24 22:16
/usr/local/www/v-webs/games.savage.za.org/html/index.php
root@netsonic:~# cat /usr/local/etc/apache/httpd.conf|grep User
User www



- Original Message -
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Monday, November 25, 2002 8:19 PM
Subject: Re: [PHP] Upgrade issues


> Check the owners of directories and files, they must be the same as for
> /usr/local/www/v-webs/games.savage.za.org/html/index.php, then it should
> work under
> safe mode too.
>
>
> Chris Knipe wrote:
>
> >>>>>if (file_exists("themes/$ThemeSel/modules/$name/$mod_file.php"))
> >>>>>
> >>>>>
> >{
> >
> >
> >>>>>$modpath = "themes/$ThemeSel/";
> >>>>>}
> >>>>>
> >>>>>I don't get it?
> >>>>>
> >>>>>Warning: Unable to access themes/DeepBlue/modules/News/index.php in
> >>>>>/usr/local/www/v-webs/games.savage.za.org/html/index.php on line 46
> >>>>>
> >>>>>Line 46 is the if statement
> >>>>>
> >>>>>
> >>>>If you have using a new php.ini file, perhaps you can compare it with
> >>>>
> >>>>
> >an
> >
> >
> >>>old
> >>>
> >>>
> >>>>one and see if there's anything different--might give you a hint.
> >>>>
> >>>>
> >>>Yeah, and no.  It's FreeBSD-Ports, my php.ini is unchanged.  FreeBSD
> >>>installs the new / updated ini files as ini-dist, so hence, nothing on
> >>>
> >>>
> >my
> >
> >
> >>>settings has changed.  I did also check to verify this, and it is
indeed
> >>>
> >>>
> >>the
> >>
> >>
> >>>correct ini file, with the correct settings...
> >>>
> >>>
> >>>
> >>>>But then again, perhaps the problem is somewhere else... (i.e. file is
> >>>>
> >>>>
> >>not
> >>
> >>
> >>>>there, permissions, etc.)
> >>>>
> >>>>
> >>>Yes the file does not exist.  But isn't that why file_exists() is
there?
> >>>
> >>>
> >>Right, I might be typing faster than I am thinking... :)
> >>
> >>Still, just make sure that PHP is using the php.ini file that you think
> >>
> >>
> >it's
> >
> >
> >>using. The file that _you_ check didn't change but _php_ might be
looking
> >>somewhere else... Of course, I could be wrong--haven't used
> >>FreeBSD/Ports--only linux.
> >>
> >>
> >
> >As ridiculous as this sounds...
> >
> >Turning of safe mode made the warning go away.  Now, I guess the question
> >is, 1) is this a bug in the file_exists() function, or 2) does the
default
> >warning levels increase when operating under safe mode?
> >
> >Either way, this never happened to me before, and is only now happening
> >since upgrading from 4.2.1 to 4.2.2...
> >
> >Rather peculiar I think...
> >
> >--
> >me
> >
> >
> >
> >
>
>
> --
> 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




Re: [PHP] Can I check MYSQL version

2002-12-08 Thread Chris Knipe
oh gawd... get the spoons...

$query = mysql_query("select version as version")
while ($result = mysql_fetch_row($query)) {
//  do a strcmp() or ereg() on $row['0']
}


- Original Message -
From: "John Taylor-Johnston" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 08, 2002 9:57 PM
Subject: Re: [PHP] Can I check MYSQL version


> mysql> SELECT VERSION();
>  -> '3.23.13-log'
>
> Ok, how do I PHP it for greater than or equals version 4 :?
>
> John
>
> Johannes Schlueter wrote:
>
> > On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote:
> > > Hi,
> > > Can I check mysql version so if version >= 4 $sql = 'version 4 stuff'
else
> > > $sql ="version 3 stuff";
> >
> > Try this SQL-Statement:
> >
> > SEELCT VERSION();
> >
> > MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html
> >
> > johannes
>
>
> --
> 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




Re: [PHP] Mass Mailing

2002-12-21 Thread Chris Knipe
Why not just use simple alias files?

1) You have a file with all your addresses

file.asc:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
etc

2) You have the alias entry
my-mass-list::include:/path/to/file.asc

3) PHP sends one email to [EMAIL PROTECTED]
4) The mail server (if it's any good), expands all the addresses from
file.asc and does the mass mailing...

Problem sorted?  The alias file (included) can easily be managed with PHP.
With a little tweaking, you can even include a script directly via the alias
file by using a | (pipe).  The script can go as far as to even get the list
of email addresses from a MySQL DB or something... You can do the script in
just about anything you want... Sh, Perl, PHP, Python, Java... Doesn't
really make a difference.

A pipe will actually give you better security, as you can verify the email
before actually sending out 100,000 odd copies of it.  Here, you can sign
the message with a PGP key via PHP for example.  If the key's do not match,
the script doesn't send the email (And obviously, you remove the key from
the email before sending it out from the piped script)

Anyways, that's how I would do it if I couldn't use mailman for whatever
reason.  IMHO, keeping as much of the mail on a mail server will drastically
improove the performance, because a mail server is made to
process/send/receive email, PHP is not ;-)

--
me



- Original Message -
From: "Jonathan Chum" <[EMAIL PROTECTED]>
To: "'Gil Disatnik'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, December 22, 2002 2:03 AM
Subject: RE: [PHP] Mass Mailing


> Yea, I'd like to see that. How many people are on your lists if you
> don't mind me asking?
>
> I also came across this evening, http://phpmailer.sourceforge.net and
> http://www.octeth.com/index.php uses this class on it's backend,
> claiming that it is able to send 500,00 on a AMD Duron 900 with 512MB
> RAM in 10 hours.
>
> The phpmailer class says that directly conneting to mail() is better
> than using SMTP as it puts more of an overhead. Though I was looking at
> Perl packages such BulkMail that uses SMTP was able to send out 100,000
> emails.
>
> Everyone says that PHP's mail() causes several Sendmail instances to
> fork off which is ineffcient.
>
> -Original Message-
> From: Gil Disatnik [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, December 21, 2002 6:46 PM
> To: Jonathan Chum
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Mass Mailing
>
> I have written a few useful php functions that put the email addresses
> on
> one file and the message on another file.
> I have a crontabbed script that runs every min looking for these files
> and
> then using qmail-inject to send them (sendmail is bad, replace it ;))
> It's very good for sending a few thousands emails every time as the php
> script execution finishes in a second and you don't have to deal with
> max
> execution time and everything.
>
> If you wish I could send you the scripts.
>
> At 05:10 PM 12/21/2002 -0500, you wrote:
> >An upcoming project I'm working and spec'ing out is a mass mailing
> >application. Initially, I was looking at Mailman which was written in
> Python
> >since it looks like it handles delivering emails efficiently without
> killing
> >the server. We have 1 client able to send 110,000 emails at 6.5K avg
> per
> >week on PIII 800 with 128 MB RAM using Mailman. The inteface however is
> very
> >bad and we'd like to develop other features like text ads, tracking,
> >templates, etc. This would require writing a wrapper around Mailman in
> PHP.
> >I was considering of writing the mass mailing application in PHP
> instead
> >though.
> >
> >If anyone has eperience writing such applications with this amount of
> >emails, I'd like to know what you've done.
> >
> >I'm thinking of coding the front end in PHP that will put the email
> into a
> >queue table that will force a command line PHP script listening on a
> >particular port to scan the database for this new task in queue. Once
> it
> >picks up the task, the timeout for this application to run will be set
> to
> >infinite. It'll establish a SMTP socket either to a really beefed up
> mailing
> >list server or the localhost SMTP server to begin blasting out these
> emails.
> >
> > From what I understand, it's better to blast emails via an open socket
> >connection to SMTP rather than looping through Sendmail. Is this the
> right
> >thing todo?
> >
> >I've also heard that PHP is not good for writing mailing lists
> application,
> >but Mailman is written in Python and it's able to send thousands of
> email
> >just fine. Any thoughts on this?
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> Regards
>
> Gil Disatnik
> UNIX system/security administrator.
>
> GibsonLP@EFnet
> http://www.disatnik.com
> _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
> "Windows NT has detected mouse movement, you MUST restart
> your compu

Re: [PHP] Help with Error, I am Trying!!

2003-01-20 Thread Chris Knipe

if (!$_POST['Team_Name'] || !$_POST['First_Name'] || !$_POST['Last_Name'] || 
!$_POST['Email'] || !$_POST['Username'] || !$_POST['Password'])  
 header ("location: http://www.ultimatefootballleague.com/Create_Account.htm";); 
} 

Change to:

if (!$_POST['Team_Name'] || !$_POST['First_Name'] || !$_POST['Last_Name'] || 
!$_POST['Email'] || !$_POST['Username'] || !$_POST['Password']) {
 header ("location: http://www.ultimatefootballleague.com/Create_Account.htm";); 
} 

--
me


- Original Message - 
From: "Karl James" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Monday, January 20, 2003 6:28 AM
Subject: [PHP] Help with Error, I am Trying!!


Parse error: parse error, unexpected '}' in
/home/virtual/site12/fst/var/www/html/Create_Account.php on line 5

http://www.ultimatefootballleague.com/Create_Account.phps

I'm Trying to get the values of the form to echo out and to insert into my
managers table.


thanks karl 

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



[PHP] Barcodes...

2003-02-02 Thread Chris Knipe
Lo all,

Does anyone have some fonts or neat PHP code / classes to generate Code
128-type Barcodes?  I'm preferably looking to get the barcode generated in a
PNG / GIF type format...

--
me


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




Re: [PHP] inserting

2003-02-18 Thread Chris Knipe
I believe you are looking for .

I may be mistaken though.

--
me


- Original Message -
From: "Michael P. Carel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 18, 2003 10:36 AM
Subject: [PHP] inserting 


> hi to all,
>
> I'm having problem posting messages that have paragraph. It's doesnt
appear
> to have one when being viewd in the page?
>
> Any idea on how to post this properly without manually inserting a 
tags
> in the text box  before it is being store in the database.
>
> Thanks in advance.
>
>
> mike
>
>
>
>
> --
> 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




[PHP] php ecommers site

2003-02-19 Thread Chris Knipe
Lo all,

Is there any good already developed PHP based commerce solutions out there?
I'm preferably looking for something with catalogues (product pics,
descriptions, ratings, buyer comments, etc), online payment options, xml
support (to sell via partners for example), etc etc etc.

Thanks,

--
me


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




Re: [PHP] Computer Authorization

2003-02-20 Thread Chris Knipe
You can also maybe look at client side SSL Certificates...


- Original Message -
From: "Chris Cook" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 21, 2003 2:59 AM
Subject: [PHP] Computer Authorization


> Hello all,
>
> I am looking into an application that only specific computers can access.
A
> login does not work since we only want people to log in from certain
> computers. IP numbers dont work since they are dynamic. Cookies work
> temporarily, but are often deleted and are not the most secure route. Any
> suggestions for accomplishing this?
>
> Thanks for any help,
> Chris
>
>
>
>
> _
> Tired of spam? Get advanced junk mail protection with MSN 8.
> http://join.msn.com/?page=features/junkmail
>
>
> --
> 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




Re: [PHP] WE NEED SOME ADVICES: What is the best way for sending a huge amount of emails?

2003-02-25 Thread Chris Knipe
Get mailing list software such as majordomo / mailman.

PHP isn't the best way to do these kind of things...

--
me


- Original Message -
From: "Jean Fábio Barros" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 25, 2003 10:59 PM
Subject: [PHP] WE NEED SOME ADVICES: What is the best way for sending a huge
amount of emails?


> Hi everyone!
>
> We will appreciate some advices. We are new to PHP, thus, please, be
> patient! :)
> We want to make a script which needs to send a huge amount of emails
> (The emails are stored in a MySQL DB). We would like to take control of
> sending errors and put these in a log file. The script needs to send
> TXT, HTML,images, and even small files. Both the email content and the
> settings will be prepared through a HTML interface. We will need a sort
> of queue where we would be able to put some "Bad emails" on it in order
> to resend them as much times as it was set in the settings (HTML).
>
> So, How is the best way for making that PHP script, considering
> security, reliability (Handling email errors) and speed?
>
> Thanks in advance
>
>
>
> --
> 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



[PHP] no phun intended!!!

2003-03-08 Thread Chris Knipe
http://www.fingers.co.za/arb/mod_perl.jpg

If this starts a flame war, I'm going to be rather disappointed at people
that's not able to take a joke :P

I think it's hilarious though...

--
me


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



Re: [PHP] Authorization script

2003-07-05 Thread Chris Knipe
> I am making an authorizatoin script for the control panel of a loggin
> system I have been writing.  Here is what I have right now:

Well, if you copied and paste'd this, then I'm surprised that you don't get
a syntax error

> if (!$authorized) {
> header('Cache-Control: no-store, no-cache, must-revalidate');
> header('Cache-Control: post-check=0; pre-check=0', false);
> header('Pragma: no-cache');
> header('WWW-Authenticate: Basic realm="phpLogK"');
> exit;
^^^ exit();

You also need some more headers...

header('HTTP/1.0 401 Unauthorized');
header('status: 401 Unauthorized');

-=-
me




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



Re: [PHP] mysql_query

2003-07-06 Thread Chris Knipe
- Original Message - 
From: "Kevin Fradkin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 06, 2003 6:40 PM
Subject: Re: [PHP] mysql_query


> the problem is if i put 821000 i will have as result all number > 821000
> including 83
> 
> and i only need numbers begining with the numbers i entered..

where numbers LIKE 821%

I'd suggest you read up on the LIKE clause...

--
me


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



Re: [PHP] mysql_query

2003-07-06 Thread Chris Knipe
> one last question for the day...
> if in one cell i have two names. ex 'mary eleanor'
> and i want to search by typing 'ele' with   name LIKE '$name%' will not
give
> me mary eleanor as a result...
> any ideas?


*sighs*

LIKE '%$name%'

As I said... Read the MySQL Manual.


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



Re: [PHP] what is the problem?

2003-07-19 Thread Chris Knipe
> form.php is this:
>
> 
> 
> 



Learn to code html ;)


> takeform.php is this:
>
>  echo $sentence;
> ?>

echo $_POST['sentence'];


> these codes are running at my hosting
> but it couldn't run on my computer. I tried on pws, apache, php 4.0.4, php
> 4.2.2 and php5 but it didn't work.
>
> why i couldn't run it?

It's more than likely register_globals that is off.

--
me


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



[PHP] Interesting.... :/

2003-06-04 Thread Chris Knipe
Lo all,

Some input much appreciated.  I upgraded mod_php4 from 4.2.3 to 4.3.2, and
needless to say, something went horribly wrong. PHP compiled without any
serious problems, and the installation seemed to have gone fine as well.
When issuing a apachectl restart, apache immediately core dumped... OOOPS.

Well, my attempts at debugging, so far, was very much unsuccessful...

[EMAIL PROTECTED]:/usr/local/etc/apache# httpd --help
Segmentation fault (core dumped)
[EMAIL PROTECTED]:/usr/local/etc/apache#
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -h
Usage: httpd [-D name] [-d directory] [-f file]
 [-C "directive"] [-c "directive"]
 [-v] [-V] [-h] [-l] [-L] [-S] [-t] [-T] [-F]
Options:
  -D name  : define a name for use in  directives
  -d directory : specify an alternate initial ServerRoot
  -f file  : specify an alternate ServerConfigFile
  -C "directive"   : process directive before reading config files
  -c "directive"   : process directive after  reading config files
  -v   : show version number
  -V   : show compile settings
  -h   : list available command line options (this page)
  -l   : list compiled-in modules
  -L   : list available configuration directives
  -S   : show parsed settings (currently only vhost settings)
  -t   : run syntax check for config files (with docroot check)
  -T   : run syntax check for config files (without docroot
check)
  -F   : run main process in foreground, for process supervisors
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -v
Server version: Apache/1.3.27 (Unix)
Server built:   Dec 10 2002 22:10:01
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -V
Server version: Apache/1.3.27 (Unix)
Server built:   Dec 10 2002 22:10:01
Server's Module Magic Number: 19990320:13
Server compiled with
 -D EAPI
 -D EAPI_MM
 -D EAPI_MM_CORE_PATH="/var/run/httpd.mm"
 -D HAVE_MMAP
 -D USE_MMAP_SCOREBOARD
 -D USE_MMAP_FILES
 -D HAVE_FLOCK_SERIALIZED_ACCEPT
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D HARD_SERVER_LIMIT=512
 -D SO_ACCEPTFILTER
 -D ACCEPT_FILTER_NAME="httpready"
 -D HTTPD_ROOT="/usr/local"
 -D SUEXEC_BIN="/usr/local/sbin/suexec"
 -D DEFAULT_PIDLOG="/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="/var/run/httpd.scoreboard"
 -D DEFAULT_LOCKFILE="/var/run/httpd.lock"
 -D DEFAULT_ERRORLOG="/var/log/httpd-error.log"
 -D TYPES_CONFIG_FILE="etc/apache/mime.types"
 -D SERVER_CONFIG_FILE="etc/apache/httpd.conf"
 -D ACCESS_CONFIG_FILE="etc/apache/access.conf"
 -D RESOURCE_CONFIG_FILE="etc/apache/srm.conf"
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -l
Compiled-in modules:
  http_core.c
  mod_so.c
suexec: disabled; invalid wrapper /usr/local/sbin/suexec
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -S
Segmentation fault (core dumped)
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -t
Segmentation fault (core dumped)
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -T
Segmentation fault (core dumped)
[EMAIL PROTECTED]:/usr/local/etc/apache# httpd -F
Segmentation fault (core dumped)


checking libphp4.so

[EMAIL PROTECTED]:/usr/ports/www/mod_php4# ldd
/usr/local/libexec/apache/libphp4.so
/usr/local/libexec/apache/libphp4.so:
libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x28297000)
libmcal.so => /usr/local/lib/libmcal.so (0x282b)
libc-client4.so.8 => /usr/local/lib/libc-client4.so.8 (0x282bf000)
libexpat.so.4 => /usr/local/lib/libexpat.so.4 (0x28371000)
libsnmp.so.4 => /usr/local/lib/libsnmp.so.4 (0x2838e000)
libpspell.so.15 => /usr/local/lib/libpspell.so.15 (0x283e8000)
libpdf.so.4 => /usr/local/lib/libpdf.so.4 (0x283ea000)
libz.so.2 => /usr/lib/libz.so.2 (0x2847b000)
libtiff.so.4 => /usr/local/lib/libtiff.so.4 (0x28489000)
libpng.so.5 => /usr/local/lib/libpng.so.5 (0x284cd000)
libjpeg.so.9 => /usr/local/lib/libjpeg.so.9 (0x284f1000)
libmysqlclient.so.10 => /usr/local/lib/mysql/libmysqlclient.so.10
(0x2850f000)
libmhash.so.2 => /usr/local/lib/libmhash.so.2 (0x2852b000)
libmcrypt.so.8 => /usr/local/lib/libmcrypt.so.8 (0x28544000)
libltdl.so.1 => /usr/local/lib/libltdl.so.1 (0x2858)
libpam.so.1 => /usr/lib/libpam.so.1 (0x28584000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x2858e000)
libintl.so.4 => /usr/local/lib/libintl.so.4 (0x28669000)
libgdbm.so.3 => /usr/local/lib/libgdbm.so.3 (0x28671000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x28677000)
libssl.so.4 => /usr/local/lib/libssl.so.4 (0x28687000)
libcrypto.so.4 => /usr/local/lib/libcrypto.so.4 (0x286b6000)
libm.so.2 => /usr/lib/libm.so.2 (0x287a9000)
libcurl.so.2 => /usr/local/lib/libcurl.so.2 (0x287c5000)
libudmsearch.so.1 => /usr/local/lib/libudmsearch.so.1 (0x287e5000)
libssl.so.2 => /usr/lib/libssl.so.2 (0x2881c000)
libcrypto.so.2 => /usr/lib/libcrypto.so.2 (0x28

[PHP] Re: usenet post on frebsd php port problem

2003-06-10 Thread Chris Knipe
Hi,

I know what the problem is, I also have no "cure" for it though - I'm still
investigating.

libcrypto (part of OpenSSL / SSH I believe) come standard with FreeBSD as
part of the source tree, installed in /usr/lib.  There you should have a
libcrypto.so.1 & 2.  SOMEWHERE a certain port also installs a libcrypto.so.4
in /usr/local/lib, and that is the culprit.  Where it comes from, I don't
know as of yet.

mod_php for some reason, links against the libcrypto.so.2 as well as
libcrypto.so.4 and those two libraries conflict and cause the core dump.  I
have reverted back to my old PHP (4.1.2) and it is still working fine now.
>From what I can see, it's only the newest PHP (4.3.2) that has this problem.
I should actually take some time to bring this to the attention of the port
maintainers, but as I said - I'm not 100% yet on what the 3rd port is in
question here (that installs libcrypto.so.4).

You can check what your PHP is linked against with ldd.  Basically, there
should only be one module type of each, and not 3 or 4 of the same (like I
had with libcrypto).

--
me



- Original Message - 
From: "John Mearns" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 10, 2003 9:24 PM
Subject: usenet post on frebsd php port problem


> Hey, I just saw your post to php.general with apache dumping core with the
> new php.  I seem to be having the same issue and wondered if you came up
> with a solution. I've went as far as removing both the apache13-modssl and
> mod_php4 and reinstalling with no luck.  I've noticed I can start apache
> without ssl and its fine.  Or I can start with ssl as long as I remove php
> support.  Just wondered if you have managed to find a solution before I
> just compile myself from source :D
> Thanks,
> John
>


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



Re: [PHP] include()

2002-08-02 Thread Chris Knipe

> If you run your own server, you can set it up so that each webmaster is
> locked into a private environment, but it's messy.  According to me, you
> would need a separate copy of apache for each site, each running under a
> different user, and they would need to run on separate ports, which is a
> nuisance.

It's called SuEXEC in Apache and compiled in the core of Apache, it's not a
module.

What it does, it allows Apache to use the Group and User directives inside
virtual hosts.

For example:


  DocumentRoot /blah
  User cust001
  Group cust001


In this case, all files in /blah would be owned by cust001:cust001 and
permissions as strict as 0600 can be given on the files in the directory.
Apache's processes serving requests on this virutal host, will drop
permissions to user and group cust001 as specified in the configuration, so
apache would have access to read it.

In other virtualhosts, either the default user / group is used, or they are
specified uniquely in a per-virtualhost basis.  The other virtual hosts will
thus run with different uid/gid meaning that other virtualhosts will not be
able to include code in other virtualhosts, even when they know the paths.

Because Apache drop permissions to the user/group specified, they will not
have access to read/write/execute the included filename in a different
virtualhost.

--
me



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




Re: [PHP] weird urls

2002-08-10 Thread Chris Knipe

Erm, because that's the way it works?

Regards,
Chris Knipe
Cell: (072) 434-7582
MegaLAN Corporate Networking Services


/---
| This email is confidential and may contain legally privileged information.
| If you are not the intended recipient, you must not disclose or use
| the information contained in it. If you have received this email in error,
| please notify us immediately by return email and delete the document.
\---

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 10, 2002 7:56 PM
Subject: [PHP] weird urls


> How come some URLs have all these questions marks and stuff like that?
Below:
>
> source.php?url=/index.php
>
> __
> Pre-order the NEW Netscape 7.0 browser. Reserve your FREE CD and pay only
$2.99 shipping and handling. http://cd.netscape.com/promo_one/
>
> Get your own FREE, personal Netscape Mail account today at
http://webmail.netscape.com/
>
> --
> 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




Re: [PHP] How Can I Generate an Email List from a MySQL Table

2002-08-17 Thread Chris Knipe

$to = '';
while ($blah = mysql_fetch_row($ref)) {
  $to =+ $blah['address'];
};

Be careful however.  Most SMTP servers has a limit on the number of
recipients you can send one email to.  It's a very easy way to trigger spam
alerts and stuff.

--
me


- Original Message -
From: "Roger Lewis" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Sunday, August 18, 2002 5:10 AM
Subject: [PHP] How Can I Generate an Email List from a MySQL Table


> I have a MySQL table named "users" in which there is a column named
> "email_address" and another named "is_subscribed".  I would like to send
an
> email to all of the addresses for which "is_subscribed" is true.  I think
I
> know how to send the email, i.e.,
>
> mail($to, $subject, $message, $headers);
>
> I tested this out and it works fine when, for instance, $to =
> "[EMAIL PROTECTED], [EMAIL PROTECTED]" or some such collection of
> addresses.
>
> My problem is how do you create the variable, $to, from the MySQL table so
> that it contains all of the addresses separated by commas.
>
> Thanks for your help,
>
> Roger Lewis
>
>
> --
> 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




Re: [PHP] Re: Help needed about queries with MySQL, thanks.

2002-08-18 Thread Chris Knipe

Same here... Even though allot of people say it's not necessary...

- Original Message -
From: "Carsten Mohr" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 18, 2002 5:22 PM
Subject: [PHP] Re: Help needed about queries with MySQL, thanks.


> Hallo,
>
> I don't know if it helps you, but normally you have to quote the
> variable in the SQL-Statement like:
> SELECT * FROM sessions WHERE sessionID = '$sessionID'
> Otherwise I always get an SQL-Error
>
> Jean-Marc Godart wrote:
> > Hello everyone,
> >
> > I am a new PHP user, from Belgium. I am trying to manage a MySQL
database with PHP, and I kindly request your help to solve a little
(probably very stupid) problem I have been dealing with for a while already
...
> >
> > I have a MySQL database (called "sessions") with a auto-increment INT
field called "sessionID". I try to check if there is already a record in
this database with a given sessionID, which is called $sessionID in PHP. I
use this query, which must be wrong (but I cannot find out why !!!) :
> >
> >SELECT * FROM sessions WHERE sessionID = $sessionID
> >
> > Even though there is already a record with the right sessionID, my
program does not find it (I always get 0 when using mysql_num_rows() after
the query). Though, if I replace "$sessionID" by, for example 4, then that
works and it says there is already a record with that ID.
> >
> > I guess the problem comes from comparing two different kinds of
variables, but I can't fix it ... Could anyone please help ? By advance,
thank you !!!
> >
> > Best regards from Belgium,
> >
> >
> > Jean-marc
> >
> >
> >
> >
>
>
> --
> 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




Re: [PHP] why do i get this error please tell me?

2002-08-31 Thread Chris Knipe

 
> You have an error in your SQL syntax near 'order=1 WHERE ID='2'' at line
> 2

ORDER is a reserved word in MySQL.

Change the query and escape order aswell

'order'='1' WHERE ID='2'

Or, rename the order column to something else.



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




Re: [PHP] RE : include interpreted php file

2002-08-31 Thread Chris Knipe

fopen()

Regards,
Chris Knipe
Cell: (072) 434-7582
MegaLAN Corporate Networking Services


/---
| This email is confidential and may contain legally privileged information.
| If you are not the intended recipient, you must not disclose or use
| the information contained in it. If you have received this email in error,
| please notify us immediately by return email and delete the document.
\---

- Original Message -
From: "you" <[EMAIL PROTECTED]>
To: "'Richard Lynch'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, August 31, 2002 7:44 PM
Subject: [PHP] RE : include interpreted php file


Hi,

Thanks for u help. But i just wanna include a php file in an other. But
the included file must be interpreted before including it.

Thx
kciop

-Message d'origine-
De : Richard Lynch [mailto:[EMAIL PROTECTED]]
Envoyé : samedi 31 août 2002 02:12
À : you
Cc : [EMAIL PROTECTED]
Objet : Re: include interpreted php file

>pb : include a php file in an other php file
>contraints : the php file must be interpreted before being included
>solution known : fsock then get the html code from the server and
include
>it...
>
>Is there an other solution (easier) to include that file?

Not real sure if you *want* the PHP file interpreted or not, but if not,
try
this:

http://example.com/whatever.htm";) or die("Could not load
remote HTML");
  echo implode('', $html);
?>

You may (or may not) also want to use http://php.net/htmlentities to
show
the actual HTML source instead of making it a part of your web design
layout
HTML...

--
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] mysql_query() & mail() - something weird is going on !

2002-09-12 Thread Chris Knipe

Lo all,

I get a timeout on line 523 of my code (posted and marked below).  However,
I fail to see where the timeout is occurring, and even debugging
(mysql_error()) doesn't report anything wrong!

I'm baffled as to what exactly is causing this timeout  The code is
currently on Apache (Win32) with PHP 4.2.3.  When I move the code over to a
*nix system, it works perfectly via sendmail_path in php.ini, but when it
calls the SMTP server via a remote address, it fails.

The mail server's exim-3.36, receiver and sender verification has been
turned off.  The mail does go through the mail server.  I also tried
bouncing the messages through a local Exchange server, and the result of
this, is that the email get's additional headers that becomes part of the
body!

Line 523 is indicated with a **


// Insert the Technical Administrator's details into the Database as the
Company
// Administrator.
$MakePassword = new GeneratePassword(16,5);
$Password = $MakePassword->makePassword();

$SQL  = "INSERT INTO CompanyContacts (ContactActive, CompanyID, ";
$SQL .= "ContactName, IDNumber, EMailAddress, CellNumber, Password)
VALUES ('1', '";
$SQL .= mysql_escape_string($CompanyID) . "', '" .
mysql_escape_string($_POST['TechName']) . "', '";
$SQL .= mysql_escape_string($_POST['TechID']) . "', '" .
mysql_escape_string($_POST['TechEMail']) . "', '";
$SQL .= mysql_escape_string($_POST['TechCell']) . "', PASSWORD('" .
mysql_escape_string($Password) . "'));";
$TechRegisterSQL = mysql_query($SQL) or die(mysql_error());

// Mail the login details for the Company Administrator, Redirect him to
the login
// page, and we're done!.
$msg = "";
$msg .= "Dear " . $_POST['TechName'] . ",\n";
$msg .= "\n";
$msg .= "Below follows your login details for MegaMonitor.  As the
registrar of\n";
$msg .= "" . $_POST['CompanyName'] . ",\n";
$msg .= " you have been given the rights of Company Administrator.\n";
$msg .= "\n";
$msg .= "This allows you to log in at the MegaMonitor web site, and add
further\n";
$msg .= "configurations for your company.  These may include account
contacts, \n";
$msg .= "technical contacts, time periods, service checks, and
everything else \n";
$msg .= "needed to setup monitoring for your company.\n";
$msg .= "\n";
$msg .= "You also may request for any number of additional services from
MegaLAN\n";
$msg .= "Corporate Networking Services, including access to a wider
spectrum of\n";
$msg .= "monitoring by purchasing more licenses for IP addresses.\n";
$msg .= "\n";
$msg .= "MegaLAN Corporate Networking Services also will be offering
other\n";
$msg .= "excellent value added services over the not to distant future.
We are\n";
$msg .= "hard at work to get these up and running, and as a client, we
will notify\n";
$msg .= "you when they become available.  Some of these services
include:\n";
$msg .= "\n";
$msg .= "  - MegaMAIL, a e-mail virus scanning service for corporates.
We scan all\n";
$msg .= "  in and outgoing e-mails on your behalf to ensure
your company\n";
$msg .= "  does not get infected with viruses via
e-mail.\n";
$msg .= "  - MegaDNS,  a DNS hosting and administrating service for
corporates,\n";
$msg .= "  where we will provide access to DNS
administrative tools, as\n";
$msg .= "  well as secondary domain hosting - free of
charge.\n";
$msg .= "\n";
$msg .= "To log in to MegaMonitor and configure your company's profile,
please visit\n";
$msg .= "http://www.imadethis.co.za/login.php\n";;
$msg .= "\n";
$msg .= "Your Username: " . $_POST['TechEMail'] . "\n";
$msg .= "Your Password: " . $Password . "\n";
$msg .= "\n";
$msg .= "You may change your password at anytime via our administrative
interface on\n";
$msg .= "our web site.\n";
$msg .= "\n";
$msg .= "Thank you for your interest in MegaMonitor, and we hope we will
benefit\n";
$msg .= "your company tremendously.\n";
$msg .= "\n";
$msg .= "MegaLAN Customer Support.\n";
$msg .= "\n";
mail($_POST['TechEMail'], "MegaMonitor Registration Details", $msg,
 "From: MegaLAN Customer Support <[EMAIL PROTECTED]>\r\n");

// Mail everything to MegaLAN support for confirmation.
// Look up the bank name in the Database.
**$BankQuery = mysql_query("SELECT BankName FROM GlobalBankNames WHERE
BankID='" . mysql_escape_string($_POST['BankInstitution']) . "';") or die
(mysql_error());
while ($BankList = mysql_fetch_array($BankQuery)) {
  $BankLongName = $BankList['BankName'];
}
if ($_POST['BankAccountType'] == "3") {
  $BankAccountTypeLong = "Cheque Account";
} elseif ($_POST['BankAccountType'] == "2") {
  $BankAccountTypeLong = "Transmission Account";
} elseif ($_POST['BankAccountType'] == "1") {
  $BankAccountTypeLong = "Savings Account";
} else {
  // We

[PHP] infinate loops

2002-10-30 Thread Chris Knipe
Lo,

Quite desperate now... Or at least, I'm starting to get there... Can anyone
perhaps see why this loop is not exiting???

$quit=$now;
$glet=getdate($row['RenewDate']);

// debug
echo "howlong: " . $howlong;

while($quit<$howlong) {

  // debug
  echo "quit: " . $quit . "";

  $quit=mktime(0, 0, 0, $glet['mon']+$row['BillPeriod'], $glet['mday'],
$glet['year']);
  $retl+=$row['Cost'];
  $glet=getdate($quit);
}


The values,

$now = 1036360800 (mktime())
$row['RenewDate'] = 1035928800 (MySQL DB - VARCHAR(12))
$row['Cost'] = xx.xx (MySQL DB - DOUBLE(6,2))

$howlong is defined further up
$howlong=mktime(0, 0, 0, $_POST['month'], 1, $_POST['year'])
where...
  0 < $_POST['month'] > 12
  2001 < $_POST['year'] > 2005

>From the debug (Browser output)...
howlong: 1133388000 - now: 1036023598 (RenewDate: 1036360800)
quit: 1036023598
quit: 1036360800
quit: 1036360800
quit: 1036360800

Thus, $quit is never incremented I'm *STUMPED* why not, or how to fix
this? :((  Each time, PHP times out (Script execution time exceeded), and it
*always* gives a line number for the timeout, that is inside the above while
loop.  Hence, to my understanding, the loop never exits

The loop, comes from cbms from voxel.net, stats.php

Thanks for the help!

--
me


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




[PHP] Re: infinate loops

2002-10-30 Thread Chris Knipe
Nevermind,

It was due to a inconsistency in the DB It's sorted :P

- Original Message -
From: "Chris Knipe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 31, 2002 2:32 AM
Subject: infinate loops


> Lo,
>
> Quite desperate now... Or at least, I'm starting to get there... Can
anyone
> perhaps see why this loop is not exiting???
>
> $quit=$now;
> $glet=getdate($row['RenewDate']);
>
> // debug
> echo "howlong: " . $howlong;
>
> while($quit<$howlong) {
>
>   // debug
>   echo "quit: " . $quit . "";
>
>   $quit=mktime(0, 0, 0, $glet['mon']+$row['BillPeriod'], $glet['mday'],
> $glet['year']);
>   $retl+=$row['Cost'];
>   $glet=getdate($quit);
> }
>
>
> The values,
>
> $now = 1036360800 (mktime())
> $row['RenewDate'] = 1035928800 (MySQL DB - VARCHAR(12))
> $row['Cost'] = xx.xx (MySQL DB - DOUBLE(6,2))
>
> $howlong is defined further up
> $howlong=mktime(0, 0, 0, $_POST['month'], 1, $_POST['year'])
> where...
>   0 < $_POST['month'] > 12
>   2001 < $_POST['year'] > 2005
>
> From the debug (Browser output)...
> howlong: 1133388000 - now: 1036023598 (RenewDate: 1036360800)
> quit: 1036023598
> quit: 1036360800
> quit: 1036360800
> quit: 1036360800
>
> Thus, $quit is never incremented I'm *STUMPED* why not, or how to fix
> this? :((  Each time, PHP times out (Script execution time exceeded), and
it
> *always* gives a line number for the timeout, that is inside the above
while
> loop.  Hence, to my understanding, the loop never exits
>
> The loop, comes from cbms from voxel.net, stats.php
>
> Thanks for the help!
>
> --
> me
>


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




Re: [PHP] Using info from a MySQL Query

2002-11-05 Thread Chris Knipe
$sql = "query"
$result = mysql_query($sql)

while ($data = mysqlfetch_array($result)) {
  echo $data['colum'];
}

- Original Message -
From: "Ben C." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 06, 2002 3:09 AM
Subject: [PHP] Using info from a MySQL Query


> I am using the following query:
>
> $sql ="SELECT company, name, email FROM $table_name
>WHERE email = '$_POST[email]' AND password =
password('$_POST[password]')";
>
> Then I am echoing the $email on my form (it works because the person has
posted their e-mail name when logging in).  How can I echo the company and
email on to my form as well.  Please help.
>
>
> --
> 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




Re: [PHP] Write file can't work ?!? :-(

2002-11-17 Thread Chris Knipe
The IIS user running the web server on NT needs read/write permissions on
the file in the web server.  By default, it only have read access to the
file...


- Original Message -
From: "Stephen" <[EMAIL PROTECTED]>
To: "Ivan Mareniæ" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Sunday, November 17, 2002 9:54 PM
Subject: Re: [PHP] Write file can't work ?!? :-(


> wb is not a permission. Try putting just w.
>
>
> - Original Message -
> From: "Ivan Mareniæ" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, November 17, 2002 2:47 PM
> Subject: [PHP] Write file can't work ?!? :-(
>
>
> > Hi.
> >
> > I am trying to create little counter:
> > I can't open file for writing.
> > I've tried different params: "w", "r+", "wb" ... nothnig works
> >
> > I am using IIS 5.0 , and I have set permitions to read & write files on
> > server.
> >
> >
> > = source code ===
> >
> > if(is_writable("counter.txt")==TRUE)
> >  echo "File is writable";
> > else
> >  echo "File is NOT writable";
> >
> > echo "";
> >
> > $fd = fopen ("counter.txt", "r");
> > $my_count=0;
> > while (!feof ($fd)) {
> > $my_count = fgets($fd, 4096);
> > }
> > fclose ($fd);
> >
> > $fd = fopen ("counter.txt", "wb");
> > if($fd==TRUE)
> >  {
> >  $my_count++;
> >  fputs($fd, $my_count);
> >  fclose ($fd);
> >  }
> >
> > echo "Your are user no:";
> > echo $my_count;
> >
> > = end source 
> >
> > but after execution PHP says that:
> >
> > File is writable
> >
> > Warning: fopen("counter.txt", "wb") - Permission denied in
> > c:\inetpub\wwwroot\PSK\user_no.php on line 27
> > Your are user no:8
> >
> > Whay can't I open file for writing???
> >
> > Thanks for help!!!
> >
> >
> >
> >
> > --
> > 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
>


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




[PHP] Comparing array elements

2002-06-05 Thread Chris Knipe

hey everyone,

Does anyone have and ideas of wisdom on how to compare arrays (mysql result
sets) and group items based on if they exist in two or more arrays?

For example:

I have a table, with a list of servers:
server1
server2
server3
server4
server5
...
serverX

I have a table that specifies which of the servers are grouped:
group1
  server1
  server4
  server5

Now, I want to compare group1 against the server list, and do something like
the following:
In group:
  server1
  server4
  server5

Not in group:
  server2
  server3
  serverX






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




[PHP] Re: Comparing array elements

2002-06-05 Thread Chris Knipe

Hi Dan,

Close to what I want But no cigar just yet.  Thanks for the help, but I
think you mis-understood some parts of it.  First things first, on creating
the list of servers which is in a group - thanks, that works beautifully and
I got it working.  The query looks as follows:

SELECT monitorhosts.HostID FROM monitorhosts LEFT JOIN
monitorhostgroupdetails ON
 monitorhosts.HostID=monitorhostgroupdetails.HostID WHERE
monitorhostgroupdetails.HostGroupID='1';

The WHERE clause simply specify which group I want to extract a server list
for.

However, selecting the items not in a group, only returns items that is not
in a group AT ALL, and not all the items that isn't in a specific group as I
want...

Here's the layout of the two tables for you:

Items Table (+- 10,000 Records - monitorhosts)
+--+--+--+-+-+--
--+
| Field| Type | Null | Key | Default | Extra
|
+--+--+--+-+-+--
--+
| HostID   | tinyint(4)   |  | PRI | NULL|
auto_increment |
| CompanyID| tinyint(4)   |  | MUL | 0   |
|
+--+--+--+-+-+--
--+
2 rows in set (0.08 sec)

Groups Table (+- 10 Records - monitorhostgroupdetails)
+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra  |
+---+--+--+-+-++
| HostGroupDetailID | mediumint(9) |  | PRI | NULL| auto_increment |
| HostID| mediumint(9) |  | MUL | 0   ||
+---+--+--+-+-++
3 rows in set (0.76 sec)

Now, I have 10,000 items.  1-1000 is assigned in group1, 500-1500 is
assigned to group2, and 1500-10,000 is in Group3.

I want to be able to use join queries, where I can take group1, generate a
list of all the items in the group, and then generate a list of items not in
group1.  The same goes for group2, group3, groupX.  Item's not in a group at
all, must also be returned... One item can also be assigned to more than one
group, which just adds to the complexity here I think :-(

Basically, I want anything that is in group1 and, the rest.

I've tried things like (to get items not in group1 for this example):
SELECT monitorhosts.HostID FROM monitorhosts LEFT JOIN
monitorhostgroupdetails ON
 monitorhosts.HostID=monitorhostgroupdetails.HostID WHERE
monitorhostgroupdetails.HostID <> '1' OR monitorhostgroupdetails.HostID IS
NULL;

But that doesn't return the desired result :(( Also seeing that the answer
to my question somehow lies in the LEFT / RIGHT JOIN statement, I went to
have a read in the manual about the function / syntax... I didn't understand
ANY of it :-( and I got a killer headache now as well, which just isn't
helping right now... *shrugs*

Any ideas?

- Original Message -
From: "Dan Nelson" <[EMAIL PROTECTED]>
To: "Chris Knipe" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 05, 2002 7:45 PM
Subject: Re: Comparing array elements


> In the last episode (Jun 05), Chris Knipe said:
> > Does anyone have and ideas of wisdom on how to compare arrays (mysql
> > result sets) and group items based on if they exist in two or more
> > arrays?
> >
> > Now, I want to compare group1 against the server list, and do something
like
> > the following:
> > In group:
> >   server1
> >   server4
> >   server5
>
> SELECT servers.server FROM servers LEFT JOIN group1 ON
>  servers.server=group1.server WHERE group1.server IS NOT NULL;
>
>
> > Not in group:
> >   server2
> >   server3
> >   serverX
>
> SELECT servers.server FROM servers LEFT JOIN group1 ON
>  servers.server=group1.server WHERE group1.server IS NULL;
>
> --
> Dan Nelson
> [EMAIL PROTECTED]
>


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




[PHP] multiple selects and $_POST['vars']

2002-06-06 Thread Chris Knipe

Lo all,

How do you manage multiple selects and the data returned by the form?

All my attempts at doing this, only returned one variable from the selected
options, not all of them??

My test...


  
1
2
3
4
5
  


blah.php:
echo $_POST['bleh'];


$_POST['bleh'] would only have the value of the last selected option in the
form...

I've tried array_count_values as well to maybe see if PHP didn't save the
multiple selected items into a array, but it only reported back that
$_POST['bleh'] isn't a array.  So, if I select all 5 items in the above
form, why does PHP only return the last option I selected, and how do I get
it to return all the selected values?

Additionally,
if ($_POST['bleh'] == "") {

always fails Regardless if 1, 2, 3 or even all 5 of the options in the
form is selected (highlighted) Which, is *really* strange, seeing that
echo $_POST['bleh'] returns 1 out of the 5 selected values.






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




Re: [PHP] multiple selects and $_POST['vars']

2002-06-06 Thread Chris Knipe

Thanks everyone!! Appreciate it


- Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: "Chris Knipe" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 7:18 PM
Subject: Re: [PHP] multiple selects and $_POST['vars']


> > 
> >   
> > 1
> > 2
> > 3
> > 4
> > 5
> >   
> > 
>
>  
>
>  1
>  2
>  3
>  4
>  5
>
>  
>
> Notice the [] on the name, telling PHP it's an array.
>
> Then, to get the items selected, it will be in $_POST['bleh'], which is an
> array. So, $_POST['bleh'][0] will be the first one selected, etc.
> count($_POST['bleh']) will tell you how many were selected.
>
> ---John Holmes...
>
>
> --
> 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




Re: [PHP] multiple selects and $_POST['vars'] MORE

2002-06-06 Thread Chris Knipe

Yeah, agreed there!!!

You're not supposed to specify a name on a option, just on the select
itself.  I've changed it now to use the array bit, and the form results
return it as a array as expected.

Thanks for all the help...  I think it's time to download a new copy of the
manual again... :)


- Original Message -
From: "Philip Olson" <[EMAIL PROTECTED]>
To: "Jay Blanchard" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 7:47 PM
Subject: RE: [PHP] multiple selects and $_POST['vars'] MORE


> This is not how they work, the name goes
> under  not within .
>
> And as others have suggested, using an
> array is key here: name="bleh[]".
>
>  http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple
>
> Regards,
> Philip Olson
>
>
> On Thu, 6 Jun 2002, Jay Blanchard wrote:
>
> > [snip]
> > The value selected is now in $a_name
> > [/snip]
> >
> > Or $_POST['a_name']
> >
> > HTH!
> >
> > Jay
> >
> > "Give a man a program, frustrate him for a day.
> > Teach a man to program, frustrate him for a lifetime."
> > "It's hip to snip!"
> >
> >
> >
> > --
> > 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
>
>


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




Re: [PHP] am i just a session tracking idiot?

2002-06-06 Thread Chris Knipe

Have you tried using $_SESSION['bgcolor'] = "bleh"

It might work... who knows...

- Original Message -
From: "dan radom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 8:36 PM
Subject: Re: [PHP] am i just a session tracking idiot?


> what's weird is that if i set session.save_handler = mm, i obviously don't
get the file error, but it still won't work.
>
> here's another example of what i've tried...
>
> mars:~/apache/htdocs/test.radom.org$ cat test.php
>  // create a new session
> session_start();
>
> // register a session-variable
> session_register("bgcolor");
>
> // Assign a value to the session-variable
> $bgcolor = "#8080ff";
> ?>
> 
> 
> Session Example #1
> 
>
> 
>
> Welcome to a session-enabled page! The background color on the next page
will be set to a stylish blue.
> Go to another session-enabled page.
> 
> 
>
> and
>
> mars:~/apache/htdocs/test.radom.org$ cat test2.php
>  // Resume session created in Listing 1-2
> session_start();
> ?>
> 
> 
> Session Example #1
> 
>
> 
>
>  // Retrieve SID from cookie.
> print "Your SID is $PHPSESSID ";
>
> // Display the value of the $bgcolor variable.
> print "The persistent background color is: $bgcolor.";
> ?>
>
>
> argggh!
>
>
> * dan radom ([EMAIL PROTECTED]) wrote:
> > I've just tried that.  /foo is owned by nobody and is mode 777.  there's
135M available on that partition.
> >
> > * Shane Wright ([EMAIL PROTECTED]) wrote:
> > > -BEGIN PGP SIGNED MESSAGE-
> > > Hash: SHA1
> > >
> > > Hi
> > >
> > > This may sound silly - but is there enough free disk space on whatever
> > > partition /tmp is mounted on?
> > >
> > > Alternatively, as a workaround, you could create a new directory and
give the
> > > web server user permission to write to it and tell PHP to save
sessions
> > > there.  (this is actually better from a security standpoint as well;
less
> > > chance of session hijacking).
> > >
> > > Cheers
> > >
> > > - --
> > > Shane
> > > www.shanewright.co.uk
> > > Public Key: http://www.shanewright.co.uk/files/public_key.asc
> > >
> > >
> > > On Thursday 06 June 2002 6:31 pm, dan radom wrote:
> > > > I can't seem to get session tracking to work to save my life.  The
end
> > > > result I'm after is to store the value of the single column returned
from
> > > > this query .. SELECT user_id from users WHERE user_name =
'$user_name' AND
> > > > user_password = '$user_password' .. for use throughout the site.
The
> > > > current error I'm getting is "Warning: Failed to write session data
> > > > (files). Please verify that the current setting of session.save_path
is
> > > > correct (/tmp) in Unknown on line 0" which is very strange, as
> > > > session.save_path is set to /tmp, and tmp is "drwxrwxrwt2 root
> > > > root".  The code is listed below.  Any suggestions are greatly
appreciated.
> > > >
> > > > dan
> > > >
> > > >
> > > >
> > > >
> > > >  > > >
> > > > //  if ($user_name) {
> > > > // class 'new uid' { var $row->user_id; };
> > > > // start_session();
> > > > // $abqSession = new abqnl;
> > > > // $abqSession->user_id = $uid;
> > > > // session_register("abqSession");
> > > > // }
> > > >
> > > > if ($user_name) {
> > > > session_id($_GET['user_id']);
> > > > session_start();
> > > > $foo="$row->user_id";
> > > > $_SESSION["uid"] = $foo;
> > > > echo "$foo";
> > > > }
> > > >
> > > >
> > > >   include '/storage/apache/htdocs/test.radom.org/.siteconf.php';
> > > >
> > > >   echo "";
> > > >
> > > >   if (!$user_name) {
> > > >
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "user name";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "password";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >   echo "";
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >   echo "";
> > > >
> > > >   echo "";
> > > >
> > > >   exit;
> > > >
> > > >   } else
> > > >
> > > >   $result = pg_exec ($database, "SELECT user_id from users WHERE
user_name
> > > > = '$user_name' AND user_password = '$user_password'");
> > > >
> > > >   if (!$result) {
> > > > echo "query died\n";
> > > > exit;
> > > >   }
> > > >
> > > >   if (pg_num_rows($result) == 0) {
> > > >   echo "you have entered an invalid user name and password
> > > > combination.  please try again.  new users may create an account
from the
> > > > sign up link above."; exit;
> > > > }
> > > >
> > > >
> > > >   for ($i = pg_num_rows($result) - 1; $i >= 0; $i--) {
> > > >   if(!($row = pg_fetch_object($result)))
> > > > continue;
> > > >   }
> > > >
> > > >   echo "your user_id is ";
> > > >
> > > >   pg_clos

Re: [PHP] [PLEASE HELP] Passing variable to new page.

2002-06-06 Thread Chris Knipe

> echo "";
> echo" function pop1() {";
> echo" window.open(\"info.php?prod_id=$result[0]\"); }"; \\ $result[0] is
> variable that stores id of the image in database
> echo "";
>
> I am calling this function in the following manner: echo" onclick=\"pop1();\"";
^

You're not passing a value to the variable.  Try using something like: (i'm
NO java guru, and this definately isn't the list for java)...

function pop1($id) {
  window.open("info.php?prod_id=$id");
}

and



Where 12345 is the product ID that you assigned to variable prod_id, which
will in return be displayed in the second PHP file.  You're problem's
related to the java script, not assigning the value to the variable.  This
isn't a PHP issue.



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




Re: [PHP] Combo box selected value...

2002-06-06 Thread Chris Knipe

'.mysql_result($resultado,
$cont,$letra).'');
   } else {
 echo(' '.mysql_result($resultado, $cont,$letra).'');
   }


   $cont++;
}
echo("\n  ");
  }
   }

+++

> But, how can i return the selected item value into a variable $var ???

That's normally how I do it...  I'm not to sure on which values you need to
do the comparison... It depends on what data you are returning from mysql I
think


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




Re: [PHP] FW: NEED HELP (passing variable to new page)

2002-06-06 Thread Chris Knipe

OOOH, but everyone does such a fine job!!! *eg*

Can anyone help me and tell me how to switch a computer on? 
-hides before he starts some arb war or something-

And yes, for the curious or missing minded, that was a joke... 

--
me

- Original Message - 
From: "Scott Hurring" <[EMAIL PROTECTED]>
To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 9:08 PM
Subject: RE: [PHP] FW: NEED HELP (passing variable to new page)


> ... especially when the error is not even with PHP  :-)
> 
> Contrary to what some newbies seem to think, this list is
> not a free consulting service... none of us are obligated
> to help everyone with every problem.
> 
> We're all volunteers -- sometimes we just don't have
> the time or knowledge to answer every question,
> especially when the questions aren't related to PHP,
> or are really vauge or common or just plain silly :-)
> 
> ---
> Scott Hurring
> Systems Programmer
> EAC Corporation
> [EMAIL PROTECTED]
> Voice: 201-462-2149
> Fax: 201-288-1515
> 
> > -Original Message-
> > From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, June 06, 2002 2:40 PM
> > To: Igor Portnoy
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] FW: NEED HELP (passing variable to new page)
> > 
> > 
> > Asking twice doesn't help, bud. It's just going to piss people off.
> > 
> > If someone has an answer they'll let  you know, otherwise 
> > look for other
> > resources.
> > 
> > ---John Holmes...
> > 
> > - Original Message -
> > From: "Igor Portnoy" <[EMAIL PROTECTED]>
> > To: "[EMAIL PROTECTED]" <'[EMAIL PROTECTED]'>
> > Sent: Thursday, June 06, 2002 2:24 PM
> > Subject: [PHP] FW: NEED HELP (passing variable to new page)
> > 
> > 
> > So can anybody help me with my problem?
> > 
> > 
> > 
> > -Original Message-
> > From: Igor Portnoy
> > Sent: Thursday, June 06, 2002 9:36 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: NEED HELP (passing variable to new page)
> > 
> > 
> > 
> > Hello,
> > 
> > 
> > 
> > I am having hard time passing the variable to the next page. 
> > May be you
> > can help me. Let me explain:
> > 
> > 
> > 
> > I am using mySQL database to store information about images (ID, name,
> > author, description, etc).  I am pulling some of the information to
> > create this (look at the example here:
> > http://www.gibsonusa.com/test/page/index.php) Now, I want a new window
> > appear when user clicks on the image. I have achieved it with the
> > following script:
> > 
> > 
> > 
> > echo "";
> > 
> > echo" function pop1() {";
> > 
> > echo" window.open(\"info.php?prod_id=$result[0]\"); }";   \\ 
> > $result[0]
> > is variable that stores id of the image in database
> > 
> > echo "";
> > 
> > 
> > 
> > I am calling this function in the following manner: echo" > onclick=\"pop1();\"";
> > 
> > 
> > 
> > You can see the result if you click on the image.  The new page opens
> > up, BUT the id (product_id in this case) value is not passed 
> > to the next
> > page correctly.  If you click on the first or second image on 
> > the first
> > page it shows that the ID is the same for both of them.  
> > However if you
> > look at the source code you can see that the ids are assigned 
> > correctly.
> > The same thing happens if you click on any image that says "no image
> > available" (I am using different script to generate those).  It seems
> > that the script picks up and stores in the memory the value 
> > of an ID of
> > the last image generated with the script (I don't know if that make
> > sense).
> > 
> > 
> > 
> > Oh, by the way the contents of info.php that I am calling in 
> > the script
> > above are as following:
> > 
> >  > 
> > $myid = $_GET['prod_id'];
> > 
> > echo" Product ID: $myid";
> > 
> > ?>
> > 
> > 
> > 
> > What am I doing wrong?  Can you help?
> > 
> > 
> > 
> > Thank you.
> > 
> > Sorry for lengthy e-mail.
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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
> 
> 


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




Re: [PHP] Need info abou ASP/Java HTML Form handling

2002-06-06 Thread Chris Knipe

*urgh*

So off topic it's not funny  http://www.microsoft.com/vbscript /
http://www.microsoft.com/jscript/

I might not be 100% correct on the urls.  Just search for VB / JS Script
Refence at microsoft.com


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "Yasuo Ohgaki" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 6:24 AM
Subject: [PHP] Need info abou ASP/Java HTML Form handling


> Hi All.
>
> Could anyone tell me any reference for ASP and/or Java HTML
> form handling script/program/module/class/etc?
>
> I'm going to write PHP module for easier HTML form
> handling and would like to know what kind of feature/options
> ASP/Java have.
>
> Thanks.
>
> --
> Yasuo Ohgaki
>
>
> --
> 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




Re: [PHP] Parse Error in my Mail Function -UPDATED

2002-06-07 Thread Chris Knipe

>The problem being now I am getting a parse error on lines 30.

Line 29, 30, and 31 is where exactly in all this??


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "Anti-Blank" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 7:53 PM
Subject: [PHP] Parse Error in my Mail Function -UPDATED


Sorry I was too sleepy to realize the Red and BOLD wouldn't come through on
the list.  Here is the message again but I was smart enough this time to
comment those section.

All right I've used the help that I've gotten before about this and edited
this function of code I have.  Initially the code was meant to mail out a
post to every email that was listed in the database.  The problem was that
it sent all the emails in the TO: section of the email.  Now being that I
didn't want to give out the emails of everyone on the list, I wanted to
instead hardcode the TO: section and then drop all of the emails from the
database into the BCC: section.  The problem being now I am getting a parse
error on lines 30.  Included are the original code and my version(which is
spitting the error).  If anyone can offer any insight as to what I'm missing
or messing up I should say it would be most appericated.

ORIGINAL SECTION OF MAIL FUNCTION:
function postNews () {
// Get input from form, and members name.
global $cookie_username, $headline, $post, $mail;
// check to see if we should send email.
if ($mail == "yes") {
global $setting_site_name, $setting_site_url, $setting_mail_email;
$fhandle = fopen("newstemps/mailpost.tmp", "r") or die("could not open
newstemps/mailpost.tmp");
$mailpost = fread($fhandle, filesize("newstemps/mailpost.tmp"));
fclose ($fhandle);

$mailpost = $mailpost;
$mailpost = str_replace("{setting_site_name}", $setting_site_name,
$mailpost);
$mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
$mailpost = str_replace("{setting_mail_email}", $setting_mail_email,
$mailpost);
$mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
$mailpost = str_replace("{post_headline}", $headline, $mailpost);
$mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
$mailpost = str_replace("{post_post}", $post, $mailpost);

$to = "";
$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query)) {
if ($to == "") {$to = $member['email'];}
else {$to .= ", " . $member['email'];}
}
$from = "from: " . $setting_mail_email;
mail ($to, $setting_site_name, $mailpost, $from) or $emailsuccess = "Failure
sending email.";
if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
}

MY MODIFIED SECTION (I've commented the sections I changed and also the line
with the parse error:)

function postNews () {
// Get input from form, and members name.
global $cookie_username, $headline, $post, $mail;
// check to see if we should send email.
if ($mail == "yes") {
global $setting_site_name, $setting_site_url, $setting_mail_email;
$fhandle = fopen("newstemps/mailpost.tmp", "r") or die("could not open
newstemps/mailpost.tmp");
$mailpost = fread($fhandle, filesize("newstemps/mailpost.tmp"));
fclose ($fhandle);

$mailpost = $mailpost;
$mailpost = str_replace("{setting_site_name}", $setting_site_name,
$mailpost);
$mailpost = str_replace("{setting_site_url}", $setting_site_url, $mailpost);
$mailpost = str_replace("{setting_mail_email}", $setting_mail_email,
$mailpost);
$mailpost = str_replace("{post_poster}", $cookie_username, $mailpost);
$mailpost = str_replace("{post_headline}", $headline, $mailpost);
$mailpost = str_replace("{post_date}", date("M d, Y", time()), $mailpost);
$mailpost = str_replace("{post_post}", $post, $mailpost);

//Everything Below here is where my changes occur
$to = "[EMAIL PROTECTED]";
$from = "from: " . $setting_mail_email;
$bcc = "bcc: ";

$query = mysql_query("SELECT * FROM members");
while ($member = mysql_fetch_array($query)) {
  if ($bcc == "") {$bcc = $member['email'];}
  else {$bcc .= ", " . $member['email'];}
}

$headers = $from . "\r\n" . $bcc . "\r\n"
//The Next Line is where I'm getting the parse Error at
mail ($to, $setting_site_name, $mailpost, $headers) or $emailsuccess =
"Failure sending email.";
if ($emailsuccess == "") {$emailsuccess = "Email Sent Successfully.";}
}

Thanks for any insight that anyone might have.






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




Re: [PHP] convertion from string to time & substracting

2002-06-07 Thread Chris Knipe

Talking under correction, but you'll be better of using a TIME column in
MySQL.  You can also do all the calculations with MySQL's build in time
functions already, which will save you allot of time, seeing that all the
calculations can be done via a single SQL query.

--
me


- Original Message -
From: "juaid" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 8:01 PM
Subject: [PHP] convertion from string to time & substracting


> Hi,
>
> sorry if maybe this is a bit dumb question, but I'm a begginer with php...
>
> I got a mysql database, where two of the fields of a table record times as
> CHAR(8) in the format hh:mm:ss
>
> I want to take this two times and get the difference between them in
> seconds, for example 12:01:30 - 12:00:00 = 90

That, is most definately not a 90 second difference, just so FYI...

> I looked up at the doc in the php.net website and couldn't get on how to
do
> this... should I use the strtotime function?
>
> anyone has donde something like this, or knows what functions could help
me
> to do this?
>
> Thanks in advance,
>
> juaid
>
>
> --
> 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




Re: [PHP] convertion from string to time & substracting

2002-06-07 Thread Chris Knipe

> > Talking under correction, but you'll be better of using a TIME column in
> > MySQL.  You can also do all the calculations with MySQL's build in time
> > functions already, which will save you allot of time, seeing that all
the
> > calculations can be done via a single SQL query.
>
> Yes, this is the first thing I thought, but doing this I get an error when
> getting the records.. I'm using the following code:
>
> 
> $result = mysql_query("SELECT * FROM tableNameWHERE field LIKE
> '%$expression%'");

--  add a mysql_error() here to see if the SELECT actually executes and
retrieve any data back from MySQL.  That LIKE '%$expression%' looks a bit
funny to me - it might be worth your while to debug it properly.  If it
doesn't return any errors and the query is just empty, you can make sure it
has data before running the while () loop, by using something like:

if (mysql_num_rows($result) > 0) {

> while ($line = mysql_fetch_array($result)) {
>$startTime   = $linea["startTime"];
^  If it's copied and pasted, there's
your error $linea 
>$stopTime= $line["stopTime"];
> }
> 
}

If it's not, it's *rather* parculiar why it's not working...  Myself, and
allot of other people on here use TIME / DATETIME columns all the time with
very good success rates...

> If the fields are CHAR or VARCHAR I got no problem, but if a use a TIME
type

Which, just makes me think even more that your SQL statement's LIKE clause
isn't right

> I get the following error:
> "Warning: Supplied argument is not a valid MySQL result resource in
> /var/www/text.php on line XX"

Which, tells me that your SQL statement isn't returning any data.  If you
change the columns to TIME types, and execute the query manualy via mysql,
SELECT * FROM tableName WHERE field LIKE '%09:00%';  Does the SQL statement
actually work, without any errors back from MySQL?? I think you're
$expression, needs to be more like WHERE field LIKE '$expression%' (if
$expression contains a hour), or LIKE '%$expression' if $expression contains
a minute.  Escaping the $expression might also be beneficiul, I'm not sure
if it is required, but I normally do it as a standard way of coding: WHERE
field LIKE '" . $expression . "%'.

Another possible thing you can try, is to debug it mysql_error() is very
helpfull, trust me on this.  I also started off implementing mysql lookups
without error checking and posted rather silly mistakes to the list which
could have easily been avoided just debugging the code properly (not that
I'm not saying you don't have a serious problem here, or that I'm taking on
anything personal or anything) - just merly making a observation...

--
me




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




Re: [PHP] convertion from string to time & substracting

2002-06-07 Thread Chris Knipe

- Original Message - 
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'juaid'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 8:29 PM
Subject: RE: [PHP] convertion from string to time & substracting


> That error means your query failed and the result set is not valid. You
> can't use LIKE on a TIME column. 

Since when?

mysql> describe blah;
+---++--+-+--++
| Field | Type   | Null | Key | Default  | Extra  |
+---++--+-+--++
| ID| tinyint(4) |  | PRI | NULL | auto_increment |
| TimeStart | time   |  | MUL | 00:00:00 ||
+---++--+-+--++
2 rows in set (0.00 sec)

mysql> SELECT * FROM blah;
++---+
| ID | TimeStart |
++---+
|  1 | 10:00:00  |
|  2 | 01:00:00  |
|  3 | 11:00:00  |
|  4 | 12:00:00  |
|  5 | 12:12:00  |
|  6 | 11:12:00  |
++---+
6 rows in set (0.00 sec)

mysql> SELECT * FROM blah WHERE TimeStart LIKE '12%';
++---+
| ID | TimeStart |
++---+
|  4 | 12:00:00  |
|  5 | 12:12:00  |
++---+
2 rows in set (0.04 sec)
^^^

You just need to have the correct syntax in the LIKE clause :-) 



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




Re: [PHP] convertion from string to time & substracting

2002-06-07 Thread Chris Knipe

> where $month, $day and $year are got from a form in the previous page via
> POST method.
> So the LIKE condition matches against the "date" field in the table, where
> the format is like "Jun 7 2002"
>
> if I switch connTime, startTime and stopTime to TIME types, I get the
error
> I said
>
> I'll try the things you've told me and the mysql_error() as Chris said

You're LIKE clause is wrong / invalid

If $expression holds an HOUR field, it should be LIKE '$expression%';

if $expression holds a MINUTE field, it should be LIKE '%$expression';

having a LIKE '%$expression%' WILL NOT work... The % in a LIKE clause,
indicates that MySQL should have data BEFORE and AFTER $expression in the
column before it will be returned.  Because it's a TIME column, and the way
in which you use $expression, it will either have only a % (additional data)
before, or after $expression, or NOT AT ALL.

So, the three options you have for this

WHERE field LIKE '%$expression'  /  WHERE field LIKE '$expression%'  /
WHERE field='$expression'

That's the only three options you have from what I see here... I've tested
all of this just now, and they all work wonderfully.



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




Re: [PHP] Chat

2002-06-07 Thread Chris Knipe

www.google.com

search for PHP Chat and see what you come up with.  when you have a specific
problem, come back here and we'll see what we can do for you.

This list is most definitely not to tell you how to develop applications

To give you a head start, there's something called PHPIRC or something
similar, which uses a IRCD server as a backend to the PHP interface for
chatting - it's on freshmeat.net the last time I looked...


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "André Riedel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 06, 2002 10:08 PM
Subject: [PHP] Chat


> Can I make a Chat with PHP or what must I do?
>
>
>
> --
> 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




Re: [PHP] string convertion to time & substracting

2002-06-07 Thread Chris Knipe

Awesome :-)

Glad to have been able to help...

--
me

- Original Message -
From: "juaid" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 07, 2002 9:22 PM
Subject: [PHP] string convertion to time & substracting


> Well, I got all working now and calculating the duration with mysql
> functions
> The fields which which hold times are now TIME types, and everything works
> really good!!!
>
> Thanks again to all  :)
>
> juaid
>
>
>
> --
> 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




Re: [PHP] e-commerce example

2002-06-08 Thread Chris Knipe

www.google.com / www.freshmeat.net


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "savaidis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 08, 2002 5:59 AM
Subject: [PHP] e-commerce example


>
>
> I'm looking for  e-commerce example (PHP+MySQL) so I don't start from zero
> and save some time.
>
> Does  somebody knows something about?
>
> Thanks
>
> Makis Savaidis
>
>
> --
> 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




Re: [PHP] Removing ^M

2002-06-08 Thread Chris Knipe

Perl apparently also works very nice for this

open (FILE, "filename"):
open (NEWFILE, "filename);

WHILE () {
  chomp;
  print NEWFILE $_
}

close (FILE);
close(NEWFILE);

this should take care of ^M
Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message - 
From: "Michael Hall" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Sunday, June 09, 2002 2:40 AM
Subject: [PHP] Removing ^M


> 
> 
> I am trying remove ^M characters (some kind of newline character) from an
> HTML file. I've tried all sorts of ereg_replace and sed possibilities
> but the
> things just won't go away. Does anyone have a way of removing such
> characters?
> 
> TIA 
> 
> Mick
> 
> 
> 
> 
> -- 
> 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




Re: [PHP] Removing ^M

2002-06-08 Thread Chris Knipe

print NEWFILE $_ . "\n";

Then :P

This isn't a perl list, it's off topic.  Just thought it might help if I
added this to the pool Let's rather not go into a in depth discussion
about it... I'm no perl guru either.


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: "Chris Knipe" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, June 08, 2002 7:51 PM
Subject: Re: [PHP] Removing ^M


> 'chomp' removes the end-of-line character(s) from its input, which is
> different from doing an EOL conversion (which is what the OP was after).
> The result of the below perl would be to concatenate all lines together as
> one.
>
> miguel
>
> On Sat, 8 Jun 2002, Chris Knipe wrote:
> > Perl apparently also works very nice for this
> >
> > open (FILE, "filename"):
> > open (NEWFILE, "filename);
> >
> > WHILE () {
> >   chomp;
> >   print NEWFILE $_
> > }
> >
> > close (FILE);
> > close(NEWFILE);
> >
> > this should take care of ^M
> > Kind Regards,
> >
> > Chris Knipe
> > MegaLAN Corporate Networking Services
> > Tel: +27 21 854 7064
> > Cell: +27 72 434 7582
> >
> > - Original Message -
> > From: "Michael Hall" <[EMAIL PROTECTED]>
> > To: "PHP List" <[EMAIL PROTECTED]>
> > Sent: Sunday, June 09, 2002 2:40 AM
> > Subject: [PHP] Removing ^M
> >
> >
> > >
> > >
> > > I am trying remove ^M characters (some kind of newline character) from
an
> > > HTML file. I've tried all sorts of ereg_replace and sed possibilities
> > > but the
> > > things just won't go away. Does anyone have a way of removing such
> > > characters?
> > >
> > > TIA
> > >
> > > Mick
> > >
> > >
> > >
> > >
> > > --
> > > 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
>
>


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




Re: [PHP] SMS with PHP

2002-06-10 Thread Chris Knipe

Not as far as I know.

But the PHP script may very likely be able to send a message to a SMS
Gateway...

SMS messages doesn't run on TCP/IP (Your cell phone doesn't have a IP
Address).

Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "Alexandra Aguiar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 10, 2002 7:46 PM
Subject: [PHP] SMS with PHP


Hello ppl...
i'd like to know if it's possible that a php script sends  message to a cell
phone... i please anything about it ...

thnx in advance..

Alexandra Aguiar



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




[PHP] persistent connections

2002-06-16 Thread Chris Knipe

Lo all,

Is there anyway to "manage" persistent connections to MySQL?

I've started using them on various of my sites (mysql_pconnect instead of
mysql_connect - as in the documentation), but after a few hours, I notice
that the connections just keeps on getting more and more and more.

Eventually, the entire server crawls to a standstill and I have to restart
mysql to speed up the system...

Any ideas?


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




[PHP] mysql_real_escape_string() ?

2002-06-18 Thread Chris Knipe

Lo all,

Does mysql_real_escape_string exist?  I've seen it in the manual pages, and
to my understanding, it is the proper function to call on strings to escape
them before inserting them into a database...

I've used it as follows:
 $text[1] = mysql_real_escape_string($text[1]);
 $details[0] = mysql_real_escape_string($details[0]);
 $url[1] = mysql_real_escape_string($url[1]);

However, it returns a error:
Fatal error: Call to undefined function: mysql_real_escape_string() in
D:\temp\grabnews.php on line 32

Now what???



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




Re: [PHP] substr?

2002-06-18 Thread Chris Knipe

> When working with Boolean expressions in this way, deMorgan's laws often
come in handy; these state that:
>
>  !a AND !bis the same as !(a OR b)
>  !a OR !b is the same as !(a AND b)
>
> Hope this helps!!

I don't know who this deMorgan dude is, but that rule is being written down
in red on a piece of paper that's getting stuck to the bottom of my screen.
It makes perfect sense, and I can start to see where the whole "maths" thing
comes into programming now... It's actually not only a case of logic, but
very much based on maths as well (which I'm afraid isn't something I'm good
at)...

Needless to say, this helped me quite a bit... I'll try and implement it
wisely :-)

--
me



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




Re: [PHP] URGENT

2002-06-18 Thread Chris Knipe

> local = '$local', city = '$city', postcode = '$postcode', id = '$id'";
> $sql .= "WHERE username='$username'";

This would be:

local = 'x', city = 'x', postcode = 'x', id = 'x'WHERE username='x'

Which is your fault.

> $sql .= "WHERE username='$username'";

needs to change to

> $sql .= " WHERE username='$username'";

i.e., the space.

A simply mysql_error, or even echo $sql before you did the query would have
shown this for you


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




Re: [PHP] Mail() function

2002-07-09 Thread Chris Knipe

No you cant.

All Received:, Date:, Message-ID headers are added to the message at the
SMTP server...  Hence, any halfly decent configured SMTP server will *always*
add those headers to *any* message.

If you have administration over the SMTP server, you can with allot of 
tweaking configure the SMTP server to remove the headers after it was added
if, for instance, the sender is httpd@localhost.  However, the next SMTP
server that the message is forwarded to, will just add them again in anycase.

--
me


On Tue, Jul 09, 2002 at 06:07:43PM -0300, C?sar Aracena wrote:
> Hi all.
>  
> I wonder if there?s a way to *HIDE* some parts from the Heading of the
> emails sent with PHP. I?m trying to create an anonymous mail sender but
> in the header of the message appears:
>  
> Received: (from httpd@localhost)
> by www.whateverdomain.com (8.10.2/8.10.2) id g69MEA527130;
> Tue, 9 Jul 2002 18:14:10 -0400
> Date: Tue, 9 Jul 2002 18:14:10 -0400
> Message-Id: 200207092214.g69MEA527130@www.
> 
> whateverdomain.com
>  
> I want to hide the *whateverdomain.com* (because is my hosting provider?
> Just learning some useful things? please look at
> www.icaam.com.ar/mass-mailer.php
>  
> I just got bored of receiving mass email from this list? fooling around
> ;-)
>  
>   Cesar Aracena
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
>  

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




Re: [PHP] MAIL FROM NO ONE

2002-07-11 Thread Chris Knipe

On Thu, Jul 11, 2002 at 02:29:11PM +0200, vins wrote:
> Hi... I've just checked out a script from hotscripts.com that send email 
> from and smtp server...

The mail() does exactly the same  Nothing fancy about it.

> I've managed to say the email has come from a server that doesn't exist
> but the email can still be traced...

Care to show the headers?  I'm just curious as to how the messages are
actually produced.  You have to keep in mind, that by doing something like 
this, the chances are really good that the majority of your email will NOT
be delivered to its final destinations.

Allot of SMTP servers does quite a bit of sanity checking on the headers
received from an email message.  They must, for example, include proper
Received By (which is what is used for tracking the email), To:, From:, 
BCC:, etc headers.  Without these, or with malformed headers, many SMTP 
servers will reject and bounce the email.  You'll need to be *very* carefull
in doing something like this.

If you don't understand in very much details how SMTP works, and how SMTP 
servers delivers email, I'd suggest you do not attempt to tamper with it.
 
> is there know way to build a php smtp server ?

PHP can't run a script in a daemon that I am aware of, so the short awnser is
definately no.  If you want a PHP script to simply send a message to a SMTP 
server, then sure, there is the mail() function, or you can open a socket
to port 25 of the mail server.  However, as I stated above, if you do not
include proper headers (which identifies the email and make the email 
trackable), most SMTP servers will immediately reject the email.

--
me


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




Re: [PHP] Help a Header Headache!!

2002-07-11 Thread Chris Knipe

Have you perhaps tried rather sending the mail using MIMETools ?

There's a PHP class writen that's actually pretty good for sending MIME based
email...  I'm not sure what it's called now, but I'm sure someone else on the
list will be able to elaborate on this.

On Thu, Jul 11, 2002 at 12:26:45PM -0700, Shane wrote:
> I am trying to send an EMBED and OBJECT tag inside an HTML email using the mail() 
>call.
>  My HEADER Content type is...
> 
> $headers = "MIME-Version: 1.0\r\n";
> $headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers.= "From: ".$myname."<".$myemail.">\r\n";

May not be of importance, but you're missing a space.

> $headers.= "To: ".$contactname."<".$contactemail.">\r\n";
> $headers.= "Reply-To: ".$myname."<$myreplyemail>\r\n";
> $headers.= "X-Priority: 1\r\n";
> $headers.= "X-MSMail-Priority: High\r\n";
> $headers.= "X-Mailer: Just My Server";
> 
> mail($contactemail, $subject, $message, $headers);
> 
> Each Time I add the EMBED or OBJECT tag, the mail() call errors out.
> What type of content-type do I need to use to be able to send EMBED tags through an 
>HTML email in PHP?

Can you show the message body?  MIME isn't related to the headers that
directly.  Propper syntax of the body of the message is more important, and is
more than likely where your fault lies.
 
> Please help, I have had no luck with the manual or my archives.

Hope this helps

--
me


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




Re: [PHP] Help a Header Headache!!

2002-07-11 Thread Chris Knipe

On Thu, Jul 11, 2002 at 08:59:28PM +0100, Chris Hewitt wrote:
> I have not responded to this before as I have not used EMBED or OBJECT 
> tagss but I have used Manuel Lemos's smtpclass-2002-05-13.tar.gz and 
> mimemessage-2002-06-08.tar.gz which are intended for html email. They 
> are on phpclasses.org and easy to find.

I just had a look through some of my source  Here's what I use.. 

  /***
   * Title.: HTML Mime Mail class
   * Version...: 1.26
   * Author: Richard Heyes <[EMAIL PROTECTED]>
   * Filename..: html_mime_mail.class
   * Last changed..: 25/06/2000
   */

A simple search on google / phpclasses.org should reveal the tarbal.

--
me


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




Re: [PHP] Re: MAIL() Trouble. Need your eyes.

2002-07-11 Thread Chris Knipe

On Thu, Jul 11, 2002 at 07:00:57PM -0400, Chris Earle wrote:

> -
>  $myname = "Me Myself";
> $myemail = "[EMAIL PROTECTED]";
> $myreplyemail = "[EMAIL PROTECTED]";
> $contactname = "Mister Contact";
> $contactemail = "[EMAIL PROTECTED]";

That's ok...

> ---
> MY VERY LONG $MESSAGE STRING
> ---
> $message = "";

That's not how MIME based email bodies start.
 
> //$message.= " classid='clsid:D27CDB6E-AE6D-11cf-96B8-44455354'
> codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
> b#version=5,0,0,0' width='500' height='300'> value='http://www.delaplaine.net/flashmail/delaplaine.swf'> name=quality value=high> value='#54616E'>";

This will give an error, because the message is not defined as a propper MIME
type.

I'm not 100% sure of the exact correct syntax of MIME based email now, but
a look at the RFCs.  A nice quick hack to get the propper syntax, send yourself
a HTML based email from OE or a similar mail client, and view the source of
the generated email message.

You need things like

--- message type="mime/type" type="application/x-shockwave ---
--- next part="lbahb lah" ---

etc etc etc.

So yes, you're problem is that your email's not properly formated.  Search
arround a bit, read some fine manuals, and make some examples of MIME based
email messages from clients that you know works properly (such as OE).

Then, go back, format your message body properly, and it should all work very
nicely

--
me


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




Re: [PHP] REminder APllication

2002-07-11 Thread Chris Knipe

On Thu, Jul 11, 2002 at 10:05:05PM -0400, John Holmes wrote:
> > DOes anyone know how to build a reminder application on:
> > 
> > a) identified users
> > b)  Sorting users' reminders??
> 
> Yes.

You just couldn't resist, could you? ;) 

I like it -g-

To be a bit more precise, the awnser's actually No.  You can't build a
application on (in?) either (a) or (b) as indicated above.  However, a 
application could be written in various languages to accomplish both (a) and 
(b) without much hassles. ;))

--
me


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




[PHP] safe_mode

2002-07-11 Thread Chris Knipe

Lo all,

Does anyone have some examples, ideas, or references on how to setup php's
safe_mode operation so that I can provide a reasonably secure environment for
hosting php3 and php4 (public web sites, with public users).

This is for a public type hosting environment, so I'll definately need to 
protect the servers from malicious code (such as exec(rm... ), and everything
else that goes with it... 

Any pointers or web sites that may be of help will be appreciated
tremendiously.

--
me


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




Re: [PHP] mail() problem

2002-07-13 Thread Chris Knipe

> Does anyone have an idea, what might cause this problem?
> Could it be the ISP, or do i need to add additional info, when i call the
mail() function in order to send emails outside my network?

Could be your ISP...

> This is what i used to test if the emails get sent or not:

>  mail([EMAIL PROTECTED],"test-subject","Test-content","From:
[EMAIL PROTECTED]\r\n"."Reply-To:[EMAIL PROTECTED]\r\n");
> ?>

Mail from [EMAIL PROTECTED] may be your problem, if the ISP is doing sender
address verification (which is more than likely the case).

Try sending the mail from a valid exisiting email address, and see if that
may help you.



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




Re: [PHP] retrieving random data from mysql database

2002-07-14 Thread Chris Knipe

SELECT RANDOM name FROM table

or

SELECT name FROM table ORDER BY RANDOM LIMIT 1

not tested, used at your own free will.

--
me


- Original Message -
From: "mm fernandez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 14, 2002 11:37 PM
Subject: [PHP] retrieving random data from mysql database


hi,
can you teach me how to retrieve random data from my database? like for
example...i have a list of names on my database and i'd like to retrieve
only one name at a time..randomly. how do i go about this?

hope someone can help...thanx.





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




[PHP] Sorting getmxrr()

2002-07-15 Thread Chris Knipe

Lo all,

  if (getmxrr($DomainPart, $DomainMX, $Weight)) {
for ($Counter = 0; $Counter < count($DomainMX); $Counter++) {
  echo "$DomainMX[$Counter] ($Weight[$Counter]) ";
}
  }

How can I manage to sort $DomainMX from the lowest $Weight to the highest,
while still preserving the proper $Weight to the $DomainMX?

Thankies :-)

--
me



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




Re: [PHP] Using index.php instead of index.html

2002-07-16 Thread Chris Knipe

> Why not just add it to the httpd.conf, this would allow it to work within
the whole server
> And not just one director / vhost ect

Maybe he doesn't have access to alter server configurations? -eg-

--
me



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




Re: [PHP] transparent clusters + sessions

2002-07-16 Thread Chris Knipe

> >If I have say 20 web servers in a cluster behind something like a Cisco
> >LocalDirector, will session data remain constant over the 20 web servers
if
> >they use a shared NFS or similar mount to save session data on?
> Have a look at msession at http://www.mohawksoft.com/phoenix/
> It works very well, I would not run the patch on the standard php session
> code as it seems to cause problems if you want to switch between session
> types. (at least on my setup php-4.2.1 apache linux)
> I have a class to manipulate msession as a user session if you need it.

I'll have a look at it...

I'd definitely need something that is server side however.  People doing PHP
code, and hosting it on these "clusters" do not even know that their sites
are on clusters.  The content is uploaded on servers that do not even have
web servers on them, all sorts of very nifty advance stuff.

By your reply however, I take it simply using a "shared" directory for
session data isn't going to work?

--
me



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




Re: [PHP] How to compare between two values?

2004-01-16 Thread Chris Knipe
err

if ($_GET['value2'] == $DataRecord['Value1']) {
  // do something

}

?


- Original Message - 
From: "SASSINC Internet Solutions - Arabic Department"
<[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, January 16, 2004 2:42 PM
Subject: [PHP] How to compare between two values?


> Hi again..
>
> How to compare between two values, One imported from a mySQL DB and the
other grabbed by GET (http://www.sitename.com/test.php?value2=3342g345)
>
> Waiting your replies..
>
> regards..
>

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



Re: [PHP] Destroying Sessions

2002-05-09 Thread Chris Knipe

>  I am not an expert at PHP / MySQL.  To me it would sound like the
> one = is assigning the $VerifyPasword[ContactID] whatever is in
> $_SESSION['ContactID'] which would mean that the else part would never be
> executed.  Honestly though, there is a lot that I don't know.  I know very

I can't really agree with that (Although, you are more than likely right
It just sounds fishy for me that you can set two variables to the same value
inside a if statement, when a if statement is in fact there to rather
compare information - sort of, like a read-only state for the variables?)...
I'll keep my code here, and add / remove some debugging, and just let you
and the other's see what is actually going on here in regards to what
information the variables is actually caring and comparing...

Just to clarify myself above...
if ($var1 = $var2) { .

In my crazy head, I see $var1 and $var2 to be in a sort of "read-only" state
inside the () of the if statement.  For a if statement to be able to change
the values in that instance, would be wrong for me.  Afterall, the logic of
a if statement does go something in the lines of "if value equals value then
execute this, else, execute that" etc etc etc There's nothing in that
logic of setting or changing any values ?

Back to the matter at hand tho...

while ($VerifyPassword = mysql_fetch_array($PasswordCheckSQL)) {

echo "Session: " . $_SESSION['ContactID'] . ", DataBase: " .
$VerifyPassword[ContactID];
// In the browser, they are both returned as 1
//  Both the session and contact IDs are looked up from the same database,
through two
// different functions, they are the number from a auto_increment columb in
a table. And yes
// there is only one row in the table currently, the original selection is
done via a WHERE
// claues, and because there is only one row, both the $_SESSION and
$VerifiyPassword
// should thus return the same row number (auto_increment) because there is
only one
// row in the table?

  // Compare UserIDs
  if ($VerifyPasword[ContactID] = $_SESSION['ContactID']) {
$_SESSION['Authenticated'] = "True";
$AuthenticationFailure = "False";
// In this example, the if statement will exit here (which is
where it should exit)
  } else {
 $_SESSION['Authenticated'] = "False";
 $AuthenticationFailure = "True";
  }


// Now let's look at how I understand the if statement to be, and what
happens.  This is now,
// after I have confirmed above with the echo, that the two variables are in
fact the same...
if ($VerifyPassword[ContactID] == $_SESSION['ContactID']) {
  echo "they are the same";
} else {
  echo "if statement lied, and reported them as not being the same";
  // statement exists here.
}

if (($VerifyPassword[ContactID]) == ($_SESSION['ContactID'])) {
  echo "they are the same";
} else {
  echo "if statement lied, and reported them as not being the same";
  // statement exists here.
}

if (!($VerifyPassword[ContactID] == $_SESSION['ContactID'])) {
  echo "they are not the same";
  // statement exists here.
} else {
  echo "the same";
}

// Now, I force the data to not be the same...
$_SESSION['ContactID'] = "1000";
if ($VerifyPassword[ContactID] == $_SESSION['ContactID']) {
  echo "if statement lied, and reported them as being the same";
  // Statement exists here.
} else {
  echo "they are not the same";
}

What, on heavens name, is going on here :P  I'm not going to ditch PHP or
anything like that, I know that it definately is something that I am doing
wrong.  The problem is, I don't know what I'm doing wrong.  99.99% if all my
statements used in my PHP applications, uses == or === (if I know 100% that
I am comparing data of the same type).  This one specific one, refuses to
operate :-(  And it's starting to annoy me now very much to say the
least :-(

--
me




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




Re: [PHP] Destroying Sessions

2002-05-09 Thread Chris Knipe

>   if ($VerifyPasword[ContactID] = $_SESSION['ContactID'])
>
> This statement is /always/ true if $_SESSION['ContactID'] is non-zero, or
> non-empty.
>
> If your code is copy-and-paste then the error is most likely because you
used
> a single 's' in $VerifyPasword[ContactID]. And also is better to
single-quote
> your array indices (see manual on arrays for reason):

GOD SAVE THE QUEEEN!!!

You're my hero!! Remind me to buy you a box of chocolates  Yes, I
haven't confirmed this, but the code is copy & paste, so you are right.
It's a freaking spelling mistake, and no, in after three days of battling
with this specific loop - I have not noticed it.

*makes  a eye test appointment to go for new glasses*

Thanks a MILION!!!


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




Re: [PHP] sessions

2002-05-12 Thread Chris Knipe

Ok,

Let's see if I learned anything


- Original Message -
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 13, 2002 2:30 AM
Subject: [PHP] sessions



> $msg = "You have been authorized to make changes to
the
> web site.";
> session_is_registered('u_name');
> session_is_registered('p_word');

$_SESSION['u_name'] = $u_name;
$_SESSION['p_word'] = $p_word;

> session_start();

^^ Not to sure if you need this again, I doub't it.

> } else {
> header("Location: index.php");
> exit;
> }
> ?>
> 
> 
> 
> 
> 
> 
> 
> 

print ($_SESSION['u_name']);
print ($_SESSION['p_word']);



Syntax has not been double checked, so there might be a few errors, but you
should be using $_SESSION['varname']; :)

See, I actually do learn things aswell over time :)   Thanks again for
everyone who has helped me!!!  My next set of questions will prob be on
GDLib (I can feel this coming)...

--
me




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




[PHP] How *not* to assume MySQL will return data?

2002-05-13 Thread Chris Knipe

Hiya all,

Stock standard, and from most of the examples I've seen, standard MySQL
lookups via PHP utlises a while look to retrieve the data.  All very nice
and well yes... But what if there is no data?

Here's a little example of what I want to do...

// Check for inportaint notices for the contact.
echo "\n";
echo "  \n";
echo "\n";
echo "  Important notes:\n";
echo "\n";
echo "  \n";
$SQL = mysql_query("SELECT MessageID, MessageTitle FROM contactmessages
WHERE ContactID='" . $_SESSION['ContactID'] . "' AND MessageRead='n';");
while ($ContactMessageList = mysql_fetch_array($SQL)) {
  echo "  \n";
  echo "\n";
  echo "" .
$ContactMessageList['MessageTitle'] . "\n";
  echo "  \n";
}
echo "\n";
echo "\n";

>From this example, this "block" would be printed evertime.  Whether the
contact has actual messages or not.  How would I go about in a instance like
this, to use a MySQL check and only print the block if $SQL will actually
return data ?

In this case, can I do something like...

if ($SQL = mysql_query("something") {
  print the block
  while (do the actualy mysql lookup) {
print data
  }
}

Spanks everyone :)

--
me



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




Re: [PHP] How *not* to assume MySQL will return data?

2002-05-13 Thread Chris Knipe

H.

There's no way to do it *without* having to submit two queries to the
database?  I'm thinking load wise here. The query (or block), would be
displayed on every single page in my app - sort of like a shared border type
thing...

Now, when I have say, 20 pages in the site, 250 concurrent users (or active
sessions) on the site - which, can happy very quickly - the load on the
database is going to be -very- high   So I'm kind of looking for a way
how I can do this, with as few queries as possible, to put as little stress
on the database as I can...

But yes, if there is no otherway to do it, then I guess this would have to
do


Kind Regards,

Chris Knipe
MegaLAN Corporate InterNetworking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "Nathan" <[EMAIL PROTECTED]>
To: "Chris Knipe" <[EMAIL PROTECTED]>
Sent: Monday, May 13, 2002 7:12 PM
Subject: Re: [PHP] How *not* to assume MySQL will return data?


> if (mysql_num_rows($query) > 0) {
> print crud
> }
> else {
> echo "Query succeeded, but produced no results";
> }
>
> Is that what you mean?
>
>
> - Original Message -
> From: "Chris Knipe" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, May 13, 2002 8:46 AM
> Subject: [PHP] How *not* to assume MySQL will return data?
>
>
> Hiya all,
>
> Stock standard, and from most of the examples I've seen, standard MySQL
> lookups via PHP utlises a while look to retrieve the data.  All very nice
> and well yes... But what if there is no data?
>
> Here's a little example of what I want to do...
>
> // Check for inportaint notices for the contact.
> echo "\n";
> echo "  \n";
> echo "\n";
> echo "  Important notes:\n";
> echo "\n";
> echo "  \n";
> $SQL = mysql_query("SELECT MessageID, MessageTitle FROM
contactmessages
> WHERE ContactID='" . $_SESSION['ContactID'] . "' AND MessageRead='n';");
> while ($ContactMessageList = mysql_fetch_array($SQL)) {
>   echo "  \n";
>   echo " href=\"/profile/readmsg.php?MessageID=" . $ContactMessageList['MessageID']
.
> "\" alt=\"Read Message\" border=\"0\"> border=\"0\">\n";
>   echo "" .
> $ContactMessageList['MessageTitle'] . "\n";
>   echo "  \n";
> }
> echo "\n";
> echo "\n";
>
> >From this example, this "block" would be printed evertime.  Whether the
> contact has actual messages or not.  How would I go about in a instance
like
> this, to use a MySQL check and only print the block if $SQL will actually
> return data ?
>
> In this case, can I do something like...
>
> if ($SQL = mysql_query("something") {
>   print the block
>   while (do the actualy mysql lookup) {
> print data
>   }
> }
>
> Spanks everyone :)
>
> --
> me
>
>
>
> --
> 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




Re: [PHP] Combine 2 Db Columns with an Array?

2002-05-13 Thread Chris Knipe

This is SQL not PHP

You should be doing something like

SELECT COLUMB + CLOLUM AS Something, SomethingElse, AnotherSomethingElse
FROM TABLE

Then you can reference Something as a normal colum in any database table
Such as echo $Something...

I'm not to sure about the syntax, have a look through the mysql manuals...
It is mentioned there, with examples.


Kind Regards,

Chris Knipe
MegaLAN Corporate InterNetworking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

- Original Message -
From: "PHP User" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 13, 2002 8:42 PM
Subject: [PHP] Combine 2 Db Columns with an Array?


> I am trying to find the best way to combine 2 columns in a MySQL Db call
into
> one by using an array. I've tried array_push, implode, explode,
array_merge and
> extract all with no luck. I feel I am close but have read all I can and
still am
> hitting a dead end.
> I need to select a Title and Alternate title from a table, and then list
the
> results by BOTH the Title and Alternate Title. So the list that gets
echoed out
> would be a combined array of the Title column and the Alt_Title column.
The idea
> is to have each item listed twice, once by it's title and once by it's
alternate
> title.
> I can not find a way to merge the 2 separate columns.
> Here's what I'm trying to do:
>
> $result = mysql_query("SELECT Title, Alt_Title, Size, Price, More, Comment
> ORDER BY title");
>
> //magically combine the title & alt_title into on nice variable called
> $Title
> //or whatever
> while ($db = mysql_fetch_array($result))
> {
> echo "$Title";
> }
>
>
>


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




[PHP] accessing mysql_fetch_array more than once?

2002-05-17 Thread Chris Knipe

Hi all,

Howcome, when I do a SQL lookup, I can only access the array once?

Say, I have... 







--
me




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




Re: [PHP] accessing mysql_fetch_array more than once?

2002-05-17 Thread Chris Knipe

Didn't do the trick

But it did point my towards mysql_data_seek, which did the job beautifully
:)

Thanks

--
me


- Original Message -
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "Chris Knipe" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, May 17, 2002 7:04 PM
Subject: Re: [PHP] accessing mysql_fetch_array more than once?


> reset()
>
> On Fri, 17 May 2002, Chris Knipe wrote:
>
> > Hi all,
> >
> > Howcome, when I do a SQL lookup, I can only access the array once?
> >
> > Say, I have...
> >
> >  > $SQL = mysql_query("SOME SELECT STATEMENT");
> > while ($var = mysql_fetch_array($SQL)) {
> >   echo $var['columbname'];
> > }
> >
> > // that works, and prints out the rows in the table
> > // my codes continues.
> >
> > ?>
> >
> > 
> >
> >  > while ($var = mysql_fetch_array($SQL)) {
> >   echo $var['columbname'];
> > }
> > // Now, the array doesn't print anything...
> > ?>
> >
> > --
> > me
> >
> >
> >
> >
> > --
> > 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
>
>


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




[PHP] Expiring certain session data while keeping the session itself

2002-05-20 Thread Chris Knipe

Hiya, me again :-)

Is it possible to expire certain session data, while still keeping the
session itself in tact?

Example...

$_SESSION['AlwaysTrue'] = "True";
$_SESSION['ExpireThis'] = "10:20:00";

At 10:19:50 the session is registered.  AlwaysTrue must remain True for as
long as the session itself is true (as specified in the documentation - this
would be until the browser is closed, or after a certain amount of inactive
time).

However, at 10:20:00 (10 seconds later), I want the ExpireThis value of the
session, to be destroyed, without having to de-register the entire session
(this would then also destroy the AlwaysTrue value...

Am I right in presuming this cannot be done, and I'll have to come up with
my own little function to do this with?  If so, how can I see at what time a
session variable was written, or would I need to register the time that the
session variable was set to the session as well?  For instance

$_SESSION['AlwaysTrue'] = "True";
$_SESSION['ExpireThis'] = "10:20:00";
$_SESSION['ExpireThisTime'] = "10:19:50";

Then, just do a comparison, and if ExpireThisTime is past 10:20:00, then
just delete that one variable...

There's no easier / better way to do this ??

Basically, I'm needing something like this to bring down the number of
possible database queries.  I have a application which will have new
information in a database, every 75 seconds.  The queries are performed on
every single page that a user is logged in to on a site.  To make sure that
the same queries is not issued over and over on the database, I want to
implement some sort of caching where I will only need to do another query
after the database received new information (every 75 seconds).  It's all
numbers (integers), so I was thinking It may well work if I can save
these values to session data, and then just "refresh" the session data every
75 seconds  The problem is, there's lots of other information saved to
the session as well, which I cannot afford to loose with a possible
session_destroy()..

--
me




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




[PHP] Working with ip addresses and address space

2002-05-31 Thread Chris Knipe

Hi all,

anyone know of any good pre-written classes or functions to work with IP
address space?

I'm looking for things which can verify correct notation of IP addresses
(fine, that's easy enough), but also verify things like network addresses,
broadcast addresses, and work out subnet masks when a start and end IP
address is given...

Any ideas?  I'm sure I can just write my own... But it's going to save me
allot of time if something like this is out there already for me to use.

--
me



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




[PHP] LDAP, Active Directory, and permissions

2010-11-30 Thread Chris Knipe
Hi,

I've found various sources and are successfully manipulating Active
Directory from PHP on our Domain Controller - frankly, things works much
better than I expected :)

I have now reached the point where I need to set permissions on objects in
Active Directory, i.e. to restrict read permissions to certain OUs and
objects within the directory (mainly related to Exchange stuff).

Is there anything in PHP which can be used to set permissions on AD
objects?  I haven't found any reference to doing this anywhere, so I thought
I'd give it a chance here... If not, then I suppose I'll have to code some
..NET application to act as a gateway between the PHP interface and Active
Directory, but naturally I would like to do as much as possible from within
PHP itself.

Many thanks,


-- 

Regards,
Chris Knipe


RE: [PHP] LDAP, Active Directory, and permissions

2010-11-30 Thread Chris Knipe
Hi,

> Chris,
> 
> 1) Shouldn't the OU security permissions be set within the AD itself?
> 2) If the above is done, then the user account that's being authenticated
> shouldn't be able to access privileged information.

1) Not sure.  The permissions I'm after is similar to that of NTFS
permissions on the file system.  Essentially, it is a way to restrict an
application to read certain OU's or Objects completely, making it invisible.
FYI... http://technet.microsoft.com/en-us/library/cc785913(WS.10).aspx

2) This is completely irrelevant to authentication.  See point 1 above.
 
> Just curious, are you using phpldapadmin?

A modified version of adLDAP, http://adldap.sourceforge.net/

Regards,
Chris.



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



Re: [PHP] 0.0.0.0 & iplong()

2012-06-05 Thread Chris Knipe
> acl allow range: 192.168.0.0/24
> acl deny range: 0.0.0.0/24
>
> CIDR notation allows me to utilize shorthand notation for specifying a range
> of IP's
>
> In those two cases any ip within 192.168.0.0 - 192.168.0.255 is allowed
> while anything else residing between 0.0.0.0 - 255.255.255.255 is denied

Na-uh.  You want 0.0.0.0/0, which is valid. 0.0.0.0/24 isn't valid.

-- 

Regards,
Chris Knipe

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



[PHP] A little confused

2013-04-23 Thread Chris Knipe
Hi All,

$_SESSION['ExpiryDate'] = "2013-04-23";
echo date_format($_SESSION['ExpiryDate'], "D, \t\h\e jS \o\f M Y");

Required Result: Mon, the 23rd of Apr 2013

I get however:  PHP Warning:  date_format() expects parameter 1 to be
DateTime, integer given in

I've had a look at the date/time function list, but I cannot seem to find
any way to convert $_SESSION['ExpiryDate'] to an DateTime??

--
Chris.



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




Re: [PHP] A little confused

2013-04-23 Thread Chris Knipe
Yes,

strtotime() does convert the $_SESSION value to a unix epoc, as expected.
However, date_format still complains that the argument is a Integer value,
instead of a DateTime.




On Tue, Apr 23, 2013 at 12:09 PM, Stuart Dallas  wrote:

> On 23 Apr 2013, at 11:07, "Chris Knipe"  wrote:
>
> > $_SESSION['ExpiryDate'] = "2013-04-23";
> > echo date_format($_SESSION['ExpiryDate'], "D, \t\h\e jS \o\f M Y");
> >
> > Required Result: Mon, the 23rd of Apr 2013
> >
> > I get however:  PHP Warning:  date_format() expects parameter 1 to be
> > DateTime, integer given in
> >
> > I've had a look at the date/time function list, but I cannot seem to find
> > any way to convert $_SESSION['ExpiryDate'] to an DateTime??
>
> http://php.net/strtotime
>
> -Stuart
>
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
>



-- 

Regards,
Chris Knipe


Re: [PHP] A little confused

2013-04-23 Thread Chris Knipe
Thanks for the replies guys - figured it out!

Using date() directly with strtotime() and the appropriate formating works
:)

date("D, \\t\h\e jS \o\\f M Y", strtotime($_SESSION['ExpiryTime']))




On Tue, Apr 23, 2013 at 12:16 PM, shiplu  wrote:

>
> On Tue, Apr 23, 2013 at 4:07 PM, Chris Knipe  wrote:
>
>> echo date_format($_SESSION['ExpiryDate'], "D, \t\h\e jS \o\f M Y");
>>
>
> Why not construct DateTime object
>
> echo date_format(new DateTime($_SESSION['ExpiryDate']), "D, \t\h\e jS \o\f
> M Y");
>
> Or
>
> $dt = new DateTime($_SESSION['ExpiryDate']);
> echo $dt->format("D, \t\h\e jS \o\f M Y");
>
> I personally like the later. It takes less characters to do more.
>
>
>
>
>
>
> --
> Shiplu.Mokadd.im
> ImgSign.com | A dynamic signature machine
> Innovation distinguishes between follower and leader
>



-- 

Regards,
Chris Knipe


[PHP] something stupid... split().

2005-03-17 Thread Chris Knipe
Lo all,
echo ConvertTime($AcctSessionTime/90); # Returns: 03:17:46.77
I am trying to drop the .whatever..  Thus,
list($Duration, $none) = split('.', ConvertTime($AcctSessionTime/90), 2);
However, $Duration is empty, and $none has the whole string from 
ConvertTime  As I said, something silly ;)

Thanks for the help.
--
Chris. 

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


Re: [PHP] something stupid... split().

2005-03-17 Thread Chris Knipe
[] was the answer... Something stupid sorted :)
--
Chris
- Original Message - 
From: "Chris Knipe" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, March 17, 2005 1:16 PM
Subject: [PHP] something stupid... split().


Lo all,
echo ConvertTime($AcctSessionTime/90); # Returns: 03:17:46.77
I am trying to drop the .whatever..  Thus,
list($Duration, $none) = split('.', ConvertTime($AcctSessionTime/90), 2);
However, $Duration is empty, and $none has the whole string from 
ConvertTime  As I said, something silly ;)

Thanks for the help.
--
Chris. 

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


[PHP] round?

2005-04-16 Thread Chris Knipe
Hi,
I'm not sure if round() is what I am after.  I want to round whole numbers 
to the closest 10 - thus, not decimals, etc.

For example.
11.23 = 10
14.76 = 10
15.23 = 20
18.53 = 20
Thanks,
--
Chris.
I love deadlines. I especially love the whooshing sound they make as they 
fly by..." - Douglas Adams, 'Hitchhiker's Guide to the Galaxy' 

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


[PHP] Compiling issues...

2004-07-13 Thread Chris Knipe
Lo all,

The software... FreeBSD4.9-STABLE, Apache 1.3.27, and PHP4 4.3.7 (From
Ports).

Everything compiles fine, running mySQL Client version 5.0

LDD shows:
[EMAIL PROTECTED]:/usr/local/libexec/apache# ldd
/usr/local/libexec/apache/libphp4.so
/usr/local/libexec/apache/libphp4.so:
libcrypto.so.3 => /usr/local/lib/libcrypto.so.3 (0x284b8000)
libssl.so.3 => /usr/local/lib/libssl.so.3 (0x285ab000)
libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x285da000)
libmcal.so => /usr/local/lib/libmcal.so (0x285f3000)
libc-client4.so.8 => /usr/local/lib/libc-client4.so.8 (0x28603000)
libzzip.so.10 => /usr/local/lib/libzzip.so.10 (0x286b7000)
libexpat.so.5 => /usr/local/lib/libexpat.so.5 (0x286bd000)
libsnmp.so.4 => /usr/local/lib/libsnmp.so.4 (0x286da000)
libhistory.so.4 => /usr/lib/libhistory.so.4 (0x28734000)
libreadline.so.4 => /usr/lib/libreadline.so.4 (0x2873a000)
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x2876)
libpspell.so.15 => /usr/local/lib/libpspell.so.15 (0x287a2000)
libmysqlclient.so.14 => /usr/local/lib/mysql/libmysqlclient.so.14
(0x287a4000)
libsybdb.so.4 => /usr/local/lib/libsybdb.so.4 (0x287d6000)
libming.so.3 => /usr/local/lib/libming.so.3 (0x28821000)
libm.so.2 => /usr/lib/libm.so.2 (0x28855000)
libmhash.so.2 => /usr/local/lib/libmhash.so.2 (0x28871000)
libmcve.so.3 => /usr/local/lib/libmcve.so.3 (0x2888a000)
libmcrypt.so.8 => /usr/local/lib/libmcrypt.so.8 (0x28897000)
libltdl.so.4 => /usr/local/lib/libltdl.so.4 (0x288ca000)
libpam.so.1 => /usr/lib/libpam.so.1 (0x288d2000)
libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x288dc000)
libgmp.so.3 => /usr/lib/libgmp.so.3 (0x289ca000)
libintl.so.5 => /usr/local/lib/libintl.so.5 (0x289e)
libt1.so.5 => /usr/local/lib/libt1.so.5 (0x289e9000)
libfreetype.so.9 => /usr/local/lib/libfreetype.so.9 (0x28a35000)
libpng.so.5 => /usr/local/lib/libpng.so.5 (0x28a87000)
libz.so.2 => /usr/lib/libz.so.2 (0x28aab000)
libjpeg.so.9 => /usr/local/lib/libjpeg.so.9 (0x28ab9000)
libdb41.so.1 => /usr/local/lib/libdb41.so.1 (0x28ad7000)
libgdbm.so.3 => /usr/local/lib/libgdbm.so.3 (0x28b77000)
libcurl.so.3 => /usr/local/lib/libcurl.so.3 (0x28b7d000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x28ba9000)
libudmsearch.so.1 => /usr/local/lib/libudmsearch.so.1 (0x28bb9000)
libssl.so.3 => /usr/lib/libssl.so.3 (0x28bf)
libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x28c2)
libaspell.so.15 => /usr/local/lib/libaspell.so.15 (0x28d1f000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x28dec000)
libmysqlclient.so.10 => not found (0x0)

Apache complains:
[EMAIL PROTECTED]:/usr/local/libexec/apache# apachectl configtest
Syntax error on line 42 of /usr/local/etc/apache/httpd.conf:
Cannot load /usr/local/libexec/apache/libphp4.so into server: Shared object
"libmysqlclient.so.10" not found

Now, from the LDD, why would PHP link against libmysqlclient.so.14 (for
5.0-ALPHA of mysqlclient), AS WELL AS libmysqlclient.so.10 (which was an
older 3.x version).  so.10 doesn't even exist on my system anymore... And
yes, I tried symlinking, it is looking for references which doesn't exist in
so.14

Uhm, am I stupid, or is something broken??

--
me

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



Re: [PHP] VOTE TODAY

2004-11-02 Thread Chris Knipe
> I can't wait for the replies...
Here's a reply:
Don't vote for Bush.
- Grant

I'm Canadian, please stop wasting my bandwidth.
I'm South African (and bandwidth is very expensive), please don't waiste 
mine either *G*

--
Chris.

*
** This email has been scanned by Cenergy Networks for viruses and **
** spam.  As part of our ongoing drive to ensure reliable and  **
** secure communications, Cenergy Networks guarantees this message **
** to be clean of any viruses or spam.  Should you not be satisfied**
** with the content of this email, please let us know by emailing  **
** us at [EMAIL PROTECTED]  **
*
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Troublesome Code.

2005-01-31 Thread Chris Knipe
Lo everyone,
Can someone please perhaps just indicate to me what is wrong with the below 
code?  I am getting SQL Result errors, but all the queries executes 
successfully.

Errors in browser:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 11

Warning: Cannot modify header information - headers already sent by (output 
started at 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php:11) 
in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 28

Warning: Cannot modify header information - headers already sent by (output 
started at 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php:11) 
in 
/usr/local/www/v-webs/O/OUR001/management.ournet.co.za/htdocs/dialupadmin/index.php 
on line 29

Authentication Required.

Below is the code with explanations...

 if (!isset($_SERVER['PHP_AUTH_USER'])) {
   header('WWW-Authenticate: Basic realm="Cenergy Dialup Admin"');
   header('HTTP/1.0 401 Unauthorized');
   WritePageStart("Error - Authentication Required", "", "");
   echo "Authentication Required.";
   WritePageEnd();
   exit;
 } else {
   $SQL = mysql_query("SELECT RadiusAdmin.isWIFI AS isWIFI, 
RadiusAdmin.isPPTP AS isPPTP, RadiusAdmin.isDIAL AS isDIAL, 
RadiusAdmin.MinTokens AS MinTokens, RadiusAdmin.TokenCost AS TokenCost, 
RadiusAdmin.CustID AS CustID, RadiusAdmin.Realm AS Realm, SMTPZones.EntryID 
AS ZoneID, RadiusAdmin.Username AS AccountName, RadiusAdmin.Tokens AS 
Tokens, RadiusAdmin.Balance AS Balance FROM RadiusAdmin LEFT JOIN SMTPZones 
ON RadiusAdmin.Realm=SMTPZones.Zonename  WHERE RadiusAdmin.Username='" . 
$_SERVER['PHP_AUTH_USER'] . "' AND RadiusAdmin.Password=MD5('" . 
$_SERVER['PHP_AUTH_PW'] . "') LIMIT 1");

^^^ Line 10.  Query does execute successfully, and returns 1 Row.
   if (mysql_num_rows($SQL) == 1) {
^^ Line 11 (I also tried == "1" to no avail).
 while ($Data = mysql_fetch_array($SQL)) {
   $_SESSION['Username'] = $_SERVER['PHP_AUTH_USER'];
   $_SESSION['CustID'] = $Data['CustID'];
   $_SESSION['ZoneID'] = $Data['ZoneID'];
   $_SESSION['Realm'] = $Data['Realm'];
   $_SESSION['AccountName'] = $Data['AccountName'];
   $_SESSION['Tokens'] = $Data['Tokens'];
   $_SESSION['TokenCost'] = $Data['TokenCost'];
   $_SESSION['MinTokens'] = $Data['MinTokens'];
   $_SESSION['isDIAL'] = $Data['isDIAL'];
   $_SESSION['isPPTP'] = $Data['isPPTP'];
   $_SESSION['isWIFI'] = $Data['isWIFI'];
   $_SESSION['Balance'] = $Data['Balance'];
 }
 $SQL = mysql_query("UPDATE RadiusAdmin SET LastAccess=NOW() WHERE 
Username='" . $_SERVER['PHP_AUTH_USER'] . "'");
   } else {
 header('WWW-Authenticate: Basic realm="Cenergy Dialup Admin"');
 header('HTTP/1.0 401 Unauthorized');
 This generates the last two errors - hence, my problem is at line 
10 & 11?
 WritePageStart("Error", "", "");
 echo "Authentication Required.";
 WritePageEnd();
 exit;
   }
 }

Thanks,
Chris. 

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


Re: [PHP] Re: Troublesome Code.

2005-01-31 Thread Chris Knipe
Had a fault in some globally included mysql structures... I don't know how 
this happened, but my mysql_select_db seemed to have dissapeared.  Thus 
there was no database initialised, and hence all the queries actually did 
not complete.

I sorted it out - it's all working now :)  Thanks for the suggestions 
everyone.

--
Chris.
- Original Message - 
From: "Mikey" <[EMAIL PROTECTED]>
To: 
Sent: Monday, January 31, 2005 3:15 PM
Subject: RE: [PHP] Re: Troublesome Code.


>if (mysql_num_rows($SQL) == 1) {
Err, this is just the query string variable right? So you need to do:
$sth = mysql_query ($SQL);
If (mysql_num_rows ($sth) == 1)
Then you will be checking the result set and not just the query string.
HTH,
Mikey
--
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


[PHP] Declaring vars as INT ?

2005-10-21 Thread Chris Knipe
Hi,

Uhm... Let's take the below quickly:

Function DoSomething($Blah) {
  $Blah = (int) $Blah;
  return $Blah
} 

$Blah, cannot be larger than 2147483647, and sometimes, I get negative
integers back from the above function.

This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone else perhaps
confirm this, and if it is indeed true, is this a bug, or a limitation
somewhere on PHP?  Any other ways to confirm that *large* numbers, are
indeed integers?  I'm working with numbers in the form of mmddsss
(20051025001 for today for example)

Thanks,
Chris.

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



RE: [PHP] Declaring vars as INT ?

2005-10-21 Thread Chris Knipe
Aha :)

Thanks.
 

> -Original Message-
> From: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
> Sent: 21 October 2005 22:04
> To: [EMAIL PROTECTED]
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Declaring vars as INT ?
> 
> On Fri, 2005-10-21 at 21:39 +0200, Chris Knipe wrote:
> > Function DoSomething($Blah) {
> >   $Blah = (int) $Blah;
> >   return $Blah
> > }
> > 
> > $Blah, cannot be larger than 2147483647, and sometimes, I 
> get negative 
> > integers back from the above function.
> > 
> > This is with PHP 4.4.0 on FreeBSD 5.4-STABLE.  Can anyone 
> else perhaps 
> > confirm this, and if it is indeed true, is this a bug, or a 
> limitation 
> > somewhere on PHP?  Any other ways to confirm that *large* 
> numbers, are 
> > indeed integers?  I'm working with numbers in the form of 
> mmddsss
> > (20051025001 for today for example)
> 
> It's not a PHP bug. I'm guessing you're on a 32-bit platform. 
> 2147483647 is the maximum length of a signed integer on a 
> 32-bit platform, and PHP doesn't do unsigned integers.
> 
> A date in the form of mmddsss etc. isn't really a number, 
> so if it was me I'd probably treat it as a string. If you 
> really *have* to treat it as a number, then use float and get 
> all the precision errors that come with floating-point, or 
> use binary coded decimal or another arbitrary precision system.
> 
> --
> Jasper Bryant-Greene
> General Manager
> Album Limited
> 
> e: [EMAIL PROTECTED]
> w: http://www.album.co.nz/
> p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
> a: PO Box 579, Christchurch 8015, New Zealand
> 
> 

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