RE: [PHP] Problem with functions

2002-12-20 Thread Jon Haworth
Hi,

> I keep getting errors in my script that says 'x' function 
> is undefined or 'y' function is undefined. I defined it as 
> 'function test ($a, $b)' and call it using 'test($a, $b)' 

You need to post code :-)

Try this:

";
echo "a is $a";
echo "b is $b";
  }
  
  test(1, 2);
 
?>

Cheers
Jon

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




Re: [PHP] Problem with functions

2002-12-20 Thread Beauford.2002
Jon,

You may have answered my question, but I'm still confused. I see from your
example that the actual function comes before the function is called in the
script, and when I changed mine to that format it worked.

Now the confusion. I have another script which is the opposite of your
example, and works fine. So why would one work one way but not the other. I
have included the exact format I have for the one that doesn't work, and
below that the actual code of the one that does work. In most languages I
have used, this is the correct format - it makes for easier reading.






- Original Message -
From: "Jon Haworth" <[EMAIL PROTECTED]>
To: "'Beauford.2002'" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Friday, December 20, 2002 11:05 AM
Subject: RE: [PHP] Problem with functions


> Hi,
>
> > I keep getting errors in my script that says 'x' function
> > is undefined or 'y' function is undefined. I defined it as
> > 'function test ($a, $b)' and call it using 'test($a, $b)'
>
> You need to post code :-)
>
> Try this:
>
> 
>   function test ($a, $b)
>   {
> echo "I am the test function";
> echo "a is $a";
> echo "b is $b";
>   }
>
>   test(1, 2);
>
> ?>
>
> Cheers
> Jon
>
> --
> 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] Problem with functions

2002-12-20 Thread Jason Wong
On Saturday 21 December 2002 03:27, Beauford.2002 wrote:
> Jon,
>
> You may have answered my question, but I'm still confused. I see from your
> example that the actual function comes before the function is called in the
> script, and when I changed mine to that format it worked.
>
> Now the confusion. I have another script which is the opposite of your
> example, and works fine. So why would one work one way but not the other. I
> have included the exact format I have for the one that doesn't work, and
> below that the actual code of the one that does work. In most languages I
> have used, this is the correct format - it makes for easier reading.

PHP looks at the whole file before doing anything. So it doesn't matter where 
in the code you define your function. I usually put all my functions at the 
end so they don't get in the way of the main loop.

You must have some other problem. Crank up the error reporting and look at the 
error log.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It's clever, but is it art?
*/


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




Re: [PHP] Problem with Include

2002-12-23 Thread sport4ever
It's PHP problem because I can include any number of files with other
extensions. only PHP which I can not include more than one file at a page...

maybe there is something wrong with php.ini
notice that I faced with this problem just after I upgraded to (PHP 4.2.1),
(Apache2), everything was great before!

- Original Message -
From: "Tom Ray" <[EMAIL PROTECTED]>
To: "sport4ever" <[EMAIL PROTECTED]>
Sent: Tuesday, December 24, 2002 6:03 AM
Subject: Re: [PHP] Problem with Include


> You need to post your code that you are usingthis isn't really a PHP
> problem this is a SSI problem...
>
> sport4ever wrote:
>
> >Hello,
> >my problem is that I can't use more than one SSI INCLUDE in a page
> >
> >Please access this test page to check the problem yourself:
> >http://www.sport4ever.com/test/hello.shtml
> >
> >The first INCLUDE will appear correctly and prints "HELLO World, include
#1" which is the output of "hello.php"
> >
> >Whereas the second INCLUDE won't appear, and instead, it will print the
content (code) of "hello2.php", which is the follwoing:
> >
> >
> >So, it always executes the first include statement perfectly, and doesn't
execute the rest!
> >
> >note: the problem appears only if I include a PHP file, it will execute
it correctly if it's a SHTML or HTML file.
> >
> >PLEASE is there any solution for this strange problem!
> >
> >
> >
> >


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




Re: [PHP] Problem with Include

2002-12-24 Thread Rick Widmer
At 08:04 AM 12/24/02 +0300, sport4ever wrote:


maybe there is something wrong with php.ini
notice that I faced with this problem just after I upgraded to (PHP 4.2.1),
(Apache2), everything was great before!


The last I heard PHP + Apache2 is pretty much experimental, and not 
recommended for production servers.  Unless you plan on working to debug 
the combination of programs, you should be using Apache 1.3 if you want to 
use PHP.

There are a few combinations of versions that work together, but unless you 
are willing to put a lot of extra effort and study into using Apache 2, 
stick with 1.3 until the PHP developers announce Apache 2 support.

Rick


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



Re: [PHP] Problem with Include

2002-12-24 Thread Tom Woody
I have found this to be very true with RedHat 8 (includes Apache2.0.40,
and php 4.2.2).  While RedHat 8.0 isn't really ready for a production
server, apache2 and php definitly are not.  You have to bend over
backwards to get some things working correctly if at all.  Plus there
are still some stability issues with RH 8.

As far as my production servers go apache 1.3 and RH 7.3 for now.

On Tue, 24 Dec 2002 00:02:49 -0700
Rick Widmer <[EMAIL PROTECTED]> wrote:

> At 08:04 AM 12/24/02 +0300, sport4ever wrote:
> 
> >maybe there is something wrong with php.ini
> >notice that I faced with this problem just after I upgraded to (PHP
> >4.2.1),(Apache2), everything was great before!
> 
> The last I heard PHP + Apache2 is pretty much experimental, and not 
> recommended for production servers.  Unless you plan on working to
> debug the combination of programs, you should be using Apache 1.3 if
> you want to use PHP.
> 
> There are a few combinations of versions that work together, but
> unless you are willing to put a lot of extra effort and study into
> using Apache 2, stick with 1.3 until the PHP developers announce
> Apache 2 support.
> 


-- 
Tom Woody
Systems Administrator

Don't throw your computer out the window, 
throw the Windows out of your computer! 


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




Re: [PHP] Problem with Include

2002-12-24 Thread Philip Olson

I've heard that RH8 decided to disable short tags
in their default php.ini  If this is true, the people
at RedHat deserve a good spanking.  Talk about being
irresponsible!

Regards,
Philip


On Tue, 24 Dec 2002, Tom Woody wrote:

> I have found this to be very true with RedHat 8 (includes Apache2.0.40,
> and php 4.2.2).  While RedHat 8.0 isn't really ready for a production
> server, apache2 and php definitly are not.  You have to bend over
> backwards to get some things working correctly if at all.  Plus there
> are still some stability issues with RH 8.
> 
> As far as my production servers go apache 1.3 and RH 7.3 for now.
> 
> On Tue, 24 Dec 2002 00:02:49 -0700
> Rick Widmer <[EMAIL PROTECTED]> wrote:
> 
> > At 08:04 AM 12/24/02 +0300, sport4ever wrote:
> > 
> > >maybe there is something wrong with php.ini
> > >notice that I faced with this problem just after I upgraded to (PHP
> > >4.2.1),(Apache2), everything was great before!
> > 
> > The last I heard PHP + Apache2 is pretty much experimental, and not 
> > recommended for production servers.  Unless you plan on working to
> > debug the combination of programs, you should be using Apache 1.3 if
> > you want to use PHP.
> > 
> > There are a few combinations of versions that work together, but
> > unless you are willing to put a lot of extra effort and study into
> > using Apache 2, stick with 1.3 until the PHP developers announce
> > Apache 2 support.
> > 
> 
> 
> -- 
> Tom Woody
> Systems Administrator
> 
> Don't throw your computer out the window, 
> throw the Windows out of your computer! 
> 
> 
> -- 
> 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] Problem with Include

2002-12-25 Thread sport4ever
Thanks to all whom answered me

while there is no solution for my problem (including more than one PHP file
in a HTML page through SSI) :(
I want to return to my server old configuration, It was:
RedHat Linux 7.3
Apach 1.3
PHP 4.0.1
except PHP, because I have encountered some problems with PHP 4.0.1,
and please tell me what I (exactly) suppose to reinstall (Linux,Apache or
PHP)...

Is there any way to undo my upgrade ( what I call downgrade :-) )?
thanx anyway
__
http://www.sport4ever.net
Administrator of Sport4ever.Net
[EMAIL PROTECTED]

- Original Message -
From: "sport4ever" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Tom Ray" <[EMAIL PROTECTED]>
Sent: Tuesday, December 24, 2002 8:04 AM
Subject: Re: [PHP] Problem with Include


> It's PHP problem because I can include any number of files with other
> extensions. only PHP which I can not include more than one file at a
page...
>
> maybe there is something wrong with php.ini
> notice that I faced with this problem just after I upgraded to (PHP
4.2.1),
> (Apache2), everything was great before!
>
> >
> > sport4ever wrote:
> >
> >Hello,
> >my problem is that I can't use more than one SSI INCLUDE in a page
> >
> >Please access this test page to check the problem yourself:
> >http://www.sport4ever.com/test/hello.shtml
> >
> >The first INCLUDE will appear correctly and prints "HELLO World, include
#1" which is the output of "hello.php"
> >
> >Whereas the second INCLUDE won't appear, and instead, it will print the
content (code) of "hello2.php", which is the follwoing:
> >
> >
> >So, it always executes the first include statement perfectly, and doesn't
> execute the rest!
> >
> >note: the problem appears only if I include a PHP file, it will execute
> it correctly if it's a SHTML or HTML file.
> >
> >PLEASE is there any solution for this strange problem!
> >
> >
> >
> >
>



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




Re: [PHP] Problem with CHMOD

2002-12-30 Thread Chris Garaffa
On Monday, December 30, 2002, at 04:34  PM, Stephen wrote:

I'm running the CHMOD function and I get this error:
 
Warning: chmod() [function.chmod]: Permission denied in 
c:\inetpub\wwwroot\chatness2\admin\save.php on line 13
I'm running IIS 5 which may be causing it. Here's my code:
 
chmod($file, 0666);
$file = $HTTP_GET_VARS['file'].".html";

Hm. It looks like you're trying to chmod a variable that hasn't been 
defined yet. Try switching your statements, so that you have:
$file = $HTTP_GET_VARS['file'].".html";
chmod($file, 0666);

And let us know what happens.


--
Chris Garaffa
<[EMAIL PROTECTED]>
http://moondrop.heli0s.net -- coming whenever heli0s pays his bill
If you give someone a program, you will frustrate them for one day.
If you teach someone how to program, you'll frustrate them for a 
lifetime.


Re: [PHP] Problem with CHMOD

2002-12-30 Thread Stephen
Actually, it is like that. I just copied one part, forgot you'd probably
want the file variable and pasted that but accidently below. I read this:

$file = $HTTP_GET_VARS['file'].".html";
chmod($file, 0666);


- Original Message -
From: "Chris Garaffa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 30, 2002 4:48 PM
Subject: Re: [PHP] Problem with CHMOD


On Monday, December 30, 2002, at 04:34  PM, Stephen wrote:
> I'm running the CHMOD function and I get this error:
>
> Warning: chmod() [function.chmod]: Permission denied in
> c:\inetpub\wwwroot\chatness2\admin\save.php on line 13
> I'm running IIS 5 which may be causing it. Here's my code:
>
> chmod($file, 0666);
> $file = $HTTP_GET_VARS['file'].".html";

Hm. It looks like you're trying to chmod a variable that hasn't been
defined yet. Try switching your statements, so that you have:
$file = $HTTP_GET_VARS['file'].".html";
chmod($file, 0666);

And let us know what happens.


--
Chris Garaffa
<[EMAIL PROTECTED]>
http://moondrop.heli0s.net -- coming whenever heli0s pays his bill
If you give someone a program, you will frustrate them for one day.
If you teach someone how to program, you'll frustrate them for a
lifetime.



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




RE: [PHP] problem with location???

2003-01-08 Thread Timothy Hitchens \(HiTCHO\)
Hmm "language" !!!  languaje

Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Ysrael Guzmán [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, 9 January 2003 12:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] problem with location???
> 
> 
> give a idea please.
>  
> This is correct?
>  
>  
> location.href="page.php?&cliente=$cli";
>  
> 
>  
> 
> Ysrael Guzmán Meza
> 
>  
> 
> -- 
> 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] problem with mail()

2002-08-16 Thread Analysis & Solutions

On Wed, Aug 14, 2002 at 10:04:46AM -0700, Gui Guy wrote:
> 
> ...: SYSERR(nobody): Can't create transcript file ./xfg7E9Jlr03988:
> Permission denied
> : SYSERR(nobody): Cannot create ./dfg7E9Jlr03988: Permission denied
> 
> Does it mean that php is trying to send mail from user nobody?

Good guess!  Sounds like a file permissions thing.  What directory are
those files being created in?  Provide "nobody" with adequate permissions
on that directory.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Problem with mysql_query

2002-08-20 Thread Jeff Lewis

Please disregard, it was a silly problem (I was echoing the SQL query and
editing that, not the main SQL query).

Jeff
- Original Message -
From: "Jeff Lewis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 20, 2002 3:04 PM
Subject: [PHP] Problem with mysql_query


mysql_query is returning an odd error. I don't know if I'm just totally
missing something or not but I keep getting this error:

mySQL Error: You have an error in your SQL syntax near ''LIMIT 25,25'' at
line 1

with this query:

SELECT * FROM dvd_library WHERE genre=BUDGET ORDER BY description ASC LIMIT
25,25

Does anyone else notice what the error is?



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




RE: [PHP] Problem with mysql_query

2002-08-20 Thread Jay Blanchard

[snip]
mySQL Error: You have an error in your SQL syntax near ''LIMIT 25,25'' at
line 1

with this query:

SELECT * FROM dvd_library WHERE genre=BUDGET ORDER BY description ASC LIMIT
25,25
[/snip]

Try

SELECT * FROM dvd_library WHERE genre = 'BUDGET' ORDER BY description ASC
LIMIT 25, 25

Also (I have been seeing this a lot lately and don't know if folks are using
it to shorten up e-mails to this list or if they really do this, so I am
going to say it) it is a performance robbing and potential code buster to
use "SELECT *" where all things are selected from a table(s).

1. On the database side there are performance penalties incurred for not
being more specific in queries as the DBMS must manage each facet of the
table. May not be noticeable on big, high-powered servers until the
connections start to climb the ladder.

2. On the PHP side it makes code much cleaner and easier to document.

HTH!

Jay

***
* Texas PHP Developers Conf  Spring 2003  *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* San Antonio Area PHP Developers Group   *
* Interested? Contact [EMAIL PROTECTED] *
***



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




Re: [PHP] problem with PostgreSQL

2002-08-21 Thread Ray Hunter

Basically,

That is your problem here:

> [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable to
connect to PostgreSQL server: PQconnec
> tPoll() -- connect() failed: Connection refused
> Is the postmaster running (with -i) at '127.0.0.1'
> and accepting connections on TCP/IP port '5901'?

Postgresql needs the postmaster started with the '-i' option...meaning that
it can allow access from TCP/IP connections.  Also you need to verify if
postgresql is listening on port 5901, because its default port is 5432...

I would check both of those and then verify that you can connect from your
ip-address (or network) to the postmaster in the pg_hba.conf file.


--
.: B i g D o g :.


- Original Message -
From: <[EMAIL PROTECTED]>
To: "php-general" <[EMAIL PROTECTED]>
Sent: Wednesday, August 21, 2002 12:33 PM
Subject: [PHP] problem with PostgreSQL


> Can somebody tell me what this mines in my error log
>  I have PostgreSQL compiled in to php so that should not be the problem
> PHP Warning:  Function registration failed - duplicate name - pg_connect
in Unknown on line 0
> PHP Warning:  Function registration failed - duplicate name - pg_pconnect
in Unknown on line 0
> PHP Warning:  Function registration failed - duplicate name - pg_close in
Unknown on line 0
> PHP Warning:  Function registration failed - duplicate name -
pg_connection_status in Unknown on line 0
> PHP Warning:  Function registration failed - duplicate name -
pg_connection_busy in Unknown on line 0
> PHP Warning:  Function registration failed - duplicate name -
pg_connection_reset in Unknown on line
> I am also getting this error
> [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable to
connect to PostgreSQL server: PQconnec
> tPoll() -- connect() failed: Connection refused
> Is the postmaster running (with -i) at '127.0.0.1'
> and accepting connections on TCP/IP port '5901'?
>  in /home/sites/site61/web/util/session_management.phps on line 69
>
>
> --
> Best regards,
>  rdkurth  mailto:[EMAIL PROTECTED]
>
>
> --
> 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] problem with PostgreSQL

2002-08-21 Thread Adam Williams

Just to throw my $.02 in, if you are running an RPM based linux
distribution on your server (such as RedHat), edit your
/etc/rc.d/init.d/postgresql file and look for the code in it:

# Check for postmaster already running...
pid=`pidof -s postmaster`
if [ $pid ]
then
echo $"Postmaster already running."
else
#all systems go -- remove any stale lock files
rm -f /tmp/.s.PGSQL.* > /dev/null
echo -n "$PSQL_START"

If you find that (its under the start section), then immidately after the
"echo -n "$PSQL_START"" change the next line to:

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p /usr/bin/postmaster -o -i 
start  > /dev/null 2>&1" < /dev/null

Adam

On Wed, 21 Aug 2002, Ray Hunter wrote:

> Basically,
>
> That is your problem here:
>
> > [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable to
> connect to PostgreSQL server: PQconnec
> > tPoll() -- connect() failed: Connection refused
> > Is the postmaster running (with -i) at '127.0.0.1'
> > and accepting connections on TCP/IP port '5901'?
>
> Postgresql needs the postmaster started with the '-i' option...meaning that
> it can allow access from TCP/IP connections.  Also you need to verify if
> postgresql is listening on port 5901, because its default port is 5432...
>
> I would check both of those and then verify that you can connect from your
> ip-address (or network) to the postmaster in the pg_hba.conf file.
>
>
> --
> .: B i g D o g :.
>
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: "php-general" <[EMAIL PROTECTED]>
> Sent: Wednesday, August 21, 2002 12:33 PM
> Subject: [PHP] problem with PostgreSQL
>
>
> > Can somebody tell me what this mines in my error log
> >  I have PostgreSQL compiled in to php so that should not be the problem
> > PHP Warning:  Function registration failed - duplicate name - pg_connect
> in Unknown on line 0
> > PHP Warning:  Function registration failed - duplicate name - pg_pconnect
> in Unknown on line 0
> > PHP Warning:  Function registration failed - duplicate name - pg_close in
> Unknown on line 0
> > PHP Warning:  Function registration failed - duplicate name -
> pg_connection_status in Unknown on line 0
> > PHP Warning:  Function registration failed - duplicate name -
> pg_connection_busy in Unknown on line 0
> > PHP Warning:  Function registration failed - duplicate name -
> pg_connection_reset in Unknown on line
> > I am also getting this error
> > [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable to
> connect to PostgreSQL server: PQconnec
> > tPoll() -- connect() failed: Connection refused
> > Is the postmaster running (with -i) at '127.0.0.1'
> > and accepting connections on TCP/IP port '5901'?
> >  in /home/sites/site61/web/util/session_management.phps on line 69
> >
> >
> > --
> > Best regards,
> >  rdkurth  mailto:[EMAIL PROTECTED]
> >
> >
> > --
> > 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] problem with PostgreSQL

2002-08-21 Thread Ray Hunter

Good call on that Adam...

One thing to note is that when you call the postmaster here you are calling
it with the pg_ctl command...so it is beneficial to pass the postmaster
options to the pg_ctl command...like so...

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -o '-i'  -D $PGDATA -p
/usr/bin/postmaster start  >/var/log/pgsql 2>&1" < /dev/null


And for debugging purposes I like to add a file to log all errors and
notices...which has saved me tons of time...I am logging to /var/log/pgsql
file...

Also you can edit the pg_hba.conf file that is located in
/var/lib/pgsql/data/pg_hba.conf for network and ip access...if redhat rpm
installed...



.: B i g D o g :.



- Original Message -
From: "Adam Williams" <[EMAIL PROTECTED]>
To: "Ray Hunter" <[EMAIL PROTECTED]>
Cc: "PHP GEN" <[EMAIL PROTECTED]>; "Richard Kurth"
<[EMAIL PROTECTED]>
Sent: Wednesday, August 21, 2002 12:55 PM
Subject: Re: [PHP] problem with PostgreSQL


> Just to throw my $.02 in, if you are running an RPM based linux
> distribution on your server (such as RedHat), edit your
> /etc/rc.d/init.d/postgresql file and look for the code in it:
>
> # Check for postmaster already running...
> pid=`pidof -s postmaster`
> if [ $pid ]
> then
> echo $"Postmaster already running."
> else
> #all systems go -- remove any stale lock files
> rm -f /tmp/.s.PGSQL.* > /dev/null
> echo -n "$PSQL_START"
>
> If you find that (its under the start section), then immidately after the
> "echo -n "$PSQL_START"" change the next line to:
>
> su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p
/usr/bin/postmaster -o -i start  > /dev/null 2>&1" < /dev/null
>
> Adam
>
> On Wed, 21 Aug 2002, Ray Hunter wrote:
>
> > Basically,
> >
> > That is your problem here:
> >
> > > [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable
to
> > connect to PostgreSQL server: PQconnec
> > > tPoll() -- connect() failed: Connection refused
> > > Is the postmaster running (with -i) at '127.0.0.1'
> > > and accepting connections on TCP/IP port '5901'?
> >
> > Postgresql needs the postmaster started with the '-i' option...meaning
that
> > it can allow access from TCP/IP connections.  Also you need to verify if
> > postgresql is listening on port 5901, because its default port is
5432...
> >
> > I would check both of those and then verify that you can connect from
your
> > ip-address (or network) to the postmaster in the pg_hba.conf file.
> >
> >
> > --
> > .: B i g D o g :.
> >
> >
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > To: "php-general" <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 21, 2002 12:33 PM
> > Subject: [PHP] problem with PostgreSQL
> >
> >
> > > Can somebody tell me what this mines in my error log
> > >  I have PostgreSQL compiled in to php so that should not be the
problem
> > > PHP Warning:  Function registration failed - duplicate name -
pg_connect
> > in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
pg_pconnect
> > in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name - pg_close
in
> > Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
> > pg_connection_status in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
> > pg_connection_busy in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
> > pg_connection_reset in Unknown on line
> > > I am also getting this error
> > > [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable
to
> > connect to PostgreSQL server: PQconnec
> > > tPoll() -- connect() failed: Connection refused
> > > Is the postmaster running (with -i) at '127.0.0.1'
> > > and accepting connections on TCP/IP port '5901'?
> > >  in /home/sites/site61/web/util/session_management.phps on line 69
> > >
> > >
> > > --
> > > Best regards,
> > >  rdkurth  mailto:[EMAIL PROTECTED]
> > >
> > >
> > > --
> > > 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] problem with PostgreSQL

2002-08-21 Thread Ray Hunter

Sorry Adam,

I just realized that you are totally correct...damn brain farts or
something...

excuses my stupidity


--
RAY HUNTER



- Original Message -
From: "Adam Williams" <[EMAIL PROTECTED]>
To: "Ray Hunter" <[EMAIL PROTECTED]>
Cc: "PHP GEN" <[EMAIL PROTECTED]>; "Richard Kurth"
<[EMAIL PROTECTED]>
Sent: Wednesday, August 21, 2002 12:55 PM
Subject: Re: [PHP] problem with PostgreSQL


> Just to throw my $.02 in, if you are running an RPM based linux
> distribution on your server (such as RedHat), edit your
> /etc/rc.d/init.d/postgresql file and look for the code in it:
>
> # Check for postmaster already running...
> pid=`pidof -s postmaster`
> if [ $pid ]
> then
> echo $"Postmaster already running."
> else
> #all systems go -- remove any stale lock files
> rm -f /tmp/.s.PGSQL.* > /dev/null
> echo -n "$PSQL_START"
>
> If you find that (its under the start section), then immidately after the
> "echo -n "$PSQL_START"" change the next line to:
>
> su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl  -D $PGDATA -p
/usr/bin/postmaster -o -i start  > /dev/null 2>&1" < /dev/null
>
> Adam
>
> On Wed, 21 Aug 2002, Ray Hunter wrote:
>
> > Basically,
> >
> > That is your problem here:
> >
> > > [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable
to
> > connect to PostgreSQL server: PQconnec
> > > tPoll() -- connect() failed: Connection refused
> > > Is the postmaster running (with -i) at '127.0.0.1'
> > > and accepting connections on TCP/IP port '5901'?
> >
> > Postgresql needs the postmaster started with the '-i' option...meaning
that
> > it can allow access from TCP/IP connections.  Also you need to verify if
> > postgresql is listening on port 5901, because its default port is
5432...
> >
> > I would check both of those and then verify that you can connect from
your
> > ip-address (or network) to the postmaster in the pg_hba.conf file.
> >
> >
> > --
> > .: B i g D o g :.
> >
> >
> > - Original Message -
> > From: <[EMAIL PROTECTED]>
> > To: "php-general" <[EMAIL PROTECTED]>
> > Sent: Wednesday, August 21, 2002 12:33 PM
> > Subject: [PHP] problem with PostgreSQL
> >
> >
> > > Can somebody tell me what this mines in my error log
> > >  I have PostgreSQL compiled in to php so that should not be the
problem
> > > PHP Warning:  Function registration failed - duplicate name -
pg_connect
> > in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
pg_pconnect
> > in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name - pg_close
in
> > Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
> > pg_connection_status in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
> > pg_connection_busy in Unknown on line 0
> > > PHP Warning:  Function registration failed - duplicate name -
> > pg_connection_reset in Unknown on line
> > > I am also getting this error
> > > [Wed Aug 21 11:06:56 2002] [error] PHP Warning:  pg_pconnect() unable
to
> > connect to PostgreSQL server: PQconnec
> > > tPoll() -- connect() failed: Connection refused
> > > Is the postmaster running (with -i) at '127.0.0.1'
> > > and accepting connections on TCP/IP port '5901'?
> > >  in /home/sites/site61/web/util/session_management.phps on line 69
> > >
> > >
> > > --
> > > Best regards,
> > >  rdkurth  mailto:[EMAIL PROTECTED]
> > >
> > >
> > > --
> > > 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] problem with include

2002-08-30 Thread John Wards

hmm.

It should have nothing to do with cookies unless you are using cookies in
the scripts.

Try using require rather than include to see if that makes any difference

Cheers
John Wards
SportNetwork.net
p.s. your english is as good as mine and i am scottish..
- Original Message -
From: "skitum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 30, 2002 11:53 AM
Subject: [PHP] problem with include


Hi all,

Look at this code:

// one.php

--- html code ---
// end file one.php

// two.php

--- html code ---
//end two.php

well, when I see in my browser www.myweb.com/two.php this shows two.php plus
the include file in it "three.php", so this works ok, but when i see in my
browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php, but
not three.php that is include into two.php

What am I doing wrong?
Could be this because of cookies?

Thanks for help
Peace & Love
skitum

P.S. Forgive my bad english.



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




Re: [PHP] problem with include

2002-08-30 Thread skitum

The same problem with require

- Original Message -
From: "John Wards" <[EMAIL PROTECTED]>
To: "skitum" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 30, 2002 1:02 PM
Subject: Re: [PHP] problem with include


> hmm.
>
> It should have nothing to do with cookies unless you are using cookies in
> the scripts.
>
> Try using require rather than include to see if that makes any difference
>
> Cheers
> John Wards
> SportNetwork.net
> p.s. your english is as good as mine and i am scottish..
> - Original Message -
> From: "skitum" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, August 30, 2002 11:53 AM
> Subject: [PHP] problem with include
>
>
> Hi all,
>
> Look at this code:
>
> // one.php
> 
> --- html code ---
> // end file one.php
>
> // two.php
> 
> --- html code ---
> //end two.php
>
> well, when I see in my browser www.myweb.com/two.php this shows two.php
plus
> the include file in it "three.php", so this works ok, but when i see in my
> browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php,
but
> not three.php that is include into two.php
>
> What am I doing wrong?
> Could be this because of cookies?
>
> Thanks for help
> Peace & Love
> skitum
>
> P.S. Forgive my bad english.
>
>
>
> --
> 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] problem with include

2002-08-30 Thread John Wards

hmmbeyond my scope...but I did the following to test







And it echoed "onetwothree"

must be some setting on your system but what I don't knwo

John
- Original Message -
From: "skitum" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 30, 2002 12:06 PM
Subject: Re: [PHP] problem with include


> The same problem with require
>
> - Original Message -
> From: "John Wards" <[EMAIL PROTECTED]>
> To: "skitum" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, August 30, 2002 1:02 PM
> Subject: Re: [PHP] problem with include
>
>
> > hmm.
> >
> > It should have nothing to do with cookies unless you are using cookies
in
> > the scripts.
> >
> > Try using require rather than include to see if that makes any
difference
> >
> > Cheers
> > John Wards
> > SportNetwork.net
> > p.s. your english is as good as mine and i am scottish..
> > - Original Message -
> > From: "skitum" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, August 30, 2002 11:53 AM
> > Subject: [PHP] problem with include
> >
> >
> > Hi all,
> >
> > Look at this code:
> >
> > // one.php
> > 
> > --- html code ---
> > // end file one.php
> >
> > // two.php
> > 
> > --- html code ---
> > //end two.php
> >
> > well, when I see in my browser www.myweb.com/two.php this shows two.php
> plus
> > the include file in it "three.php", so this works ok, but when i see in
my
> > browser (IE 6.0) www.myweb.com/one.php this shows one.php plus two.php,
> but
> > not three.php that is include into two.php
> >
> > What am I doing wrong?
> > Could be this because of cookies?
> >
> > Thanks for help
> > Peace & Love
> > skitum
> >
> > P.S. Forgive my bad english.
> >
> >
> >
> > --
> > 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] Problem with REMOTE_ADDR

2002-09-17 Thread Krzysztof Dziekiewicz

> Whenever I use REMOTE_ADDR, it gives me the IP of the server. Of course, I
> am not interested in this and want the IP of the client. I put this code in 
> to resolve it and it still didnt work. What am I doing wrong?

Try HTTP_CLIENT_IP. It is set in some situations.


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




Re: [PHP] Problem uploading files

2002-10-04 Thread Justin French

A few observations:

if ($formfile == "none")
{
echo "There is no file to send";
exit;
}

for starters, I don't see how $formfile could ever be "none"... secondly, if
you have register_globals set to off in your php.ini, $formfile wont' even
be a variable, but you've only sent what looks like partial code, so I can't
be sure.


Can I recommend you try to get the perfectly good, working example of file
uploads working that is available on this page:

http://www.php.net/manual/en/printwn/features.file-upload.php


Once you get it working, you can tweak it to suit your needs, rather than
reinventing the wheel over and over... just improve on it.


Justin






on 05/10/02 2:04 AM, Wilmar Perez ([EMAIL PROTECTED]) wrote:

> Hello guys
> 
> This is my first post to the list, hope you can give point me to the right
> direction.
> 
> Well, I've been trying to upload a file without much success so far.
> 
> All I get is my firs error message: "There is no file to send" (shown in the
> script).
> 
> This is my form:
> 
>  action=".$PHP_SELF."?management=5>
> 
> 
>  
> Book Name:
> 
> 
>  
> File:
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> And this is the script that handles the data:
> 
> 
> if ($formfile == "none")
> {
> echo "There is no file to send";
> exit;
> }
> 
> if ($formfile_size == 0)
> {
> echo "Bad file size";
> exit;
> }
> 
> if ($formfile_type != "application/pdf")
> {
> echo "Non a PDF file";
> exit;
> }
> 
> if (!is_uploaded_file($formfile))
> {
> echo "Warning!!!";
> exit;
> }
> 
> $upfile = "/var/www/bva/new/pdf/".$formfile_name;
> 
> 
> if (!copy($formfile, $upfile))
> {
> echo "There was a problem moving the file to the repository";
> exit;
> }
> else
> {
> echo "New book has been uploaded";
> exit;
> }
> 
> 
> 
> 
> Thanks a lot for your help.
> 
> 
> ***
> Wilmar Pérez
> Network Administrator
> Library System
> Tel: ++57(4)2105145
> University of Antioquia
> Medellín - Colombia
> 2002
> ***
> 
> 


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




Re: [PHP] Problem uploading files

2002-10-04 Thread Wilmar Perez

Hello

Justin, thanks for your comments.  Well just to answer your questions:

1.  I've got register_globals set to ON.  I have never had problem before 
with my forms, but this is the first time I try to upload a file.

2.  I'm following the sample code you recommend.  They're in fact pretty 
simmilar .

Thanks a lot again.

***
 Wilmar Pérez
 Network Administrator
   Library System
  Tel: ++57(4)2105145
University of Antioquia
   Medellín - Colombia
  2002
***
 
 

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




Re: [PHP] problem with informix

2002-10-21 Thread Adam Williams
I'd go back to apache 1.3.27 and php-4.2.3 if I were you and see if that
fixes your problem.

I run Informix, PHP, and Apache on a server and have had no problems.

Adam

On Mon, 21 Oct 2002, Erwin Speybroeck wrote:

> Hi,
>
> I'm struggling with a problem for quite some time.
> I have a webserver with apache-1.3.22, php 4.0.6 (patched for some security issues), 
>informix ESQL 9.30 and a databaseserver with Informix IDS 7.31. This construction 
>works very fine.
>
> As soon as i go to newer versions --> last try : httpd-2.0.43, php-4.2.3, with the 
>same informix configuration the problem appears. Everything went well for about a 
>week --> so it lloks ok, but ...
>
> On the databaseserver shared memory gets taken by the php-actions on the webserver 
>and at a certain moment this memory is all used and the server (database) crashes.
>
> Is there somebody who has experienced a similar problem or is there somebody who can 
>give some hints in the direction to look for ???
>
> Thanks in advance,
>
> Erwin Speybroeck
> [EMAIL PROTECTED]
> Neem eens een kijkje op onze website --> www.vrv.be
>


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




Re: [PHP] problem loading extension

2002-10-29 Thread Marek Kilimajer
don't know much about windows, but isn't the problem in the "./" part? 
Can you remove it?

Simon Taylor wrote:

Hi All,
I have just been trying to add some more extensions to my site, I have
copied the dll's for the extensions I wish to add to my extensions dir and
uncommented them in my php.ini.
This worked fine for all of them which include ctype, gd etc. , except for
the xslt extension which will just not work for me... I am getting this
message.
PHP Warning: Unable to load dynamic library 'C:\PHP\dll\./php_xslt.dll' -
The specified module could not be found. in Unknown on line 0 
The file is most definitely there and if I move one of the other extension
files I get the same message for them, not sure what I am doing wrong.
Any ideas appreciated.
Thanks
_
Simon Taylor
AfriTol (Pty) Ltd.

 



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




Re: [PHP] problem loading extension

2002-10-29 Thread Frank W.
there should be something like:
   extension_dir = "C:\PHP\extensions"
in your php.ini


Simon Taylor wrote:

> Hi All,
> I have just been trying to add some more extensions to my site, I have
> copied the dll's for the extensions I wish to add to my extensions 
dir and
> uncommented them in my php.ini.
> This worked fine for all of them which include ctype, gd etc. , 
except for
> the xslt extension which will just not work for me... I am getting this
> message.
> PHP Warning: Unable to load dynamic library 'C:\PHP\dll\./php_xslt.dll' -
> The specified module could not be found. in Unknown on line 0
> The file is most definitely there and if I move one of the other 
extension
> files I get the same message for them, not sure what I am doing wrong.
> Any ideas appreciated.
> Thanks
> _
> Simon Taylor
> AfriTol (Pty) Ltd.
>



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



Re: [PHP] Problem with 4.2.3?

2002-11-01 Thread Jason Wong
On Saturday 02 November 2002 06:16, Adam Humphrey wrote:
> I just upgraded my PHP from 4.2.2 to 4.2.3 and now I have a problem.  Right
> now I have some HTML with included PHP.  When the client opens a page with
> PHP and HTML it used to (under 4.2.2) display all the HTML before the PHP
> and then process the PHP and finally (when processing completed) finish the
> rest of the HTML.
>
> This allowed my to do some DHTML to let the user know that the PHP was
> processing.  Now with the new version of PHP (4.2.3) when I hit these pages
> it will process the PHP before it sends any HTML to the client.
>
> This is really frustrating.  Is there some setting in php.ini that I can
> modify to allow the browser to get the HTML before the PHP code?  Or any
> other way to get the old behavior?

Try disabling output buffering (php.ini).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You can fool some of the people some of the time,
and some of the people all of the time,
and that is sufficient.
*/


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




Re: [PHP] Problem with 4.2.3?

2002-11-02 Thread Adam
output buffering = off

This is already set to "off"

Any other suggestions?

-Adam

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:200211021451.44280.php-general@;gremlins.com.hk...
> On Saturday 02 November 2002 06:16, Adam Humphrey wrote:
> > I just upgraded my PHP from 4.2.2 to 4.2.3 and now I have a problem.
Right
> > now I have some HTML with included PHP.  When the client opens a page
with
> > PHP and HTML it used to (under 4.2.2) display all the HTML before the
PHP
> > and then process the PHP and finally (when processing completed) finish
the
> > rest of the HTML.
> >
> > This allowed my to do some DHTML to let the user know that the PHP was
> > processing.  Now with the new version of PHP (4.2.3) when I hit these
pages
> > it will process the PHP before it sends any HTML to the client.
> >
> > This is really frustrating.  Is there some setting in php.ini that I can
> > modify to allow the browser to get the HTML before the PHP code?  Or any
> > other way to get the old behavior?
>
> Try disabling output buffering (php.ini).
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> You can fool some of the people some of the time,
> and some of the people all of the time,
> and that is sufficient.
> */
>



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




Re: [PHP] Problem with fopen()

2002-04-30 Thread Miguel Cruz

On Tue, 30 Apr 2002, Ben Turner wrote:
> I am trying to complete an email application which will send messages to
> lists. Problem is, I am trying to write the messages out so that they will
> be available to a server application which actually sends the messages and
> does all the dirty work but I am getting the error that I cannot create the
> file in the directory.  I have tried chmod and chown on the directory but
> nothing is working for me.  I have even gone so far as to make the owner of
> the directory apache and the group of the directory apache but no luck.
> 
> I am asking this question here because I thought someone out there might be
> able to give me some insight on how they solved a problem like this on their
> servers Help!

Is the directory buried inside any directories that the Apache user 
doesn't have 'x' rights on?

miguel


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




Re: [PHP] Problem with array

2002-04-30 Thread Richard Emery

show the form.

- Original Message -
From: Carlos Fernando Scheidecker Antunes <[EMAIL PROTECTED]>
To: PHP-GENERAL <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 10:11 AM
Subject: [PHP] Problem with array


Hello All,

I've got a form that creates checkboxes based on the number of rows on a
table. The user has to check some of the boxes and then click submit. The
boxes are named RG1, RG2, RG3, 

If there are 4 checkboxes and the user selects them all or selects the
first, second and fourth, or the first third and fourth my code works. But
if the user selects the second, third and fourth (He does not checks the
first one) no information is recorded on my array.

Here's the code that I have to search the $HTTP_POST_VARS and then fill a
array variable called $RG.


function SearchRGs() {
global $HTTP_POST_VARS;
global $RGs;

// fills the array variable RGs with the values of checked checkboxes
that start with the name RG# (where # goes from 1,2,3,).
   // returns the qty of checked RGs and size of the $RGs array.

$index = count($HTTP_POST_VARS);
$count = 0;

for ($i=1; $i < $index; $i++) {
if (isset($HTTP_POST_VARS["RG$i"])) {
$RGs[] = $HTTP_POST_VARS["RG$i"];
$count++;
}
}

return $count;

}


Can anyone help me with this?

Why if I do not check the first checkbox on the form the array  is not
filled.

Thank you,

Carlos Fernando.



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




Re: [PHP] problem with fread

2002-05-07 Thread Dan Hardiker

> i have a question about the fread() function.
> i want to read data from a webserver url, which i don't know the exact
> size of, i only know that it varies.

You dont actually give the size of the file, you give the size of the block
you want to pull. For example:

http://whatever.com/file.html";; // whatever you wanna pull from

  if ($fp = fopen($url, "r")) {
while ($tmp = fget($fp, 4096)) $output .= $tmp;
fclose($fp);
  }

  echo "The URL's content is: ".$output;
?>

The "4096" part just means it will pull from the file pointer ($fp) in 4096
byte blocks (or chunks), and the while will keep pulling the chunks until
there is nothing left to pull.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer
First Creative Ltd



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




Re: [PHP] problem with fread

2002-05-07 Thread Henning Sprang

>$output = ""; // Clear output
>   $url = "http://whatever.com/file.html";; // whatever you wanna pull from
> 
>   if ($fp = fopen($url, "r")) {
> while ($tmp = fget($fp, 4096)) $output .= $tmp;
> fclose($fp);
>   }
> 
>   echo "The URL's content is: ".$output;
> ?>

erm, don't wanna be nosy, but you meant fgets() - forgot the "s" - didn't
you?

just for others who read that one...

anyway, so it's safe and clean to use this one.

thank you very much!

henning


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




Re: [PHP] problem with fread

2002-05-07 Thread Dan Hardiker

> erm, don't wanna be nosy, but you meant fgets() - forgot the "s" -
> didn't you?

Yes I did (early-morning-itis I guess heh). Thanks for the typo
correction ;)

Ammended code is as follows:

>> >   $output = ""; // Clear output
>>   $url = "http://whatever.com/file.html";; // whatever you wanna pull
>>   from
>>
>>   if ($fp = fopen($url, "r")) {
>> while ($tmp = fgets($fp, 4096)) $output .= $tmp;
>> fclose($fp);
>>   }
>>
>>   echo "The URL's content is: ".$output;
>> ?>

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer
First Creative Ltd



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




Re: [PHP] Problem with object

2002-05-10 Thread Dan Hardiker

> Now I want to resolve the hostname from ip adresses:
> foreach ($aLines as $entry)
> { if ($entry->host == "")
>$entry->host = "Teststring";
>   print $entry->host."\n"; // prints "Teststring"
> }
>
> // Testoutput
> foreach ($aLines as $entry)
> { print $entry->host."\n"; // prints empty string!
> }
>
> Why is host in the second loop empty again?

Foreach returns a COPY of the contents... if you want to modify the
contents use the key... eg:
foreach ($aLines as $key=>$entry) {
  if ($aLines[$key]->host == "") $aLines[$key]->host = "Teststring";
  print $aLines[$key]->host."\n"; // prints "Teststring"
}

That way your altering the master array and not the copy

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



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




Re: [PHP] Problem on fread!

2002-05-13 Thread Jason Wong

On Tuesday 14 May 2002 13:56, Jack wrote:
> Dear all
> I had a problem with fread function!
> I had a text file containning a date, so inside the text file, it was
> something look like this : 05032002
> then now i want to read this file but want to seperate the dd -mm-, so
> i want to get the first two digit as the (day), then nex two as the (month)
> and last four as (year) to display in my "INPUT BOX".
>
> How i can read a file by telling it how much digit i want?

fread() allows you to specify how many bytes you want to read.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Never underestimate the bandwidth of a station wagon full of tapes.
-- Dr. Warren Jackson, Director, UTCS
*/


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




Re: [PHP] Problem on fread!

2002-05-14 Thread Miguel Cruz

On Tue, 14 May 2002, Jack wrote:
> I had a problem with fread function!
> I had a text file containning a date, so inside the text file, it was
> something look like this : 05032002
> then now i want to read this file but want to seperate the dd -mm-, so i
> want to get the first two digit as the (day), then nex two as the (month)
> and last four as (year) to display in my "INPUT BOX".
> 
> How i can read a file by telling it how much digit i want?

Just read the whole date and use functions like substr() to break it apart
afterwards. Much easiest and faster than trying to read little bits at a
time from the file.

miguel


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




Re: [PHP] Problem with mktime()

2002-05-20 Thread Dan Hardiker

> $startDate['Jungfrau'] = mktime (0, 0, 0, 08, 24, 2000);
> $startDate['Waage']= mktime (0, 0, 0, 09, 24, 2000);

Replace 08 and 09 with 8 and 9 respectivly and you will have the effect
you desire.
-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer



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




Re: [PHP] Problem with mktime()

2002-05-20 Thread Rasmus Lerdorf

08 and 09 are not real numbers.  Any number starting with a 0 is an octal
number which means you can only use digits 0-7

Drop the leading 0 and everything will work.

-Rasmus

On Mon, 20 May 2002, Johannes Tyra [BrainData] wrote:

> Hi,
>
> I want to read out the asterisk from a birthdate.
>
> First off all I need the timestamp:
>
>   $startDate['Steinbock'] = mktime (0, 0, 0, 12, 22,
> 1999);
>   $startDate['Wassermann']= mktime (0, 0, 0, 01, 21,
> 2000);
>   $startDate['Fisch'] = mktime (0, 0, 0, 02, 21,
> 2000);
>   $startDate['Widder']= mktime (0, 0, 0, 03, 21,
> 2000);
>   $startDate['Stier'] = mktime (0, 0, 0, 04, 21,
> 2000);
>   $startDate['Zwilling']  = mktime (0, 0, 0, 05, 21,
> 2000);
>   $startDate['Krebs'] = mktime (0, 0, 0, 06, 22,
> 2000);
>   $startDate['Löwe']  = mktime (0, 0, 0, 07, 23,
> 2000);
>   $startDate['Jungfrau']  = mktime (0, 0, 0, 08, 24,
> 2000);
>   $startDate['Waage'] = mktime (0, 0, 0, 09, 24,
> 2000);
>   $startDate['Skorpion']  = mktime (0, 0, 0, 10, 24,
> 2000);
>   $startDate['Schütze']   = mktime (0, 0, 0, 11, 23,
> 2000);
>   $startDate['Steinbock2']= mktime (0, 0, 0, 12, 22,
> 2000);
>
> but with 'Jungfrau' AND 'Waage' something is wrong!!
>
> if I want to debug this lines with:
>
>   echo date("m - Y",$startDate['Steinbock'])."";
>   echo date("m - Y",$startDate['Wassermann'])."";
>   echo date("m - Y",$startDate['Fisch'])."";
>   echo date("m - Y",$startDate['Widder'])."";
>   echo date("m - Y",$startDate['Stier'])."";
>   echo date("m - Y",$startDate['Zwilling'])."";
>   echo date("m - Y",$startDate['Krebs'])."";
>   echo date("m - Y",$startDate['Löwe'])."";
>   echo date("m - Y",$startDate['Jungfrau'])."";
>   echo date("m - Y",$startDate['Waage'])."";
>   echo date("m - Y",$startDate['Skorpion'])."";
>   echo date("m - Y",$startDate['Schütze'])."";
>   echo date("m - Y",$startDate['Steinbock2'])."";
>
> to read out the month and year of the asterisks PHP returns:
>
> 12 - 1999
> 01 - 2000
> 02 - 2000
> 03 - 2000
> 04 - 2000
> 05 - 2000
> 06 - 2000
> 07 - 2000
> 12 - 1999  error
> 12 - 1999  error
> 10 - 2000
> 11 - 2000
> 12 - 2000
>
> all other asterisks are ok...
>
> Does anyone know how to fix it??
> Or is it a bug??
> Anyone knows a better idea to get the asterisk from a given date???
>
> Thanx...
>
> --
> Mit freundlichem Gruß,
> Johannes Tyra
>
>
> --
> 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] Problem with MySQL

2002-06-14 Thread Tyler Longren

you need to put your $myrow in a while loop:

while ($myrow = mysql_fetch_array($result)) {

$title = $myrow[title];
$videoid = $myrow[videoid];
$catergory = $myrow[catergory];
$appraisal = $myrow[appraisal];

// blah blah blah everything else
}

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

- Original Message - 
From: "Chuck Payne" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, June 14, 2002 11:03 PM
Subject: [PHP] Problem with MySQL


Hi,

I am working on a movie database I have two database that I am calling from
but the problem I am having when I ask it to go and fetch all the movies
with the same title, it stops and only shows one.

Here is a basic layout...

if($videoid) {

 $result = mysql_query("SELECT * FROM library WHERE videoid=$videoid",$db);

 $myrow = mysql_fetch_array($result);

// The Myrows

$title = $myrow[title];
$videoid = $myrow[videoid];
$catergory = $myrow[catergory];
$appraisal = $myrow[appraisal];

// Some where here it's not working.

 $sql = "SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
title = '$title' ORDER by lname";
$result = mysql_query($sql);
 print $sql;

$actor = "";
while ($myrow = mysql_fetch_array($result)) {
  $actor = $myrow[actor];
  $actor .= "" . $actor . "\n";

}

What am I doing wrong? It only show one record and it show more.

Chuck Payne




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




Re: [PHP] Problem with MySQL

2002-06-14 Thread Chuck \"PUP\" Payne

Ok. Go to this link...

http://www.magidesign.com/movielist.php and select "12 Monkeys" You will see
that only picked one actor...

It should have pick four

mysql> SELECT concat_ws(" ", fname, lname) as actor FROM actormovie WHERE
title = "12 Monkeys" ORDER BY lname;
+-+
| actor   |
+-+
| Brad Pitt   |
| Christopher Plummer |
| Madeleine Stowe |
| Bruce Willis|
+-+
4 rows in set (0.01 sec)

I know that the problem is some where in this statement...

$sql = "SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
title = '$title' ORDER by lname";

$result = mysql_query($sql);

 
$actor = "";
while ($myrow = mysql_fetch_array($result)) {
$actor = $myrow[actor];
$actor .= "" . $actor . "\n";
 
}


Only thing is I am brain dead and can't see it...

Thanks for the help...

Chuck

On 6/15/02 12:10 AM, "Tyler Longren" <[EMAIL PROTECTED]> wrote:

> you need to put your $myrow in a while loop:
> 
> while ($myrow = mysql_fetch_array($result)) {
> 
> $title = $myrow[title];
> $videoid = $myrow[videoid];
> $catergory = $myrow[catergory];
> $appraisal = $myrow[appraisal];
> 
> // blah blah blah everything else
> }
> 
> Tyler Longren
> Captain Jack Communications
> www.captainjack.com
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "Chuck Payne" <[EMAIL PROTECTED]>
> To: "PHP General" <[EMAIL PROTECTED]>
> Sent: Friday, June 14, 2002 11:03 PM
> Subject: [PHP] Problem with MySQL
> 
> 
> Hi,
> 
> I am working on a movie database I have two database that I am calling from
> but the problem I am having when I ask it to go and fetch all the movies
> with the same title, it stops and only shows one.
> 
> Here is a basic layout...
> 
> if($videoid) {
> 
> $result = mysql_query("SELECT * FROM library WHERE videoid=$videoid",$db);
> 
> $myrow = mysql_fetch_array($result);
> 
> // The Myrows
> 
> $title = $myrow[title];
> $videoid = $myrow[videoid];
> $catergory = $myrow[catergory];
> $appraisal = $myrow[appraisal];
> 
> // Some where here it's not working.
> 
> $sql = "SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE
> title = '$title' ORDER by lname";
>   $result = mysql_query($sql);
> print $sql;
> 
>   $actor = "";
>   while ($myrow = mysql_fetch_array($result)) {
> $actor = $myrow[actor];
> $actor .= "" . $actor . "\n";
> 
> }
> 
> What am I doing wrong? It only show one record and it show more.
> 
> Chuck Payne
> 
> 
> 


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




Re: [PHP] problem while loop.

2002-02-24 Thread Steven Walker

Jeff,

The problem is most likely with incrementing $event_data. It's hard to 
say without seeing the rest of the code.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]

> I have a problem while loop that isn't terminating when it's supposed
> to.  I can't figure out what the problem is, if I run a comparison
> inside the while loop it matches as it should, but for some reason the
> same comparison isn't working as the while loop expression. I get an
> infinite loop when I run this code.
>
> while(strtotime($event_date) <= strtotime($end_date)){
>   # test to see if the loop should of stopped.
>   if(strtotime($event_date) <= strtotime($end_date))
>   echo "GO!!\n";
>   else echo "STOP!!!\n";
>
>   /* omitted code that finds the next $event_date */
> }
>
>
>
>
> --
> Jeff Bearer, RHCE
> Webmaster
> PittsburghLIVE.com
> 2002 EPpy Award, Best Online U.S. Newspaper
>
> --
> 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] problem while loop.

2002-02-24 Thread Jeff Bearer

It's all returning proper dates and the proper timestamps when I check
them inside the loop.  I'm formatting the dates in -MM-DD format and
strtotime is returning the proper timestamps.  I'm curious how can you
say it's a problem with the dates when the if statement comparing the
same expression as the while loop works properly?



On Sun, 2002-02-24 at 13:09, Steven Walker wrote:
> Jeff,
> 
> The problem is most likely with incrementing $event_data. It's hard to 
> say without seeing the rest of the code.
> 
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> [EMAIL PROTECTED]
> 
> > I have a problem while loop that isn't terminating when it's supposed
> > to.  I can't figure out what the problem is, if I run a comparison
> > inside the while loop it matches as it should, but for some reason the
> > same comparison isn't working as the while loop expression. I get an
> > infinite loop when I run this code.
> >
> > while(strtotime($event_date) <= strtotime($end_date)){
> > # test to see if the loop should of stopped.
> > if(strtotime($event_date) <= strtotime($end_date))
> > echo "GO!!\n";
> > else echo "STOP!!!\n";
> >
> > /* omitted code that finds the next $event_date */
> > }
> >
> >
> >
> >
> > --
> > Jeff Bearer, RHCE
> > Webmaster
> > PittsburghLIVE.com
> > 2002 EPpy Award, Best Online U.S. Newspaper
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
-- 
Jeff Bearer, RHCE
Webmaster
PittsburghLIVE.com
2002 EPpy Award, Best Online U.S. Newspaper

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




Re: [PHP] problem while loop.

2002-02-24 Thread Steven Walker

Jeff,

Everything you are doing sounds fine, and I don't see any logic problems 
with the while loop. However, I really can't extrapolate any further 
conclusion without more info. How are you determining that the if 
statement is working? As long as this loop is running it should always 
echo 'GO!!'.

Steven J. Walker
Walker Effects
www.walkereffects.com
[EMAIL PROTECTED]


On Sunday, February 24, 2002, at 03:00  PM, Jeff Bearer wrote:

> It's all returning proper dates and the proper timestamps when I check
> them inside the loop.  I'm formatting the dates in -MM-DD format and
> strtotime is returning the proper timestamps.  I'm curious how can you
> say it's a problem with the dates when the if statement comparing the
> same expression as the while loop works properly?
>
>
>
> On Sun, 2002-02-24 at 13:09, Steven Walker wrote:
>> Jeff,
>>
>> The problem is most likely with incrementing $event_data. It's hard to
>> say without seeing the rest of the code.
>>
>>
>>> I have a problem while loop that isn't terminating when it's supposed
>>> to.  I can't figure out what the problem is, if I run a comparison
>>> inside the while loop it matches as it should, but for some reason the
>>> same comparison isn't working as the while loop expression. I get an
>>> infinite loop when I run this code.
>>>
>>> while(strtotime($event_date) <= strtotime($end_date)){
>>> # test to see if the loop should of stopped.
>>> if(strtotime($event_date) <= strtotime($end_date))
>>> echo "GO!!\n";
>>> else echo "STOP!!!\n";
>>>
>>> /* omitted code that finds the next $event_date */
>>> }
>>>
>>>
>>>
>>>
>>> --
>>> Jeff Bearer, RHCE
>>> Webmaster
>>> PittsburghLIVE.com
>>> 2002 EPpy Award, Best Online U.S. Newspaper
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
> --
> Jeff Bearer, RHCE
> Webmaster
> PittsburghLIVE.com
> 2002 EPpy Award, Best Online U.S. Newspaper
>
> --
> 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] problem while loop.

2002-02-24 Thread Jeff Bearer

Well, I found the problem. it wasn't happening where I thought it was.
which brings up another question I'll have to ask in a new subject about
output buffering.

On Sun, 2002-02-24 at 18:00, Jeff Bearer wrote:
> It's all returning proper dates and the proper timestamps when I check
> them inside the loop.  I'm formatting the dates in -MM-DD format and
> strtotime is returning the proper timestamps.  I'm curious how can you
> say it's a problem with the dates when the if statement comparing the
> same expression as the while loop works properly?
> 
> 
> 
> On Sun, 2002-02-24 at 13:09, Steven Walker wrote:
> > Jeff,
> > 
> > The problem is most likely with incrementing $event_data. It's hard to 
> > say without seeing the rest of the code.
> > 
> > Steven J. Walker
> > Walker Effects
> > www.walkereffects.com
> > [EMAIL PROTECTED]
> > 
> > > I have a problem while loop that isn't terminating when it's supposed
> > > to.  I can't figure out what the problem is, if I run a comparison
> > > inside the while loop it matches as it should, but for some reason the
> > > same comparison isn't working as the while loop expression. I get an
> > > infinite loop when I run this code.
> > >
> > > while(strtotime($event_date) <= strtotime($end_date)){
> > >   # test to see if the loop should of stopped.
> > >   if(strtotime($event_date) <= strtotime($end_date))
> > >   echo "GO!!\n";
> > >   else echo "STOP!!!\n";
> > >
> > >   /* omitted code that finds the next $event_date */
> > > }
> > >
> > >
> > >
> > >
> > > --
> > > Jeff Bearer, RHCE
> > > Webmaster
> > > PittsburghLIVE.com
> > > 2002 EPpy Award, Best Online U.S. Newspaper
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > 
> -- 
> Jeff Bearer, RHCE
> Webmaster
> PittsburghLIVE.com
> 2002 EPpy Award, Best Online U.S. Newspaper
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
Jeff Bearer, RHCE
Webmaster
PittsburghLIVE.com
2002 EPpy Award, Best Online U.S. Newspaper

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




Re: [PHP] Problem with MSSQL

2002-03-08 Thread Joshua Hoover

Check your "php.ini" file in your C:\WINNT directory.  Make sure that you
have php_mssql.dll extension uncommented in your php.ini file.  Then check
to see where the php.ini is looking for the extensions.  If you installed
PHP in C:\PHP, then the line for extension_dir in your php.ini file would
be: extension_dir = C:/PHP/extensions

Once you have all that checked, then I would go to a command prompt and get
into the PHP directory.  From the PHP directory, run the command: php -i and
see if any error dialog boxes appear.  If you get errors, then it's most
likely telling you that it can't find the appropriate dll files used to
connect to SQL Server.  To remedy this you can add the following to your
Windows PATH variable: C:\PHP\dlls;   This, again, is assuming you have PHP
installed on C:\

Hope that gets you pointed in the right direction.

Joshua Hoover

- Original Message -
From: "pong-TC" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 08, 2002 5:17 PM
Subject: [PHP] Problem with MSSQL


> Hello All
>
> I just reinstalled PHP 4.1.1 on IIS5 (win2000) over the old version by
> using the installer.  I installed as a cgi.  Then, I got problems with
> mssql_connect function.  It doesn't work as it did before.  Here is the
> error message:
>
> Fatal error: Call to undefined function: mssql_connect() in
> d:\inetpub\wwwroot\cgi-bin\Submitted.php on line 25
>
> It is my mistake that I reinstalled without realization.  So, I got a
> trouble.  Anyone, please help.
>
> Thank you.
> Pong
>
>
> --
> 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] problem with getdate()

2002-03-11 Thread Jason Wong

On Monday 11 March 2002 23:31, Joshua E Minnie wrote:
> I am having a problem with the getdate() function.  I don't understand why
> I am getting the output that it is giving me.  Here is the code:

> $day = $timevaild_["mday"];

Typo!



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Nobody can be as agreeable as an uninvited guest.
*/

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




Re: [PHP] Problem with sessions.

2002-03-16 Thread Tom Rogers

Hi
When you create the new session give it a different name.
Tom

At 01:49 AM 17/03/2002, Carlos Costa Portela wrote:
> Hello all:
>
> I am playing with sessions and I have a problem with the
>session_destroy() function. If I do a session_register() after calling it,
>the session recover the previous values (values that I supposed forgot by
>the session).
>
> At
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
>have the web page and the code, respectively.
>
> The problem is that the "counter" variable maintains the value
>even after click "logout".
>
> If you go to the web page, press:
>
>login -> counter=0
>other link -> counter=1
>other link -> counter=2
>other link -> counter=3
>logout
>other link -> counter=4
>
> I suppose that the problem is that I call
>session_register("counter"). How must I solve this problem?
>
> Best regards and thanks in advance,
> Carlos.
>
> [ all about php+web : http://www.improveyourweb.com ]
>
>  ___Carlos Costa Portela_
>| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
>|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|
>
>
>--
>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] Problem with sessions.

2002-03-16 Thread Edward van Bilderbeek - Bean IT

maybe you better use:

session_unregister("counter");

Greets,
Edward


- Original Message -
From: "Carlos Costa Portela" <[EMAIL PROTECTED]>
To: "php-general mailing list" <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 4:49 PM
Subject: [PHP] Problem with sessions.


> Hello all:
>
> I am playing with sessions and I have a problem with the
> session_destroy() function. If I do a session_register() after calling it,
> the session recover the previous values (values that I supposed forgot by
> the session).
>
> At
> http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
> http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
> have the web page and the code, respectively.
>
> The problem is that the "counter" variable maintains the value
> even after click "logout".
>
> If you go to the web page, press:
>
> login -> counter=0
> other link -> counter=1
> other link -> counter=2
> other link -> counter=3
> logout
> other link -> counter=4
>
> I suppose that the problem is that I call
> session_register("counter"). How must I solve this problem?
>
> Best regards and thanks in advance,
> Carlos.
>
> [ all about php+web : http://www.improveyourweb.com ]
>
>  ___Carlos Costa
Portela_
> | e-mail:  [EMAIL PROTECTED] | home page:
http://casa.ccp.servidores.net |
> |_Tódalas persoas maiores foron nenos antes, pero poucas se
lembran__|
>
>
> --
> 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] Problem with sessions.

2002-03-17 Thread Carlos Costa Portela

On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote:

> maybe you better use:
>
> session_unregister("counter");
>

I've put that, but it doesn't run. As you can see in the URLs
below, my code is:

if ($id == "logout") { // the user wants logout :(
session_unregister("counter");
  }
  else { // user is navigating through our links
session_register("counter"); // why I recover the previous value here,
// even I've clicked logout?
$counter++;
print "counter: $counter\n";
  }
}

> > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
> > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
> > have the web page and the code, respectively.

Tom says that I must create a new session with a different name
(now I only start a new session implicitly via session_register()).
Perhaps I am confused with the 'session' term. I thought that if I do
session_destroy() the session forget all the info, but if I check
session_id() before and after session_destroy() I see that the value is
the same.

Thanks for your help,
Carlos.

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|




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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Tom Rogers

hi
If you put:

On Sat, 16 Mar 2002, Edward van Bilderbeek - Bean IT wrote:
>
> > maybe you better use:
> >
> > session_unregister("counter");
> >
>
> I've put that, but it doesn't run. As you can see in the URLs
>below, my code is:
>
>if ($id == "logout") { // the user wants logout :(
> session_unregister("counter");
>   }
>   else { // user is navigating through our links
> session_register("counter"); // why I recover the previous value here,
> // even I've clicked logout?
> $counter++;
> print "counter: $counter\n";
>   }
>}
>
> > > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
> > > http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
> > > have the web page and the code, respectively.
>
> Tom says that I must create a new session with a different name
>(now I only start a new session implicitly via session_register()).
>Perhaps I am confused with the 'session' term. I thought that if I do
>session_destroy() the session forget all the info, but if I check
>session_id() before and after session_destroy() I see that the value is
>the same.
>
> Thanks for your help,
> Carlos.
>
>  ___Carlos Costa Portela_
>| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
>|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Carlos Costa Portela

On Sun, 17 Mar 2002, Tom Rogers wrote:

> hi
> If you put:
>
>  session_start();
>
> as the first line on your page it will behave as you want I think.

Thank you very much. It runs now ok :-). But I don't understand
why, if I call session_destroy(), the system remember the value of the
variable.

The system running at...
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
have the web page and the code, respectively.


Thank you very much,
Carlos.

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Tom Rogers

Hi
As you had not started a session at that point there was none to destroy or 
unregister :)
Tom

At 11:53 PM 17/03/2002, Carlos Costa Portela wrote:
>On Sun, 17 Mar 2002, Tom Rogers wrote:
>
> > hi
> > If you put:
> >
> >  > session_start();
> >
> > as the first line on your page it will behave as you want I think.
>
> Thank you very much. It runs now ok :-). But I don't understand
>why, if I call session_destroy(), the system remember the value of the
>variable.
>
> The system running at...
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.php and
>http://casa.ccp.servidores.net/tutorials/php/sessions/sessions.phps you
>have the web page and the code, respectively.
>
>
> Thank you very much,
> Carlos.
>
>  ___Carlos Costa Portela_
>| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
>|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




Re: [PHP] Problem with sessions.

2002-03-17 Thread Carlos Costa Portela

On Mon, 18 Mar 2002, Tom Rogers wrote:

> Hi
> As you had not started a session at that point there was none to destroy or
> unregister :)

Ok!!!. Thank you very much,
Carlos.

  http://www.tertulandia.com : sea cual sea tu tema... allí está tu sitio!

 ___Carlos Costa Portela_
| e-mail:  [EMAIL PROTECTED] | home page: http://casa.ccp.servidores.net |
|_Tódalas persoas maiores foron nenos antes, pero poucas se lembran__|


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




RE: [PHP] Problem with gethostbyaddr()

2002-03-20 Thread Brian Drexler

My apologies for wasting everyone's time.  gethostbyaddr() works fine, I had
gethostbyname() in my script.  Is today Monday or something?  Have a nice
day!

Brian

-Original Message-
From: Brian Drexler [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 8:15 AM
To: Php-General@Lists. Php. Net
Subject: [PHP] Problem with gethostbyaddr()


Greetings all,
 I'm having a problem with the gethostbyaddr() function in PHP 4.1.2.
Whenever I use it, regardless of the IP (Intranet or Internet) it just
returns the IP.  It says in the manual if there is an error, it will return
the IP, but I can't figure out what the error is.  Anyone have any input?
Thanks in advance.

Brian Drexler
Operations Technician
Saginaw Control & Engineering
(989)799-6871 Ext. 497
http://www.saginawcontrol.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] Problem with posting

2002-03-20 Thread Rick Emery

What do you mean "All other browsers either do not submit form data"?

show your code.  

What kind of user authentication are you using?  If none, they'll vote and
vote often.


-Original Message-
From: James Arthur [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 1:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with posting


I'm writing a voting script, but I have a problem with it.

Voters cast their vote by submitting a form. When this form is received it
is 
added to the database, and a session variable is set saying that they've 
voted. The problem is that once someone's voted they can just press reload
on 
their browser and it sends another vote. This happens in Netscape 4.x. All 
other browsers either do not submit form data or recognise that the session 
variable is set.

Any ideas on how to fix this? Thanks.

--jaa

-- 
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] Problem with posting

2002-03-20 Thread Miguel Cruz

On Wed, 20 Mar 2002, James Arthur wrote:
> I'm writing a voting script, but I have a problem with it.
>
> Voters cast their vote by submitting a form. When this form is received
> it is added to the database, and a session variable is set saying that
> they've voted. The problem is that once someone's voted they can just
> press reload on their browser and it sends another vote. This happens in
> Netscape 4.x. All other browsers either do not submit form data or
> recognise that the session variable is set.

How about this:

When they go to the page that provides the voting form, generate a unique
random number and store it in your database. Send that number as a hidden
variable on the voting form.

When the form is submitted, look up the number in the database and store 
their vote alongside it.

That way, if they resubmit, it just replaces their earlier vote.

miguel


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




Re: [PHP] Problem with posting

2002-03-20 Thread James Arthur

On Wednesday 20 Mar 2002 19:40, Rick Emery wrote:
> What do you mean "All other browsers either do not submit form data"?

I mean when the user hits 'reload' the POST data is not resubmitted. Some 
browsers do not resubmit form data, some do, and some prompt.

> What kind of user authentication are you using?  If none, they'll vote and
> vote often.

A session variable is used to store who has voted and who has not. Netscape 
and Mozilla seem to eschew this somehow. Not sure how. In IE it works fine, 
even when you choose to resubmit the form data.

Hit http://wired.st-and.ac.uk/ to see what happens.

--jaa

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




Re: [PHP] problem with mysql

2002-04-11 Thread Jason Wong

On Thursday 11 April 2002 20:40, Roman Duriancik wrote:
> Please send me info : how to set path for *.pid file  and ho to set path
> where will be mysql.sock in mysql database on linux ?
> i want : mysql.sock and localhost.pid in directory /var/lib/mysql
>
> i install mysql with this command...
>
> ./configure --localstatedir=/var/lib/mysql --bindir=/usr/bin
> --libdir=/usr/l ib/ --libexecdir=/usr/libexec --includedir-/usr/include

Please ask on the MySQL list as this has nothing to do with PHP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
They collapsed ... like nuns in the street ... they had no teen
appeal!
*/

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




Re: [PHP] Problem with file()

2002-04-16 Thread Justin Blake

Zambra - Michael wrote:
>
> What kind of line ending does the file() function include in the array
> elements. I'm having problem with file() combined with implode() when
> reading in complete HTML files in a Windows environment. After parsing
these
> resulting strings I get tons of white lines (??).
>
> I'd appreciate any advice.

When it puts each line into the array, the newline is still attached,
so if you are adding more newlines when parsing this could be the problem.

Justin


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




Re: [PHP] problem with PHP_SELF

2002-06-24 Thread Erik Price


On Monday, June 24, 2002, at 10:42  AM, DoL wrote:

> Can anyone advice what did I missed here?
> Would this have anything to do with php or/and apache configuration?

Is it possible that your php.ini file is configured for 
register_globals = off ?

If so, you should use:

$_SERVER['PHP_SELF'] instead of $PHP_SELF.






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




Re: [PHP] problem with PHP_SELF

2002-06-24 Thread Jason Wong

On Monday 24 June 2002 22:42, DoL wrote:
> Hi All
>
> I would like to submit a form to call itself, and according to some
> references I could use the $PHP_SELF variable in action attribute of the
> form element in a HTML document
> But it is not working for me, please help.
>
> I have this line of code
> 
>
> in the html source page, I get
> 
>
> Can anyone advice what did I missed here?
> Would this have anything to do with php or/and apache configuration?

You're probably using a newer version of php (4.1.x+). If so, then you need to 
refer to $PHP_SELF as $_SERVER['PHP_SELF']. Read the release notes for your 
version of PHP or read the php.ini or RTFM for more details.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
There but for the grace of God, goes God.
-- Winston Churchill, speaking of Sir Stafford Cripps.
*/


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




Re: [PHP] problem proccessing SSI...

2002-06-26 Thread Jason Wong

On Thursday 27 June 2002 01:35, The Gabster wrote:
> Hi everyone...
>
> I keep getting an "[an error occurred while processing this directive]" in
> my shtml page when I try to use
> 
> I tried all the path/url variants in vain.
>
> Anyone can help please? I have win2k/Apache/php4.

This looks like an apache issue and has nothing to do with php.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Murder is always a mistake -- one should never do anything one cannot
talk about after dinner.
-- Oscar Wilde, "The Picture of Dorian Gray"
*/


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




RE: [PHP] Problem on file_exists()

2002-07-15 Thread David Redmond

Jack, try using forward slashes instead of backslashes;eg

$fp = fopen("//nedcoraa/pdf_reports/dealing/filename.ext", "r+");

Cheers

-Original Message-
From: Jack [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 16 July 2002 5:02 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Problem on file_exists()


Dear all
I had a folder which the path is : (\\nedcoraa\pdf_reports\dealing
room\report) it stores a lot of PDF reports in there.
I'm trying to use the file_exists() function to detect if a specific file
exist in this folder, but i got a problem is :
It seems that php can go through (\\nedcoraa\pdf_reports) but it can't go
through (dealing room) folder. i had made test on it, i moved a file into
(\\nedcoraa\pdf_reports), then php can detect it, but if i move it to
(\\nedcoraa\pdf_reports\dealing room), then it can't detect the file! why?

I'm using php in windows NT IIS environment!

Please help me!

--
Thx a lot!
Jack
[EMAIL PROTECTED]



-- 
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] Problem on file_exists()

2002-07-16 Thread Chris Hewitt

Jack wrote:

>Dear all
>I had a folder which the path is : (\\nedcoraa\pdf_reports\dealing
>room\report) it stores a lot of PDF reports in there.
>I'm trying to use the file_exists() function to detect if a specific file
>exist in this folder, but i got a problem is :
>It seems that php can go through (\\nedcoraa\pdf_reports) but it can't go
>through (dealing room) folder. i had made test on it, i moved a file into
>(\\nedcoraa\pdf_reports), then php can detect it, but if i move it to
>(\\nedcoraa\pdf_reports\dealing room), then it can't detect the file! why?
>
>I'm using php in windows NT IIS environment!
>
I think you will need to escape the space, usually with a \

HTH
Chris



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




Re: [PHP] Problem with HTTP_POST_VARS

2002-07-25 Thread Jason Reid

You missed the $ before HTTP_POST_VARS. its $HTTP_POST_VARS (its a variable,
not a constant. only constants dont have a $ before them)

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message -
From: "bob" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 6:29 PM
Subject: [PHP] Problem with HTTP_POST_VARS


> Hello,
>
> I'm trying to do a simple form for a local organization and I'm running
into
> problems with the server. I am unable to get any of the variables in the
> html code to post across to the php file. So, I'm figuring
register_globals
> is off. So I change my code to use HTTP_POST_VARS and HTTP_GET_VARS and
get
> this error:
>
> Parse error: parse error in
> /usr/local/etc/httpd/vhosts/htdocs/scripts/join.php on line 3
>
> Here is a snippet of the first few lines of my code:
>
>
> 
> $Agree_to_Terms_of_Membership =
> HTTP_POST_VARS["Agree_to_Terms_of_Membership"];
> $realname = HTTP_POST_VARS["realname"];
> $Company_Name = HTTP_POST_VARS["Company_Name"];
> $Description = HTTP_POST_VARS["Description"];
> $Street_Address = HTTP_POST_VARS["Street_Address"];
>
> I did a phpinfo and their ISP is running PHP Version 4.0B2 and I can see
> track_vars is on.
>
> What is going on here? Any suggestions as to what I'm doing wrong?
>
> Thanks.
>
> Rob.
>
>
> --
> 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] Problem with HTTP_POST_VARS

2002-07-25 Thread bob

Duh!  Thanks guys that's what I was missing.

-Original Message-
From: Bas Jobsen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 8:33 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with HTTP_POST_VARS


put a $ before  HTTP_POST_VARS
be:
$Agree_to_Terms_of_Membership=$HTTP_POST_VARS["Agree_to_Terms_of_Membership"
];
Op vrijdag 26 juli 2002 02:29, schreef u:
> Hello,
>
> I'm trying to do a simple form for a local organization and I'm running
> into problems with the server. I am unable to get any of the variables in
> the html code to post across to the php file. So, I'm figuring
> register_globals is off. So I change my code to use HTTP_POST_VARS and
> HTTP_GET_VARS and get this error:
>
> Parse error: parse error in
> /usr/local/etc/httpd/vhosts/htdocs/scripts/join.php on line 3
>
> Here is a snippet of the first few lines of my code:
>
>
> 
> $Agree_to_Terms_of_Membership =
> HTTP_POST_VARS["Agree_to_Terms_of_Membership"];
> $realname = HTTP_POST_VARS["realname"];
> $Company_Name = HTTP_POST_VARS["Company_Name"];
> $Description = HTTP_POST_VARS["Description"];
> $Street_Address = HTTP_POST_VARS["Street_Address"];
>
> I did a phpinfo and their ISP is running PHP Version 4.0B2 and I can see
> track_vars is on.
>
> What is going on here? Any suggestions as to what I'm doing wrong?
>
> Thanks.
>
> Rob.


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




Re: [PHP] Problem with selection

2002-08-09 Thread Jason Wong

On Friday 09 August 2002 12:16, [EMAIL PROTECTED] wrote:
> Could somebody look at this and tell me way it is not selecting the
> option fields in the $mins variable. I have looking at this all day
> and can not figure out what is wrong with it.
>
>  $mins="3,4,6,23,59";
> $ret=array_reverse(explode(',',$mins));
> $td = " multiple>"; echo "";
> echo $td;
> for($i=0; $i<60; $i++) {
> if($i<=6) {
> echo " if(isset($ret[$i]))

Use print_r($ret) to see why it's not working. Use array_search() or 
in_array() to make it work.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
An evil mind is a great comfort.
*/


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




Re: [PHP] Problem with echo

2002-08-11 Thread Bas Jobsen

Op zondag 11 augustus 2002 16:42, schreef Kristoffer Strom:
> Got a problem when echo:ing a variable containing alot of text.
> When echoing it backslashes ("\") every apostrophe ("'") and quote (").
> This I don't like.
> And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot of
> html tags that I want to keep intact.
>
> /Kris

echo stripslaches($var);

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




Re: [PHP] Problem with echo

2002-08-11 Thread Matt

>From: "Kristoffer Strom" <[EMAIL PROTECTED]>
>Sent: Sunday, August 11, 2002 10:42 AM
>Subject: [PHP] Problem with echo


> Got a problem when echo:ing a variable containing alot of text.
> When echoing it backslashes ("\") every apostrophe ("'") and quote (").
> This I don't like.
> And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot
of
> html tags that I want to keep intact.

Turn off magic_quotes_gpc in php.ini or .htaccess or use stripslashes() on
the fields.  The quotes are there for easy database updates/inserts but
cause trouble if you have to re-echo the data out.   If you insert these
fields into a db, and have turned of magic_quotes_gpc, you'll need to use
addslashes on each field. Otherwise you get new problems.



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




Re: [PHP] Problem with echo

2002-08-11 Thread Kristoffer Strom

Works like a charm, thx

/Kris

"Bas Jobsen" <[EMAIL PROTECTED]> wrote in message
02081115573503.02483@bjobsen">news:02081115573503.02483@bjobsen...
> Op zondag 11 augustus 2002 16:42, schreef Kristoffer Strom:
> > Got a problem when echo:ing a variable containing alot of text.
> > When echoing it backslashes ("\") every apostrophe ("'") and quote (").
> > This I don't like.
> > And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot
of
> > html tags that I want to keep intact.
> >
> > /Kris
>
> echo stripslaches($var);



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




Re: [PHP] problem with $_POST

2002-08-14 Thread Bas Jobsen

Op woensdag 14 augustus 2002 20:57, schreef Adam Williams:
> Does anyone know why it is not working with $_POST but works fine with
> $_GET?

I don't know, but maybe you has to put "" around POST, method="POST". It 
works then with GET, cause that's default. 

Maybe something else is wrong, so method isn't set to post. The same fault 
with get doesn't matter cause the default method.

You can test it. Use your post method and read out $_GET. I think you find 
your value.




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




RE: [PHP] Problem about PHP

2001-07-17 Thread Mark Roedel

> -Original Message-
> From: ChengWen_Yu [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 10:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem about PHP
> 
> 
> I want to write a library for the PHP on Solaris.  But I
> don't know how to do and where I should put this library
> than PHP could reach it.

That's going to depend on what you mean by a "library":

If you want to write some functions in PHP and make them available to
other scripts, then it's just a matter of placing that file somewhere in
your include_path and calling it into your other scripts with include(),
require(), auto_prepend_file, etc.  You can find some information in the
manual on defining functions in PHP at
http://php.net/manual/en/functions.php

If you want to actually extend the capabilities of PHP by adding new
functions to the language, you'll want to start by reading
README.EXT_SKEL in the directory where PHP is installed.  That should, I
think, give you most of the information you need to get started.


---
Mark Roedel ([EMAIL PROTECTED]) | "There cannot be a crisis next week.
Systems Programmer / WebMaster |  My schedule is already full."
 LeTourneau University |   -- Henry Kissinger 

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




Re: [PHP] problem with querystring

2001-08-06 Thread Tim

Is it found in $HTTP_GET_VARS["par1"]?  

- Tim

On 07 Aug 2001 08:02:44 +0700, Ishak Anwar wrote:
> hai all,
> i have problem with QueryString.
> I use php 4.0.x with apache 1.3.x on win 2000
> but can not get the querystring on browser.
> ex:
>   http://localhost/m1.php?par1=value1
> on m1.php, i write:
> echo("m1 = $par1 ");
>   ?>



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




Re: [PHP] problem with querystring

2001-08-06 Thread Ishak Anwar

with $HTTP_GET_VARS["par1"]
i can get par1 value...
but... why with $par1 variable i can not get it ?

thanks

>From: Tim<[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PHP] problem with querystring
>Date: Tue, August 7, 2001 8:10 am
>
> Is it found in $HTTP_GET_VARS["par1"]?  
> 
> - Tim
> 
> On 07 Aug 2001 08:02:44 +0700, Ishak Anwar wrote:
> > hai all,
> > i have problem with QueryString.
> > I use php 4.0.x with apache 1.3.x on win 2000
> > but can not get the querystring on browser.
> > ex:
> >   http://localhost/m1.php?par1=value1
> > on m1.php, i write:
> >>  echo("m1 = $par1 ");
> >   ?>
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 



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




Re: [PHP] problem with querystring

2001-08-06 Thread Tim

See: 

http://www.php.net/manual/en/security.registerglobals.php

- Tim

On 07 Aug 2001 08:12:46 +0700, Ishak Anwar wrote:
> with $HTTP_GET_VARS["par1"]
> i can get par1 value...
> but... why with $par1 variable i can not get it ?
> 
> thanks



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




Re: [PHP] Problem with updating

2001-08-15 Thread Chris Hayes

hi martin,
Could you send the code again and now include 
 - the part where you get the $id_voorspelling from
 - the part where you make the $t1
 - which variable goes wrong? $t1 or $t01?
Can you check the table in mysql to see whether the error is in the update 
or in the print?

Chris


Van:"Martin Kampherbeek" <[EMAIL PROTECTED]>
Aan:<[EMAIL PROTECTED]>
Datum verz. Wed, 15 Aug 2001 21:28:15 +0200
Onderwerp:  [PHP] Problem with updating

> Hello,
> 
> I have created a predictionscompetition and some code counts te total score of a 
>match of a person.
> On the screen it workes, but in de database it goes wrong. Each person gets the 
>total of the last person. There must be something wrong with the update statement.
> I hope someone can help me.
> 
> Cheers,
> Martin.
> 
> $number = MYSQL_NUMROWS($result);
> $i = 0;
>  WHILE ($i < $number):
>   $naam = mysql_result($result,$i,"naam");
>   $uit_gr = mysql_result($result,$i,"uit_gr");
>   $uit_te = mysql_result($result,$i,"uit_te");
>   $ru_gr = mysql_result($result,$i,"ru_gr");
>   $ru_te = mysql_result($result,$i,"ru_te");
>   $minuut = mysql_result($result,$i,"minuut");
>   $toto = mysql_result($result,$i,"toto");
> 
>/* Count everything*/
> 
>   $t01 = $u1+$r1+$b1+$m1+$t1;
>   $sqlb = "UPDATE voorspelling1 SET totaal='$t01' WHERE id_voorspelling = 
>'$id_voorspelling'";
>   $resultb = mysql_query($sqlb);
>   PRINT "$naam $uit_gr $uit_te $u1 $r1 $b1 $m1 $t1 $t01";
>   PRINT "$t1";
>   $i++;
>  ENDWHILE;
> 




--  C.Hayes  Droevendaal 35  6708 PB Wageningen  the Netherlands  --


 

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




Re: [PHP] problem with constants

2001-08-24 Thread Pavel Jartsev

Wolfgang Schneider wrote:
> 
> ...
> 
> Anyone have an idea what may be causing these warnings? It is only
> with code such as " $variable[value]" that these messages show up ...
> and then the code is processed anyways and the page displayed.
> Thank you for any input and help to solve this problem ...
> 

Use $variable['value'] or $variable["value"].

Because, if you use $variable[value], then PHP thinks that 'value' is 
some constant, not string. This is why these warnings occurs.

-- 
Pavel a.k.a. Papi

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




Re: [PHP] Problem using session

2001-08-28 Thread


From: Rosen <[EMAIL PROTECTED]>
Date: Tue, Aug 28, 2001 at 02:43:05PM +0300
Message-ID: <[EMAIL PROTECTED]>
Subject: [PHP] Problem using session

> Hi,
> I'm creating system with user registration. I want to use sessions without cookies.
> My cookies are disabled.
>
> this is my login.php:
>
> global $curusr, $curpass, $registered;
>
>
> if (lExistUser( $usr, $pwd ) == false )// is user exist ?
> {
> echo $usr . $pwd;
> echo " - Error";
> session_destroy();
> $curusr="";
> $curpass="";
> $registered=false;
> exit;
>
> }
> // all ok ! user Exist
> $curusr=$usr;
> $curpass=$pwd;
> $registered=true;
>
> session_start();
> session_register(curusr, curpass, registered );
>
> $web="http://www.somedomain.com";;   // my site
> header("Location: $web");
> exit;
>
>
> But when I get control in my index.php there are no the variables.
>
> Any ideas why ?
>
> Thanks,
>
> Rosen Marinov





If you want to use sessions without using cookies, you should send
the session-ID to the next page using the URL (not a very nice
solution though).

See: http://www.php.net/manual/en/ref.session.php



The following example demonstrates how to register a variable, and how
to link correctly to another page using SID.

Example 3. Counting the number of hits of a single user



Hello visitor, you have seen this page  times.

 is necessary to preserve the
# session id
# in the case that the user has disabled
# cookies
?>

To continue, click here


The  is not necessary, if --enable-trans-sid was used to
compile PHP.





--

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

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




RE: [PHP] Problem with microtime()

2001-08-31 Thread Lawrence . Sheed


You are casting microtimes results as an integer value.  It isn't an integer
value, hence the 0. 


>From the manual It returns the string  the string "msec sec" where sec is
the current time measured in the number of seconds since the Unix Epoch
(0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This
function is only available on operating systems that support the
gettimeofday() system call. 


Try:

for ($i = 0; $i < 100; $i++) {
$k = microtime();
echo "$k";

for ($j = 0; $j < 1; $j++)
$m = $j *3;
}

Or look in the http://www.php.net/manual/en/function.microtime.php for
examples.

-Original Message-
From: Rosen [mailto:[EMAIL PROTECTED]]
Sent: August 31, 2001 3:29 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with microtime()


Hi,
I'm using the following code:
for ($i = 0; $i < 100; $i++) {
$k = (int) microtime();
echo "$k";

for ($j = 0; $j < 1; $j++)
$m = $j *3;
}


but it prints  me only "0.."



Where can be problem ?



Thanks,

Rosen








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

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




Re: [PHP] Problem with microtime()

2001-08-31 Thread Andrey Hristov

";
echo $b;
?>

Produces :
123
123

So I don't think that the problem is how PHP makes the casting but the algorithm is 
useless. Do that :
$ar=explode(' ',microtime());
$a=$ar[1]+$ar[0];


Andrey Hristov
IcyGEN Corporation
http://www.icygen.com
BALANCED SOLUTIONS



- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, August 31, 2001 10:42 AM
Subject: RE: [PHP] Problem with microtime()


> 
> You are casting microtimes results as an integer value.  It isn't an integer
> value, hence the 0. 
> 
> 
> From the manual It returns the string  the string "msec sec" where sec is
> the current time measured in the number of seconds since the Unix Epoch
> (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This
> function is only available on operating systems that support the
> gettimeofday() system call. 
> 
> 
> Try:
> 
> for ($i = 0; $i < 100; $i++) {
> $k = microtime();
> echo "$k";
> 
> for ($j = 0; $j < 1; $j++)
> $m = $j *3;
> }
> 
> Or look in the http://www.php.net/manual/en/function.microtime.php for
> examples.
> 
> -Original Message-
> From: Rosen [mailto:[EMAIL PROTECTED]]
> Sent: August 31, 2001 3:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem with microtime()
> 
> 
> Hi,
> I'm using the following code:
> for ($i = 0; $i < 100; $i++) {
> $k = (int) microtime();
> echo "$k";
> 
> for ($j = 0; $j < 1; $j++)
> $m = $j *3;
> }
> 
> 
> but it prints  me only "0.."
> 
> 
> 
> Where can be problem ?
> 
> 
> 
> Thanks,
> 
> Rosen
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


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




Re: [PHP] Problem with microtime()

2001-08-31 Thread Rosen

Hi,
The problem is, thath I want to generate random number between 1 and 1

How can I do it ?

Thanks,
Rosen


"Lawrence Sheed" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]
...
>
> You are casting microtimes results as an integer value.  It isn't an
integer
> value, hence the 0.
>
>
> From the manual It returns the string  the string "msec sec" where sec is
> the current time measured in the number of seconds since the Unix Epoch
> (0:00:00 January 1, 1970 GMT), and msec is the microseconds part. This
> function is only available on operating systems that support the
> gettimeofday() system call.
>
>
> Try:
>
> for ($i = 0; $i < 100; $i++) {
> $k = microtime();
> echo "$k";
>
> for ($j = 0; $j < 1; $j++)
> $m = $j *3;
> }
>
> Or look in the http://www.php.net/manual/en/function.microtime.php for
> examples.
>
> -Original Message-
> From: Rosen [mailto:[EMAIL PROTECTED]]
> Sent: August 31, 2001 3:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem with microtime()
>
>
> Hi,
> I'm using the following code:
> for ($i = 0; $i < 100; $i++) {
> $k = (int) microtime();
> echo "$k";
>
> for ($j = 0; $j < 1; $j++)
> $m = $j *3;
> }
>
>
> but it prints  me only "0.."
>
>
>
> Where can be problem ?
>
>
>
> Thanks,
>
> Rosen
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



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




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread David Otton

On Mon, 03 Sep 2001 15:11:04 -0700, you wrote:

Following up my own post (in case someone finds this in the archives):

>Is there any situation where such variables would be available to
>phpinfo(), but not the rest of the script?

You can't see $PHP_SELF within a function until you declare it global.

This language really frustrates me sometimes...


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




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread


From: David Otton <[EMAIL PROTECTED]>
Date: Mon, Sep 03, 2001 at 03:21:00PM -0700
Message-ID: <[EMAIL PROTECTED]>
Subject: Re: [PHP] Problem with PHP_SELF

> On Mon, 03 Sep 2001 15:11:04 -0700, you wrote:
> 
> Following up my own post (in case someone finds this in the archives):
> 
> >Is there any situation where such variables would be available to
> >phpinfo(), but not the rest of the script?
> 
> You can't see $PHP_SELF within a function until you declare it global.
> 
> This language really frustrates me sometimes...





It's not so frustrating if you configure it correct. If you set
register_globals, you can just use 'm everywhere. It's not something
you should do, though. You can better use $HTTP_SERVER_VARS[]. It's
(some) safer. For those you don't need to turn on the
register_globals. Just turning on track_vars will do then. And from
PHP 4.0.3 you don't even need to do that.


PHP variables

These variables are created by PHP itself. The $HTTP_*_VARS
variables are available only if the track_vars configuration is
turned on.  When enabled, the variables are always set, even if they
are empty arrays. This prevents a malicious user from spoofing these
variables.

Note: As of PHP 4.0.3, track_vars is always turned on, regardless of
the configuration file setting.

If the register_globals directive is set, then these variables will
also be made available in the global scope of the script; i.e.,
separate from the $HTTP_*_VARS arrays. This feature should be used
with care, and turned off if possible; while the $HTTP_*_VARS
variables are safe, the bare global equivalents can be overwritten
by user input, with possibly malicious intent. If you cannot turn
off register_globals, you must take whatever steps are necessary to
ensure that the data you are using is safe.


See: http://www.php.net/manual/en/language.variables.predefined.php



-- 

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [EMAIL PROTECTED]
-- W: +31 23 5326162
-- F: +31 23 5322144
-- M: +31 6 21811143
--
-- Stationsplein 82
-- 2011 LM  HAARLEM
-- Netherlands
--
-- http://www.datalink.nl
-- 

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




RE: [PHP] Problem with PHP_SELF

2001-09-03 Thread Joe Sheble \(Wizaerd\)

I couldn't help but frown at this message...  This is typical of this and
hundreds of other lists... instead of learning the language, people just
jump in, try to write code, and then when something doesn't work, it's the
language's fault...  It absolutely amazes me that such a huge number of
people don't bother reading the manual or even attempt learning the
basics...

global variables have to be declared in functions.  It's a basic fact, and
should've been learned before even attempting a line of code...


> -Original Message-
> From: David Otton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 03, 2001 3:21 PM
> To: David Otton
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Problem with PHP_SELF
>
>
> On Mon, 03 Sep 2001 15:11:04 -0700, you wrote:
>
> Following up my own post (in case someone finds this in the archives):
>
> >Is there any situation where such variables would be available to
> >phpinfo(), but not the rest of the script?
>
> You can't see $PHP_SELF within a function until you declare it global.
>
> This language really frustrates me sometimes...


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




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread David Otton

On Mon, 3 Sep 2001 09:16:00 -0700, you wrote:

>I couldn't help but frown at this message...  This is typical of this and
>hundreds of other lists... instead of learning the language, people just
>jump in, try to write code, and then when something doesn't work, it's the
>language's fault...  It absolutely amazes me that such a huge number of
>people don't bother reading the manual or even attempt learning the
>basics...

The tone of your message is well-deserved... I switched to "help me"
mode long before I should have because I was under pressure of time.

>global variables have to be declared in functions.  It's a basic fact, and
>should've been learned before even attempting a line of code...

In fact, the function in question /already/ had a bunch of my own
variables declared global in it... I thoughtlessly jumped to the
conclusion that the install was at fault because i have reason not to
trust it.

My other point still stands though (I think) - that marking a variable
as "global" to "pull it in to scope" is a clunky, ass-backwards way of
doing things.

djo


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




Re: [PHP] Problem with PHP_SELF

2001-09-03 Thread Mark Charette

From: "David Otton" <[EMAIL PROTECTED]>
> My other point still stands though (I think) - that marking a variable
> as "global" to "pull it in to scope" is a clunky, ass-backwards way of
> doing things.

Which is why, of course, that parameters were invented "way back when".


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




Re: [PHP] problem with system()

2001-09-14 Thread Evan Nemerson

Use backticks. http://php.net/manual/en/language.operators.execution.php


On Friday 14 September 2001 12:22, you wrote:
> Hi,
>
> I'm trying to unzip a file and save the unzipped data in a variable in PHP
> using :
>
> $result = system ( "gzip -d -c myfile.gz" ); /* 'gzip -d -c' unzips the
> file to 'stdout' */
>
> the above command outputs the result directly to browser instead of putting
> it in $result.
> I tried exec() too but it didn't help because exec() returns only the last
> line of the output data.
> let me add that myfile.gz is about 1.5mb.
>
> help me please !
>
> Arash

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




Re: [PHP] Problem with regex

2001-09-25 Thread Steve Edberg

if (ereg('^[a-z][-a-z0-9\._]*[a-z]$', $TestPwd)) {
echo "Good";
} else {
echo "Bad password $TestPwd";
}

should do it.

If you want a case insensitive match, use eregi(...) instead. The 
above regexp allows passwords as short as 2 characters. If you want 
to, for example, enforce a password length of 4 to 8 characters, you 
can do:

ereg('^[a-z][-a-z0-9\._]{2,6}[a-z]$', $TestPwd)

See
http://php.he.net/manual/en/function.ereg.php

for more info.


-steve


At 5:55 PM -0700 9/24/01, Oliver Ertl wrote:
>Hi,
>
>I need a regex for a username validation. The ereg
>function should be used.
>
>o the username must start and end with a-z
>o in the middle it could be a-z0-9\.-_
>o and never something like this -- -. _- and so on
>
>Thanks for your help
>
>   Oliver
>
>
>
>=
>mailto: [EMAIL PROTECTED]
>www.ertl.co.za
>
>__
>Do You Yahoo!?
>Get email alerts & NEW webcam video instant messaging with Yahoo! 
>Messenger. http://im.yahoo.com
>

-- 
+ Open source questions? +
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+

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




RE: [PHP] Problem with mail()

2001-09-29 Thread Michael Katz

Good call, rtrim() seems to have brought back my sanity!

-Original Message-
From: ReDucTor [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 29, 2001 10:28 AM
To: Martín Marqués; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Problem with mail()


You might want to check if there is a newline at the end, you should do
rtrim() when you draw the subject from the db
- Original Message -
From: "Martín Marqués" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, September 30, 2001 12:24 AM
Subject: Re: [PHP] Problem with mail()


> On Sáb 29 Sep 2001 10:47, you wrote:
> > I am using this simple script:
> >
> > ?PHP
> > global $id, $subject, $news;
> > $database="yisny";
> > include ("yisny_db.inc");
> > db_connect ($database);
> > print ("$id");
> > $query = "select news_id, summary, news from news where news_id=$id";
> >
> > $result = mysql_query ($query)
> >or die ("sorry");
> >
> > $row = mysql_fetch_array ($result);
> > $news =strip_tags(stripslashes($row["news"]));
> > $subject= strip_tags(stripslashes($row["summary"]));
> > $to = "[EMAIL PROTECTED]";
> >
> > mail($to,$subject,$news, "From: yis <[EMAIL PROTECTED]>");
> > print ("See Events");
> > ?>
> >
> > Problem is that the from: header ends up in the body of the message.
>
> And what from do you get?
>
> > If I change $subject to "subject" (no variable) and $news to "news",
> > headers are fine.
>
> Could have something to do with quotes?
> Example:
> mail("martin","a test","this is a "test"","test")
>
> which should be:
>
> mail("martin","a test","this is a \"test\"","test")
>
> but this may not be your problem. I need more info.
>
> > I used to pass the variables between multiple html forms as globals and
> > hidden fields and I had no problems until the size of $message became
too
> > large.  When it grew above 7kb or so the subject header would disappear.
> >
> > At this point I would like to use the above script and have the from:
> > header appear as a header and not in the message body.
> >
> > Running Linux and PHP4.05
>
> You should think about upgrading.
>
> Saludos... :-)
>
> --
> Porqué usar una base de datos relacional cualquiera,
> si podés usar PostgreSQL?
> -
> Martín Marqués  |[EMAIL PROTECTED]
> Programador, Administrador, DBA |   Centro de Telematica
>Universidad Nacional
> del Litoral
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] problem with image

2001-11-17 Thread Jeff Lewis

I would think it's an HTML problem, try:

echo "";

or

echo '';

Jeff
- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 17, 2001 11:20 AM
Subject: [PHP] problem with image


> when i want to put an image like this (echo "";), my
> php is not able to show the image?
> 
> is there something wrong with my php.ini??
> 
> greetings
> wolf.dietrich von loeffelholz
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 


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




RE: [PHP] problem with urlencode

2001-11-29 Thread Zozulak Peter

definitely you need "&" to be replaced with "&" ... 

it will work ...

Peter
> -Original Message-
> From: Oosten, Sjoerd van [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 29, 2001 10:45 AM
> To: '[EMAIL PROTECTED]'
> Subject: [PHP] problem with urlencode
> 
> 
> Hi there,
>  
> I have a problem putting through a variable which contains an & in the
> string.
> When the variabele is something like: 
> click here
>  
> the next file sees $name as rob instead of $name=rob & sjoerd
>  
> i've tried the urlencode function but that doesn't work.
>  
> Somebody,
>  
> thanks 
> 
> 
> Sjoerd van Oosten 
> Digitaal vormgever [EMAIL PROTECTED]
> Datamex E-sites B.V. 
> http://www.esites.nl
> Minervum 7368 Telefoon: (076) 5 730 730 
> 4817 ZH BREDA Telefax: (076) 5 877 757 
> ___
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> 

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




Re: [PHP] problem with urlencode

2001-11-29 Thread faeton

Hello Sjoerd,

U can try using htmlentities().

OSv> I have a problem putting through a variable which contains an & in the
OSv> string.
OSv> When the variabele is something like: 
OSv> click here



Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com


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




Re: [PHP] problem with ImageCreateJPEG ...

2001-12-03 Thread Jim


It is difficult to know where your problem is without more information.

It would appear that your jpeg file is not valid. Try another .jpg file.

Post the problem code, too.






>Hello all,
>anyone can help me 
>
>in line command to configure php :
>'./configure' '--with-mysql'
>
>'--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'
>
>'--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'
>
>'--with-png-dir=/usr/src/packages/SOURCES/libpng/'
>
>'--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'
>
>'--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'
>
>in result of phpinfo() :
> gd
>
>  GD Support
>  enabled
>
>  GD Version
>  1.6.2
>or higher
>  JPG Support
>  enabled
>
>  PNG Support
>  enabled
>
>  WBMP Support
>  enabled
>
>
>
> zlib
>
>  ZLib Support
>
>enabled
>  'zlib:' fopen wrapper
>
>enabled
>  Compiled Version
>
>1.1.3
>  Linked Version
>
>1.1.3
>
>
>,but when use ImageCreateFromJPEG:
>
>Warning:  imagecreatefromjpeg: .../testout.jpg' is not a valid
>JPEG file in ../a.php on line 4
>
>Warning:  Supplied argument is not a valid Image resource in
>../a.php on line 14 =>> ImageJPEG()
>
>what is my problem
>
>--
>Best Regards
>Miguel Joaquim Rodrigues Loureiro
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[EMAIL PROTECTED]

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




RE: [PHP] Problem with round

2001-12-03 Thread Martin Towell

to print two decimal points always, use : printf("%.2f",$value);
round() just rounds the number and doesn't store extra zeros.

-Original Message-
From: Diego Pérez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 11:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with round



Hi to all:

I can't understand, but i have a simple problem with round.

I use the function round($value,2) to round a number with 2 decimals.
But when i put the result in the screen, if $value don't have more or equal
than 2 decimal numbers, the result only have one o none decimals.

I do some examples, but not work correctly.

Can someone help me.


Thanks.



Best Regards,  Diego



Re: [PHP] problem with ImageCreateJPEG ...

2001-12-04 Thread Miguel Loureiro

Hello ,
sorry for taking your time, but I still dont understand why I got errors with
pjeg...
I use the following code on other machine with jpeg support to , and it works,
while in my machine I got an empty jpeg file







Is it possible that, even when see result of phpinfo(); and see that I have
jpeg support , jpeg library isnt well compiled or gd??
if I use PNG instead I got no problems

Jim wrote:

> It is difficult to know where your problem is without more information.
>
> It would appear that your jpeg file is not valid. Try another .jpg file.
>
> Post the problem code, too.
>
> >Hello all,
> >anyone can help me 
> >
> >in line command to configure php :
> >'./configure' '--with-mysql'
> >
> >'--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'
> >
> >'--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'
> >
> >'--with-png-dir=/usr/src/packages/SOURCES/libpng/'
> >
> >'--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'
> >
> >'--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'
> >
> >in result of phpinfo() :
> > gd
> >
> >  GD Support
> >  enabled
> >
> >  GD Version
> >  1.6.2
> >or higher
> >  JPG Support
> >  enabled
> >
> >  PNG Support
> >  enabled
> >
> >  WBMP Support
> >  enabled
> >
> >
> >
> > zlib
> >
> >  ZLib Support
> >
> >enabled
> >  'zlib:' fopen wrapper
> >
> >enabled
> >  Compiled Version
> >
> >1.1.3
> >  Linked Version
> >
> >1.1.3
> >
> >
> >,but when use ImageCreateFromJPEG:
> >
> >Warning:  imagecreatefromjpeg: .../testout.jpg' is not a valid
> >JPEG file in ../a.php on line 4
> >
> >Warning:  Supplied argument is not a valid Image resource in
> >../a.php on line 14 =>> ImageJPEG()
> >
> >what is my problem
> >
> >--
> >Best Regards
> >Miguel Joaquim Rodrigues Loureiro
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> Jim Musil
> -
> Multimedia Programmer
> Nettmedia
> -
> 212-629-0004
> [EMAIL PROTECTED]

--
Best Regards
Miguel Joaquim Rodrigues Loureiro




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


Re: [PHP] problem with ImageCreateJPEG ...

2001-12-04 Thread Johan Holst Nielsen

>
>
>sorry for taking your time, but I still dont understand why I got errors with
>pjeg...
>I use the following code on other machine with jpeg support to , and it works,
>while in my machine I got an empty jpeg file
> Header("Content-type: image/jpeg");
> $im=ImageCreate(400,200);
> $bcg  = ImageColorAllocate($im,240,240,240);
> $prt  = ImageColorAllocate($im,0,0,0);
> $rd   = ImageColorAllocate($im,255,0,0);
> ImageFill($im,400,200,$bcg);
> ImageLine($im,110,85,280,85,$rd);
> ImageString($im,5,130,90,"--- OK ---",$prt);
> ImageLine($im,110,110,280,110,$rd);
> ImageJPEG($im,"a.jpg");
>?>
>
>
>
>
>
>
Try to remove all html, and instead make a ImageJPEG($img);

You should then only get the JPEG file?

You set a header, and the browser doesn't understand the HTML...

regards
Johan


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




RE: [PHP] problem with ImageCreateJPEG ...

2001-12-04 Thread Jack Dempsey

also, are you sure both versions of php were compiled the same way with the
same options and support?

-Original Message-
From: Johan Holst Nielsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 9:22 AM
To: Miguel Loureiro; [EMAIL PROTECTED]
Subject: Re: [PHP] problem with ImageCreateJPEG ...


>
>
>sorry for taking your time, but I still dont understand why I got errors
with
>pjeg...
>I use the following code on other machine with jpeg support to , and it
works,
>while in my machine I got an empty jpeg file
> Header("Content-type: image/jpeg");
> $im=ImageCreate(400,200);
> $bcg  = ImageColorAllocate($im,240,240,240);
> $prt  = ImageColorAllocate($im,0,0,0);
> $rd   = ImageColorAllocate($im,255,0,0);
> ImageFill($im,400,200,$bcg);
> ImageLine($im,110,85,280,85,$rd);
> ImageString($im,5,130,90,"--- OK ---",$prt);
> ImageLine($im,110,110,280,110,$rd);
> ImageJPEG($im,"a.jpg");
>?>
>
>
>
>
>
>
Try to remove all html, and instead make a ImageJPEG($img);

You should then only get the JPEG file?

You set a header, and the browser doesn't understand the HTML...

regards
Johan


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



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




Re: [PHP] Problem with cookies

2001-03-23 Thread Jaxon

Rob, 

perhaps some code?

regards,
jaxon


On 3/23/01 7:03 PM, "wx" <[EMAIL PROTECTED]> wrote:

> Hello:
> 
>   I've set up a authentication script in PHP, and have made it to where once
> the user has been successfully authenticated, it puts the username
> ($global[username]), password ($global[password]), and realname
> ($global[realname]) into a cookie. The included functions file
> (./inc/common.inc) does this, my problem is:
> 
>   Once it has been authenticated, the main page (index.php) goes through an if
> statement for the variable $authok, if $authok is "1", then display the main
> page, elseif $authok != 1, then display login, it displays the main page fine
> except, the realname and the username don't show up, until I reload the page
> and the realname and the username then show up. I don't understand why it is
> doing this. Please if you can, help me fix this.
> 
> Thanks a lot
> Rob Vella
> 


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




Re: [PHP] Problem with cookies

2001-03-23 Thread Richard Lynch

When you SET a cookie, the browser has the cookie, but it has not been sent
back by the browser to the server yet -- Only on the second page does that
happen.

So, in addition to setting a cookie, you should also set the variable at the
same time.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: "wx" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, March 23, 2001 6:00 PM
Subject: [PHP] Problem with cookies


Hello:

I've set up a authentication script in PHP, and have made it to where
once the user has been successfully authenticated, it puts the username
($global[username]), password ($global[password]), and realname
($global[realname]) into a cookie. The included functions file
(./inc/common.inc) does this, my problem is:

Once it has been authenticated, the main page (index.php) goes through
an if statement for the variable $authok, if $authok is "1", then display
the main page, elseif $authok != 1, then display login, it displays the main
page fine except, the realname and the username don't show up, until I
reload the page and the realname and the username then show up. I don't
understand why it is doing this. Please if you can, help me fix this.

Thanks a lot
Rob Vella



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




<    1   2   3   4   5   6   7   8   9   10   >