[PHP] Session

2002-12-12 Thread Boris Kolev
Hello php-general,

  Can i have the same var in 2 diferent session? (f.e. CONTER, WEB
  CHAT etc.)
 Best regards,
 Boris  mailto:[EMAIL PROTECTED]


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




[PHP] Re: Execute a cgi inside of php?

2002-12-12 Thread matty rozen
you can use the curl library to execute the cgi.

"Richard Creech" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hello List,
> Is there a way to execute a cgi inside of php? This is what a customer
wants to do:
>
>
> include("");
>
> but get an error message:
>
> Parse error: parse error, unexpected '.' in
D:\Inetpub\townforum\wwwroot\orgs\header.php on line 3
>
>
> The manual says it won't work:
> http://www.php.net/manual/en/function.include.php
> "Warning
> Windows versions of PHP prior to PHP 4.3 do not support accessing remote
files via this function, even if allow_url_fopen is enabled."
>
> The mail archives didn't shed any light on this question.
>
>
> What alternatives might work?
>
>
> Regards,
>
> Richard Creech
> [EMAIL PROTECTED]
> 250.744.3350 Pacific Time
> Free and retail php resources for developers
> http://www.dreamriver.com
>
>
>
>
>
>
>
>



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




[PHP] Compiling php-4.2.3 with gd - make error

2002-12-12 Thread GoodnGo.de \(R\) Zentrale
Hi List,

I compiled php-4.2.3  on my RH7.3 box that way

./compile ... --with-gd=/usr ...

gd and gd-devel are from RH7.3 base installation

I get the following error whil running -> make
:

In file included from gd.c:83:
gd_ctx.c: In function `_php_image_output_ctx':
gd_ctx.c:70: structure has no member named `free'
gd_ctx.c:98: structure has no member named `free'
gd.c: In function `_php_image_type':
gd.c:1014: structure has no member named `free'
gd.c:1017: structure has no member named `free'
gd.c: In function `_php_image_create_from':
gd.c:1209: structure has no member named `free'
make[3]: *** [gd.lo] Fehler 1
make[3]: Verlassen des Verzeichnisses
Verzeichnis »/usr/src/php-4.2.3/ext/gd«
make[2]: *** [all-recursive] Fehler 1
make[2]: Verlassen des Verzeichnisses
Verzeichnis »/usr/src/php-4.2.3/ext/gd«
make[1]: *** [all-recursive] Fehler 1
make[1]: Verlassen des Verzeichnisses Verzeichnis »/usr/src/php-4.2.3/ext«
make: *** [all-recursive] Fehler 1

What can I do?

Oliver Etzel



[PHP] Update query

2002-12-12 Thread Steve Jackson
How do you update MySQL in the following way?
I have designed a form which has all the fields in the database
available to edit based on a user query. The query is a field called
$ItemCode.

If the user wants to change that $ItemCode field how do I update it? In
other words how do I use PHP to update the database row called $ItemCode
with a new $ItemCode where $ItemCode is $ItemCode?

Here is what I've tried and failed at!
$oldItemCode = $ItemCode;
$query = "update products
 set ItemCode='$newItemCode',
 ItemName ='$ItemName',
 catid = '$catid',
 price = '$price',
 description = '$description'
 shortdesc = '$shortdesc'
 where ItemCode='$oldItemCode'";

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


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




Re: [PHP] GD installation - Simple Question

2002-12-12 Thread info
Hello Phillip, hello Sean,

thank you very much, for answering the question of --with-gd  -  compiling.

I am not using 4.3 . I did it with php-4.2.3

Did I got it right - to use the bundled-gd I have to use the
compiling-flag:
--enable-gd
??

But when I run ./configure --help there isn´t shown any flag --enable-gd
just --enable-gd-native-ttf to use GD: Enable TrueType string function.

Any hints???

Oliver Etzel




To use the bundled gd just do: --enable-gd

Note that 4.3.0 is the first distro that includes a
bundled GD.  Also note that as of 4.3.0 just doing
--with-gd will also use the bundled GD.  Before this,
--with-gd (no directory specified) would look for a
local copy.  That seems odd yes but theory is it
means more people will use the preferred bundled GD
now. To use a non-bundled, you must specify the path
so: --with-gd=/path/to/gd/dir

Note: It's strongly recommended to use the bundled GD.

Regards,
Philip

p.s. 4.3.0-RC3 came out today! :)


On Wed, 11 Dec 2002, Sean Burlington wrote:

> [EMAIL PROTECTED] wrote:
> > Hello list,
> >
> > simple question:
> >
> > I´ve heard that it is possible to compile php with dg-support on two
ways
> > 1) first way: Distribution dependant with the gd-files and libraries,
eg. gd.c, gd.lo, gd.o
> > coming with the distribution of the compiled php-4.x-tarball
> > compiled the follwing way:
> >
> > ./configure .. --with-gd 
> >
> >
> > 2) second way: You can compile the newest Distribution from GD, eg.
gd-2.0.8
> >
> > compiling gd-2.0.8 this way
> > ./configure --prefix=/usr/local/gd ...
> > eg. under  /usr/local/gd
> >
> > and the compile php-4.x this way
> > ./configure  --with-gd=/usr/local 
> >
> >
>  > Did I got that right ?
>
> almost
>
> I think that the value you use for 'prefix=' on gd should be the same as
> the value for 'with-gd='
>
> and its probably best to install gd in /usr/local so that the libraries
> are in an already known location.
>
> like this
>
> ./configure --prefix=/usr/local
>   eg. under  /usr/local
>
> and the compile php-4.x this way
> ./configure  --with-gd=/usr/local
>
> if you do this - be aware that you will have two versions of gd
> installed - this shouldn't cause any problems but don't forget you have
> two versions - and if you install more software make sure it finds the
> right version.
>
> - you can always remove the ditro version - but eg rpm may complain
> about dependency problems as it won't know about your /usr/local version.
>
> --
>
> Sean
>
>
> --
> 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] Update query

2002-12-12 Thread Tim Ward
The best way would be to design the table so that it had an
item_id field that was an auto-incremented integer and not
updateable. It shouldn't be too late to add such a field, then it
can be passed from the form as a hidden field (as I assume
you're currently doing with $oldItemCode).

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: Steve Jackson <[EMAIL PROTECTED]>
To: PHP General <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 9:00 AM
Subject: [PHP] Update query


> How do you update MySQL in the following way?
> I have designed a form which has all the fields in the database
> available to edit based on a user query. The query is a field called
> $ItemCode.
> 
> If the user wants to change that $ItemCode field how do I update it? In
> other words how do I use PHP to update the database row called $ItemCode
> with a new $ItemCode where $ItemCode is $ItemCode?
> 
> Here is what I've tried and failed at!
> $oldItemCode = $ItemCode;
> $query = "update products
>  set ItemCode='$newItemCode',
>  ItemName ='$ItemName',
>  catid = '$catid',
>  price = '$price',
>  description = '$description'
> shortdesc = '$shortdesc'
>  where ItemCode='$oldItemCode'";
> 
> Steve Jackson
> Web Developer
> Viola Systems Ltd.
> http://www.violasystems.com
> [EMAIL PROTECTED]
> Mobile +358 50 343 5159
> 
> 
> -- 
> 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] Update query

2002-12-12 Thread Jason Wong
On Thursday 12 December 2002 17:00, Steve Jackson wrote:
> How do you update MySQL in the following way?
> I have designed a form which has all the fields in the database
> available to edit based on a user query. The query is a field called
> $ItemCode.
>
> If the user wants to change that $ItemCode field how do I update it? In
> other words how do I use PHP to update the database row called $ItemCode
> with a new $ItemCode where $ItemCode is $ItemCode?
>
> Here is what I've tried and failed at!

Please, when something doesn't work, you got to describe _HOW_ it doesn't 
work!

> $oldItemCode = $ItemCode;
>   $query = "update products
>  set ItemCode='$newItemCode',
>  ItemName ='$ItemName',
>  catid = '$catid',
>  price = '$price',
>  description = '$description'
>shortdesc = '$shortdesc'
>  where ItemCode='$oldItemCode'";

You seem to be missing a comma after --> description = '$description'

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

/*
We all know that no one understands anything that isn't funny.
*/


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




Re: [PHP] 2 dates, difference in days AARGH!!

2002-12-12 Thread Steve Yates
"Curtis Gordon" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
> 

Why not use $now_date = mktime(0,0,0,date('m'),date('d'),date('Y')); ?
Also, do you really use  on each line?  Wouldn't that just slow down
processing as PHP jumps in & out of "code mode?"

 - Steve Yates
 - When you do a good deed get a receipt, in case heaven is like the IRS.

~ Taglines by Taglinator - www.srtware.com ~



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




[PHP] Returning multiple values from function

2002-12-12 Thread Lisi
Is it possible to return multiple values from a function?

I have a function that queries a MySQL database for column names (SHOW 
COLUMNS) and then I go through the values return and create two arrays - 
one containing column names and one containing column types.

Is it possible to return two arrays, or do I have to combine them somehow 
and then separate afterwards? Is there another way to do this?

The code works fine when used regularly but I need to put it into a 
function so I can reuse it in more than one page.

Thanks,

-Lisi 


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



Re: [PHP] Returning multiple values from function

2002-12-12 Thread Tim Ward
you can always return an array of arrays ...
return array($array1, $array2, ...);

but in your case why not make the column names
the array keys so the one array holds both column
names and types.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message -
From: Lisi <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 9:34 AM
Subject: [PHP] Returning multiple values from function


> Is it possible to return multiple values from a function?
>
> I have a function that queries a MySQL database for column names (SHOW
> COLUMNS) and then I go through the values return and create two arrays -
> one containing column names and one containing column types.
>
> Is it possible to return two arrays, or do I have to combine them somehow
> and then separate afterwards? Is there another way to do this?
>
> The code works fine when used regularly but I need to put it into a
> function so I can reuse it in more than one page.
>
> Thanks,
>
> -Lisi
>
>
> --
> 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] Re: Building apache, php & mysql, should I use apache 2.0?

2002-12-12 Thread conbud
Hey,
I've been using Apache 2.0.43, PHP, MySQL on Linux machine. Ive been using
for a production site that gets good traffic but nothing real major. Has
multi threading so the speed is really nice. Apache 2 and PHP are still
experimental at the time. However, I havn't ran into any difficulties with
it yet. I think the new Apache 2 is a little easier to config too. Hope some
of this helps.

- Lee
- Web & Graphic Design Using Open Source Technologies

"Buddy Lumpkin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi All,

Haven't build apache and php for a while now and im just wondering if I
should build apache 2.0 or 1.3?

Is php under apache 2.0 still experimental?

What are the pros/cons?

Thanks in advance,

--Buddy



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




[PHP] Restarting a daemon in PHP

2002-12-12 Thread Daniel Fabian
Hi,

I'm trying to write a webinterface that allows helldesk to restart a daemon
in case it crashes.

I use the following commands:

if ($action == "restartsnrdaemon") {
print "Stopping old daemon processes\n";
exec("killall snrdaemon.pl");
print "Starting the process again...\n";
shell_exec("perl /var/www/nocbeamer/includes/snrdaemon.pl");
}

It works just fine, the daemon is started, but apache does not respond any
more in the current session. Only if I close the brower and restart it, I
can access the website again. Does anyone know of a good workaround?

Thanks in advance,
Daniel



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




[PHP] reading pre-extension file

2002-12-12 Thread Luca
How to read "pre-extension" of file with regular expression?
Example: name.preextension.doc

I need to read "preextension"

Tanks!



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




Re: [PHP] reading pre-extension file

2002-12-12 Thread Ernest E Vogelsinger
At 18:40 11.12.2002, Luca spoke out and said:
[snip]
>How to read "pre-extension" of file with regular expression?
>Example: name.preextension.doc
>
>I need to read "preextension"
[snip] 

Assuming that "preextension" is _always_ preceded by at least one dot, and
_always_ followed by exactly one dot, this RE should work (untested):
  /\.([^.]*)\.[^\.]*$/

read from right to left for better understanding:
   line end
   anything before without a dot ('ext')
   a dot before
   anything without a dot before (grouped, 'preext')
   starting with a dot

The group will contain the preextension.


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



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




[PHP] Re: Restarting a daemon in PHP

2002-12-12 Thread Martijn
"Daniel Fabian" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

> It works just fine, the daemon is started, but apache does not respond any
> more in the current session. Only if I close the brower and restart it, I
> can access the website again. Does anyone know of a good workaround?

I encountered the same behaviour after sending mail from a PHP webmail
client. I'm puzzled, too...

Regards,
Martijn.



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




Re: [PHP] Re: Restarting a daemon in PHP

2002-12-12 Thread Dan Hardiker
>> It works just fine, the daemon is started, but apache does not respond
>> any more in the current session. Only if I close the brower and
>> restart it, I can access the website again. Does anyone know of a good
>> workaround?
>
> I encountered the same behaviour after sending mail from a PHP webmail
> client. I'm puzzled, too...

This could because exec statements are executed in the foreground. Your
best bet would be to background the process with &.

exec("perl myscript.pl &");


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



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




[PHP] Performance issues

2002-12-12 Thread KaReL
I'm having a lot of trouble with loading times...

Let me explain in detail:

I've a full & huge coded website based upon a mysql database...

mysql entries: at least 2M
php code: at least 1M lines (longest file about 25k, without includes)

about 2 months ago we resetted the entire database and reworked a part of
the code (nothing really essential).

And now we are experiencing a really heavy load on the server. (no root
access, but we think it's PHP).


What reasons could there be for that?


BTW if I was pretty unclear about what I said in here, please ask... I know
my english ain't that well ;)



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




[PHP] Cybercash/Verisign and PHP possible?

2002-12-12 Thread Jean-Christian Imbeault
My company wants to set up online credit card functionality and we are 
thinking of going with a company called Veritrans (I believe they are 
the japanese branch or cybercash for Verisign in Japan).

However they do not support PHP. They only offer kits for Perl and Java. 
Unfortunately for me they do not have any english documentation either :(

I was wondering two things:

#1- Assuming that this service is the "new" cybercash as offered by 
Verisign does anyone know if I can use the service directly through PHP. 
Or do I really really need to use their kit ...

#2- If I can use this service directly from within PHP can anyone point 
me to some online resources with examples, etc ... so I can figure out 
how to use this beast ;)

Thanks for any advice!

Jc


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



RE: [PHP] Update query

2002-12-12 Thread Steve Jackson
It doesn't work in that it doesn't update the database.
I have a form which when loaded takes a variable ItemCode from the
previous page (which gets the Itemcode from the DB) and puts it into a
hidden field which I call oldItemCode, then when I try to update the
$ItemCode row in the database with the edited changes using the
oldItemCode as an identifier it won't update - It goes to my error
message shown below. So what I'm asking is there anything I'm doing
wrong. I noted your points about the comma and have changed the code. 

";
echo "";
echo " ";
echo "Could not change
details: please click
here to email the administrator";
echo "";
echo "";
echo "";
}
else
{
echo "";
echo "";
echo " ";
echo "Your product has been
successfully edited";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
}
?>


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




Re: [PHP] Update query

2002-12-12 Thread Bastian Vogt
Hi,

did you "echo $query;" and put the output into phpmyadmin?
Perhaps there's an error message that may help you

HTH,
Bastian

Steve Jackson schrieb:

> It doesn't work in that it doesn't update the database.
> I have a form which when loaded takes a variable ItemCode from the
> previous page (which gets the Itemcode from the DB) and puts it into a
> hidden field which I call oldItemCode, then when I try to update the
> $ItemCode row in the database with the edited changes using the
> oldItemCode as an identifier it won't update - It goes to my error
> message shown below. So what I'm asking is there anything I'm doing
> wrong. I noted your points about the comma and have changed the code.
>
>  $query = "update products
>  set ItemCode='$ItemCode',
>  ItemName ='$ItemName',
>  catid ='$catid',
>  price = '$price',
>  description = '$description',
>  shortdesc = '$shortdesc',
>  where ItemCode='$oldItemCode'";
> $result = mysql_query($query);
> if (!$result)
> {
> echo " cellpadding='0' align='center' bgcolor='#629D39'>";
> echo " src='images/admin_orders_administrate.gif'>";
> echo " ";
> echo "Could not change
> details: please click
> here to email the administrator";
> echo "";
> echo "";
> echo "";
> }
> else
> {
> echo " cellpadding='0' align='center' bgcolor='#629D39'>";
> echo " src='images/admin_orders_administrate.gif'>";
> echo " ";
> echo "Your product has been
> successfully edited";
> echo "";
> echo "";
> echo "";
> echo "";
> echo " src='images/admin_orders_upload.gif' border='0'>";
> echo "";
> echo "";
> }
> ?>


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




RE: [PHP] Performance issues

2002-12-12 Thread Jon Haworth
Hi Karel,

> mysql entries: at least 2M
> php code: at least 1M lines 

More than a million lines of code? That's a *big* app.

> And now we are experiencing a really heavy 
> load on the server. (no root access, but we think 
> it's PHP).

You're running it on a server with no root access? Is it a shared server? If
you're running a >1,000,000 LOC app I'd expect it to have enough traffic
that a dedicated box would be a necessity.

Have you looked at the output from top when the load is getting too heavy?
This will tell you which processes are tying up the processor.

Did the heavy load happen immediately after your code change? If so then
that might be a culprit... are there any chunks of code you can roll back to
the old version to see if the load decreasese? (e.g. have you modified a bit
to use a *lot* of string concatenation, or something?)

Cheers
Jon

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




[PHP] Re: [PHP-DEV] Re: PHP 4.3.0RC3

2002-12-12 Thread electroteque
firstly where can i add stuff to the cvs ? i have made a few posts before
about an issue that hasnt changed , you guys still dont have it patched

#if HAVE_LIBGD204
io_ctx->gd_free(io_ctx);
#else
io_ctx->free(io_ctx);
#endif

HAVE_LIBGD204 - this obviously means version 2.0.4 ? i now have 2.0.8 so of
course it is going to use   io_ctx->free(io_ctx); instead and break

"Melvyn Sopacua" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wed, 11 Dec 2002, Juan Rosero wrote:
>
> JR>>> Whenever PHP 4.3.0 is released will it officially support Apache 2?
>
> I wasn't aware Apache 2 officially supported a working mpm yet?
>
> --
> With kind regards,
>
> Melvyn Sopacua
> 
>



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




[PHP] Proposal: New list etiquette/rule

2002-12-12 Thread DL Neil
Spam Arrest Sender VerificationYesterday we held an amusing discussion which 
highlighted the futility of using (badly implemented) technological 'solutions' to a 
social problem...

Herewith I attach a response received pursuant to a list contribution. Does this 
'gentleman' seriously expect every list contributor to provide him with a personal 
service requesting permission to be allowed to post to him? What happens if dozens of 
his colleagues join up? BTW I will, happily, for my hourly fee (minimum charge four 
hours)!

Suggest that the list 'rules' be updated to point out that such requirements are 
unlikely to be received favorably, so if he wants to join the community he needs to do 
'join' us (not vice-versa).

NB I know that technically I've broken my/the list's rules by reproducing this in 
HTML, and have done so that those who can, are able to see the stupidity in its full 
glory/know which service NOT to use...

Regards,
=dn


  - Original Message - 
  From: Kadir 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, December 12, 2002 11:51 AM
  Subject: RE: Re: [PHP-DB] Formatting txt from a database (verification)


  Kadir here,

  I'm protecting myself from receiving junk mail.
  Just this once, click the link below so I can receive your emails. You won't have to 
do this again. http://spamarrest.com/a?33905301:611961 





   
  You are receiving this message in response to your email to Kadir, a Spam Arrest 
customer. 

  Spam Arrest requests that senders verify themselves before their email is delivered. 

  When you click the above link, you will be taken to a page with a graphic on it. 
Simply read the word in the graphic, type it into the form, and you're verified. 

  You will only need to do this once per Spam Arrest customer. 



Re: [PHP] Performance issues

2002-12-12 Thread KaReL
1megabyte of code :)
not 1M lines

sorry about that confusion there


and the problem began slow, not noticable... But it's now worse then ever.

"Jon Haworth" <[EMAIL PROTECTED]> wrote in message
67DF9B67CEFAD4119E4200D0B720FA3F0241E995@BOOTROS">news:67DF9B67CEFAD4119E4200D0B720FA3F0241E995@BOOTROS...
> Hi Karel,
>
> > mysql entries: at least 2M
> > php code: at least 1M lines
>
> More than a million lines of code? That's a *big* app.
>
> > And now we are experiencing a really heavy
> > load on the server. (no root access, but we think
> > it's PHP).
>
> You're running it on a server with no root access? Is it a shared server?
If
> you're running a >1,000,000 LOC app I'd expect it to have enough traffic
> that a dedicated box would be a necessity.
>
> Have you looked at the output from top when the load is getting too heavy?
> This will tell you which processes are tying up the processor.
>
> Did the heavy load happen immediately after your code change? If so then
> that might be a culprit... are there any chunks of code you can roll back
to
> the old version to see if the load decreasese? (e.g. have you modified a
bit
> to use a *lot* of string concatenation, or something?)
>
> Cheers
> Jon



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




RE: [PHP] Performance issues

2002-12-12 Thread Jon Haworth
Hi Karel,

> > > mysql entries: at least 2M
> > > php code: at least 1M lines
> >
> > More than a million lines of code? That's a *big* app.
> 
> 1megabyte of code :)
> not 1M lines

Aha :-)

> and the problem began slow, not noticable... 
> But it's now worse then ever.

Are you doing something that degrades, like reading in an entire text file,
adding a line to the end of it and saving it again? (Each time you do this
it will take a bit longer).

Did you look at the output from top (assuming unix) or task manager
(assuming windows)?

Cheers
Jon

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




[PHP] Re: Session

2002-12-12 Thread matty rozen
what do you mean  - same 2 vars ?

if you mean 2 session vars, than they will be availble on every web page
which uses session calls.

else, let me know what do you mean exactly.

"Boris Kolev" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello php-general,
>
>   Can i have the same var in 2 diferent session? (f.e. CONTER, WEB
>   CHAT etc.)
>  Best regards,
>  Boris  mailto:[EMAIL PROTECTED]
>



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




[PHP] Count lines from php files

2002-12-12 Thread Antti
How can I count how many code lines I have written? I have many php 
files in one directory. I'm using linux.Do you know any non-php way to 
count the lines.

thanks, antti


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



[PHP] Re: Count lines from php files

2002-12-12 Thread Jean-Christian Imbeault
Antti wrote:

How can I count how many code lines I have written? I have many php 
files in one directory. I'm using linux.Do you know any non-php way to 
count the lines.

from a directory one level above where all your files lie do this:

(assuming all you files are in a directory called php)

#ls -R php | wc -l

this will give you the total number of files and directories

If you want to find out how many lines in a file do

# cat myfile.php | wc -l

If you want to count the lines of all files in a directory ending with 
.php do

# cat *.php | wc -l

Jc


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



Re: [PHP] Re: Session

2002-12-12 Thread Boris Kolev
Hello matty,

Thursday, December 12, 2002, 2:43:44 PM, you wrote:

mr> what do you mean  - same 2 vars ?

mr> if you mean 2 session vars, than they will be availble on every web page
mr> which uses session calls.

mr> else, let me know what do you mean exactly.

mr> "Boris Kolev" <[EMAIL PROTECTED]> wrote in message
mr> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Hello php-general,
>>
>>   Can i have the same var in 2 diferent session? (f.e. CONTER, WEB
>>   CHAT etc.)
>>  Best regards,
>>  Boris  mailto:[EMAIL PROTECTED]
>>




No i meen one var in two diferent session! (For example: Counter of
all user available in this moment on the site or all users nicks)

-- 
Best regards,
 Borismailto:[EMAIL PROTECTED]


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




[PHP] filemtime -help

2002-12-12 Thread Mekrand
i have a problem with filemtime function, i want script print out the date
of file last modified.
here is code,
$fp=fopen("ex.txt","r");
echo date("j F Y H:i", filemtime($fp));
fclose($fp);

it turns out; 1 January 1970 02:00 everytime , i modified file, but this
doesnt change, lastly i deleted and uploaded file again, it turns out again
1 January 1970 02:00 .
my server date is correct, output for date("j F Y H:i")  is 12 December 2002
15:40
operating system is linux, and running apache server.

do i need to use clearstatcache ? if so, how?
thanks for any assistance



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




[PHP] filemtime -help

2002-12-12 Thread Mekrand
i have a problem with filemtime function, i want script print out the date
of file last modified.
here is code,
$fp=fopen("ex.txt","r");
echo date("j F Y H:i", filemtime($fp));
fclose($fp);

it turns out; 1 January 1970 02:00 everytime , i modified file, but this
doesnt change, lastly i deleted and uploaded file again, it turns out again
1 January 1970 02:00 .
my server date is correct, output for date("j F Y H:i")  is 12 December 2002
15:40
operating system is linux, and running apache server.

do i need to use clearstatcache ? if so, how?
thanks for any assistance




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




Re: [PHP] Re: Session

2002-12-12 Thread 1LT John W. Holmes
> No i meen one var in two diferent session! (For example: Counter of
> all user available in this moment on the site or all users nicks)

I think what your after is an Application variable. One variable that's
available to every script that's running, or session, or something like
that? There's nothing like that in PHP. You'll have to "roll-your-own" and
use a database or file or something...

---John Holmes...


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




[PHP] shaun@mania.plus.com

2002-12-12 Thread Vivek Kedia
use Mysql front its a GUI for Mysql and make these
kinds of tasks very easy



vivek

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP] Free MySQL Hosting...again

2002-12-12 Thread Adam Voigt




I'm getting Connection Refused on that website, sure your not still having problems?



On Wed, 2002-12-11 at 15:33, PHP Mailing List wrote:

I had a little trouble with my cable modem before, but the Free MySQL 

Hosting is back up if any of you are interested. =)



http://mysql.nukedweb.com/





-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP] "include" question

2002-12-12 Thread RClark
Hello all,

I am passing a variable like so:


On the "link.php" page, I have this simple code:


The 'echo "$job";' statement works just fine, but the outbout for the
include statement looks like this:
bar.php
Warning: Failed opening 'scripts/$job' for inclusion
(include_path='.:/usr/local/lib/php') in /usr/local/www/data-dist/link.php
on line 142

Can I not use a $variable in an include 'something.php '; statement?

Thanks in advance,
Ron Clark



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




[PHP] Re: Cybercash/Verisign and PHP possible?

2002-12-12 Thread matty rozen
i do not really know how they are working, but i'll give you some sort of a
solution.

by using the 'curl' module, you can use any calls needed to any type of
scripts.
you can use curl to "talk" with the cgi.

another option is using sockets (depends on their toolkit) and passing
all the information to it.

let me know if you need more help.

Matty



"Jean-Christian Imbeault" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> My company wants to set up online credit card functionality and we are
> thinking of going with a company called Veritrans (I believe they are
> the japanese branch or cybercash for Verisign in Japan).
>
> However they do not support PHP. They only offer kits for Perl and Java.
> Unfortunately for me they do not have any english documentation either :(
>
> I was wondering two things:
>
> #1- Assuming that this service is the "new" cybercash as offered by
> Verisign does anyone know if I can use the service directly through PHP.
> Or do I really really need to use their kit ...
>
> #2- If I can use this service directly from within PHP can anyone point
> me to some online resources with examples, etc ... so I can figure out
> how to use this beast ;)
>
> Thanks for any advice!
>
> Jc
>



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




Re: [PHP] "include" question

2002-12-12 Thread Leif K-Brooks
Variables don't get parsed in single quotes, use double quotes.

RClark wrote:


Hello all,

I am passing a variable like so:


On the "link.php" page, I have this simple code:

$job = $_GET['foo'];
echo "$job";   // for error checking
include 'path/to/$job';
?>

The 'echo "$job";' statement works just fine, but the outbout for the
include statement looks like this:
bar.php
Warning: Failed opening 'scripts/$job' for inclusion
(include_path='.:/usr/local/lib/php') in /usr/local/www/data-dist/link.php
on line 142

Can I not use a $variable in an include 'something.php '; statement?

Thanks in advance,
Ron Clark



 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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




Re: [PHP] "include" question

2002-12-12 Thread Tom Rogers
Hi,

Friday, December 13, 2002, 12:07:05 AM, you wrote:
R> Hello all,

R> I am passing a variable like so:
R> 

R> On the "link.php" page, I have this simple code:
R>  $job = $_GET['foo'];
R> echo "$job";   // for error checking
R> include 'path/to/$job';
?>>

R> The 'echo "$job";' statement works just fine, but the outbout for the
R> include statement looks like this:
R> bar.php
R> Warning: Failed opening 'scripts/$job' for inclusion
R> (include_path='.:/usr/local/lib/php') in /usr/local/www/data-dist/link.php
R> on line 142

R> Can I not use a $variable in an include 'something.php '; statement?

R> Thanks in advance,
R> Ron Clark


You have to use double quotes like:
include "path/to/$job"

or add like this:

include 'path/to/'.$job

-- 
regards,
Tom


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




Re: [PHP] Free MySQL Hosting...again

2002-12-12 Thread Rick Emery
The page would not display for me.  It did, however send the following HTML.  Please 
note
that the "?PHPSESSID" is not enclosed in  delimiters.  Also, PHPSESSID needs to be
$PHPSESSID.  Could that be the problem?  Finally, dump the FRAMES.

Free MySQL Hosting








Free MySQL Hosting - NukedWeb is offering free MySQL hosting. - free,mysql,hosting



."
- Original Message -
From: Adam Voigt
To: PHP Mailing List
Cc: [EMAIL PROTECTED]
Sent: Thursday, December 12, 2002 7:59 AM
Subject: Re: [PHP] Free MySQL Hosting...again


I'm getting Connection Refused on that website, sure your not still having problems?

On Wed, 2002-12-11 at 15:33, PHP Mailing List wrote:
I had a little trouble with my cable modem before, but the Free MySQL
Hosting is back up if any of you are interested. =)

http://mysql.nukedweb.com/


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

--
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc


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




[PHP] phpinfo page doesn't display anything

2002-12-12 Thread Jody Cleveland
Hello,

I need to change something in my php.ini file, and in searching for where it
is, I found three. So, to find the real one, I made a page that only has
this in it:


and called it info.php. Well, when I bring up that page, it's completely
blank. Any ideas?

-Jody Cleveland

Winnefox Library System
Computer Support Specialist
[EMAIL PROTECTED]

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




RE: [PHP] "include" question

2002-12-12 Thread Ronald Clark
Thanks!  Works perfect with double quotes!

RC


-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 12, 2002 8:21 AM
To: Ronald Clark
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] "include" question


Hi,

Friday, December 13, 2002, 12:07:05 AM, you wrote:
R> Hello all,

R> I am passing a variable like so:
R> 

R> On the "link.php" page, I have this simple code:
R>  $job = $_GET['foo'];
R> echo "$job";   // for error checking
R> include 'path/to/$job';
?>>

R> The 'echo "$job";' statement works just fine, but the outbout for the 
R> include statement looks like this: bar.php
R> Warning: Failed opening 'scripts/$job' for inclusion
R> (include_path='.:/usr/local/lib/php') in
/usr/local/www/data-dist/link.php
R> on line 142

R> Can I not use a $variable in an include 'something.php '; statement?

R> Thanks in advance,
R> Ron Clark


You have to use double quotes like:
include "path/to/$job"

or add like this:

include 'path/to/'.$job

-- 
regards,
Tom


CONFIDENTIALITY NOTICE:



The information contained in this ELECTRONIC MAIL transmission
is confidential.  It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s).  If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.





Re: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread 1LT John W. Holmes
> I need to change something in my php.ini file, and in searching for where
it
> is, I found three. So, to find the real one, I made a page that only has
> this in it:
> 
>
> and called it info.php. Well, when I bring up that page, it's completely
> blank. Any ideas?

You're calling it through a web server, right?

http://www.domain.com/info_page.php ??

---John Holmes...


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




[PHP] Re: phpinfo page doesn't display anything

2002-12-12 Thread Marc Werther
hi,

try to change ur line into:




"Jody Cleveland" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
84CFA712F666B44A94CE6BE116BAF4B0B4E09F@MAIL">news:84CFA712F666B44A94CE6BE116BAF4B0B4E09F@MAIL...
> Hello,
>
> I need to change something in my php.ini file, and in searching for where
it
> is, I found three. So, to find the real one, I made a page that only has
> this in it:
> 
>
> and called it info.php. Well, when I bring up that page, it's completely
> blank. Any ideas?
>
> -Jody Cleveland
>
> Winnefox Library System
> Computer Support Specialist
> [EMAIL PROTECTED]



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




[PHP] fsockopen problem

2002-12-12 Thread Marc Werther
hi all,

i tried to write a script, which check if a Server is online or offline.
The servers are build by friends for onlinegaming voicesoftware (Battlecom
or Gamevoice).
My Script works fine for Battlecom Servers, because there i only have to
check if  the server
is online on a TCP Port(47624).

But if i have to check a Gamevoice Server, i must use udp-port 9110. Which
Ip i enter, the server is always online. I cant find the mistake.

Can u help??

Here the Script:

$voiceport2 = 9110;
$voiceprot2 = "udp://";
$voiceip2 = "80.133.16.93";
if(vservertest($voiceip2, $voiceport2, $voiceprot2) == 1)
  {
   $vstatus2 = "ONLINE";
  }
  else
  {
   $vstatus2 = "OFFLINE";
  }


function vservertest($vhostadress, $vhostport, $voiceudp)
 {
  if($voiceudp != "")  //only for check if it is a BC or GV Server
  {
   $vhostadress = $voiceudp.$vhostadress;
   $fp = fsockopen($vhostadress, $vhostport, &$errno, &$errstr, 10);
   // echo "$fp\n";
   // echo "$errno\n";   only for testing
   // echo "$errstr\n";
   if($fp)
   {
$result = 1;
// echo "TEST: $vhostadress\n";
fclose($fp);
return $result;
   }
   else
   {
$result = 0;
#--fclose($fp);
return $result;
   }
  }


Thx 4 ur help,

Marc Werther
Student



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




RE: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread Jody Cleveland
> You're calling it through a web server, right?

Yup:
http://email.winnefox.org/wals/info.php

Jody

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




Re: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread 1LT John W. Holmes
> > You're calling it through a web server, right?
> 
> Yup:
> http://email.winnefox.org/wals/info.php

Do any other PHP pages work, like just echo "hello world"; ??

---John Holmes...

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




RE: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread Jody Cleveland
> Do any other PHP pages work, like just echo "hello world"; ??

Ok, hello world doesn't work, but I'm running squirrelmail which all the
pages used for that are php, and they work fine.

Jody

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




RE: [PHP] Escaping '#' Sign

2002-12-12 Thread Mike Smith
That didn't do it either. I should have been more specific. I can display
correct results in a HTML table. I have a Edit (A href) link to edit the
current record. ie...

\n";
echo "\n";
echo "";
echo "";
echo "\n";

Rendered results of  =

http://company.com/custmaint.php?id=70&class=&cust=company T/T #29&type=OEM

id is the record id
class is Null so that's OK.
cust=company T/T #29
type=OEM

I present the info in a form...

echo "\n";
echo "\n";
echo "\n";

This gives me:
++
|company T/T |
++
*Note lack of #29 which I do see in the HTML table. If I save (UPDATE WHERE
id=$id) this record cust will now be company T/T

All the other fields fill in correctly. Is it seeing the # as a comment?



-Original Message-
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 3:57 PM
To: Mike Smith; PHP General
Subject: Re: [PHP] Escaping '#' Sign


Why don't you just try:

$cust2 = str_replace('#','#',$cust);

That should replace all instances of # with it's html entity equivalent.  If
that doesn¹t work then there is something else wrong with your script and
we'll need to see it all! :)

Rick

"People who drink to drown their sorrow should be told that sorrow knows how
to swim." - Ann Landers

> I have a string I'm returning from a database. Some entries have # signs
> in the names ie (COMPANY #42, COMPANY #43...). When I display results
> all I have is COMPANY. Everything after the # is dropped off. I tried:
> 
> If ($cust) {
> $cust2=ereg_replace('#','no',$cust);
> //tried $cust2=ereg_replace("#","no",$cust); too
> }
> 
> but that still returns the same thing (COMPANY).
> 
> Also tried:
> 
> $cust2 = preg_replace ("'&(pound|#163);'i", chr(163), $cust);
> 
> Any help is appreciated.
> 
> 
> -- 
> 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] phpinfo page doesn't display anything

2002-12-12 Thread Leif K-Brooks
I'm guessing you don't have the short start tag enabled, try 

Jody Cleveland wrote:

You're calling it through a web server, right?
   


Yup:
http://email.winnefox.org/wals/info.php

Jody

 


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.





[PHP] Session

2002-12-12 Thread Davíð Örn Jóhannsson
Hi I think it is possible to use sessions without having to insert
sid=$sid into every link i print out but I don’t get it to work any
Ideas about what I could be doing wrong?
 I have a login form on a page called login.php, and if login is ok,
then it sets $sid = session_id(); and prints out headers:
heder(Location: index.php?sid=$sid); and it passes the sid variable to
the index page and it works ok but when I click on any links on the
index page I get thrown back to the login, because I made the script do
that if the $sid != session_id().
 
session.use_trans_sid = 1 in the php config
 
this would work if I would print out sid=$sid in every link I have on
the page but I rather not. I would be greatful for any ideas about what
I could be doing wrong.
 
Regards, David
 



Re: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread Martijn Grendelman
"Jody Cleveland" <[EMAIL PROTECTED]> schreef in bericht
84CFA712F666B44A94CE6BE116BAF4B0B4E0A5@MAIL">news:84CFA712F666B44A94CE6BE116BAF4B0B4E0A5@MAIL...
> > You're calling it through a web server, right?
>
> Yup:
> http://email.winnefox.org/wals/info.php
>

Look at the HTML source of that page:



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




Re: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread Martijn Grendelman

"Jody Cleveland" <[EMAIL PROTECTED]> schreef in bericht
84CFA712F666B44A94CE6BE116BAF4B0B4E0A5@MAIL">news:84CFA712F666B44A94CE6BE116BAF4B0B4E0A5@MAIL...
> > You're calling it through a web server, right?
>
> Yup:
> http://email.winnefox.org/wals/info.php
>

Look at the HTML source of that page:



In other words: PHP doesn't work at all, or, like someone else pointed out,
the short tag doesn't work and you should use 

Regards,
Martijn.



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




Re: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread hacook
Maybe you should check the CHMOD (authorizations).
Check if the "Execute" level is on.

"Jody Cleveland" <[EMAIL PROTECTED]> a écrit dans le message de
news: [EMAIL PROTECTED]
> > You're calling it through a web server, right?
>
> Yup:
> http://email.winnefox.org/wals/info.php
>
> Jody



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




Re: [PHP] Linux and Graphics

2002-12-12 Thread Todd Cary




Are there any instructions on how to configure the GD libraries and compile
PHP?  I guess then I will have to recompile Apache so that it includes the
"new" PHP??

Todd

Scott Hurring wrote:

  With RedHat, AFAIR you have to compile PHP from source
*after* first configuring the GD libraries.

It's always been a massive PITA when i've had to compile PHP
on Redhat with Graphic ext's -- try debian instead ;-)

--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Ray Hunter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
  
  
What functions do you want to use?

You can review the functions in the manual and it will tell you how to
configure php with them...

On Mon, 2002-12-09 at 13:31, Todd Cary wrote:


  I am running PHP in a RedHat 7.3 environment and I notice that the
graphic functions are not present.  Since I am quite new to Linux, I
would appreciate it if someone could explain to me what I need to do
to have graphic functions.

Many thanks.

Todd
--
Ariste Software, Petaluma, CA 94952
  

--

Ray Hunter
email: [EMAIL PROTECTED]
www: http://venticon.com


  
  


  


-- 
 

  
 
 
 





RE: [PHP] phpinfo page doesn't display anything

2002-12-12 Thread Jody Cleveland
> I'm guessing you don't have the short start tag enabled, try 

Thank you!!! That did it.

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




Re: [PHP] reading pre-extension file

2002-12-12 Thread Justin French
Does it HAVE to be done with a regexp?



You'd have to do a test to see which is quicker (regexp or this method), but
I *think* this would be quicker.  Better still, it's "future proof" by
working for a.file.with.more.than.two.dots :)

Cheers,

Justin




on 12/12/02 4:40 AM, Luca ([EMAIL PROTECTED]) wrote:

> How to read "pre-extension" of file with regular expression?
> Example: name.preextension.doc
> 
> I need to read "preextension"
> 
> Tanks!
> 
> 

Justin French

http://Indent.com.au
Web Development & 
Graphic Design



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




[PHP] Error: (8) Undefined variable:

2002-12-12 Thread Dubravko Kakarigi
Under what conditions would you see

Error: (8) Undefined variable:

when running a PHP script on the web?

...thanks


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




[PHP] take text before '-' and after it

2002-12-12 Thread Antti
How can I take some text before the mark - and after it and put them for 
example in array. The purpose of this is to read trough mp3 files which 
are in the form of artist - song.mp3 and put them into a text file so I 
can put them into mysql db.

antti


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



Re: [PHP] Out with the new, In with the old

2002-12-12 Thread John Nichel
You can prepend a file to your site by using a .htaccess file.

Scott Houseman wrote:

Hi

Try and get them (your hosting company)to configure your site with a 
prepend file e.g. prepend.php for your domain.
in this file, do something like:


//
// DECLARE ARRAYS
//
$_GET = array( );
$_POST = array( );
$_SERVER = array( );
// etc..
while ( list( $sKey, $mVal ) = each( $HTTP_GET_VARS ) )
{
$_GET{$sKey} = $mVal;
}
// Do this for all arrays which you want to use in your code.
?>

As this file will be auto prepended everytime php is invokded,
these variables will always be available, although they will NOT
be global. That might be a problem if you are using them in the global
scope.

Hope this is useful.

Cheers


Scott

On 2002/12/12 08:14, Jonathan wrote:

I began to develop a small session based shopping cart using newer 
syntax.
For example, $_SERVER, $_REQUEST, $_SESSION, etc.  Anyway, I'm almost 
done
with the cart and just found out that the hosting company for the 
client is
running PHP 4.0.6.  Is there anyway around this besides changing all 
of my
variable names?



===
Jonathan Villa
Application Developer
IS Design & Development
www.isdesigndev.com  414.429.0327
===








--
By-Tor.com
It's all about the Rush
http://www.by-tor.com


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




Re: [PHP] take text before '-' and after it

2002-12-12 Thread ed

 Wouldn't it be simpler to just remove the '-'?

$var = str_replace("-","",$var);

Ed


On Thu, 12 Dec 2002, Antti wrote:

> How can I take some text before the mark - and after it and put them for 
> example in array. The purpose of this is to read trough mp3 files which 
> are in the form of artist - song.mp3 and put them into a text file so I 
> can put them into mysql db.
> 
> antti
> 
> 
> -- 
> 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] Re: filemtime -help

2002-12-12 Thread @ Edwin
Hello,
(B
(B"Mekrand" <[EMAIL PROTECTED]> wrote in message
(B[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
(B> i have a problem with filemtime function, i want script print out the date
(B> of file last modified.
(B> here is code,
(B> $fp=fopen("ex.txt","r");
(B> echo date("j F Y H:i", filemtime($fp));
(B> fclose($fp);
(B
(BI guess you have to check the manual again :)
(B
(BYou don't need fopen() and fclose() here. Just do:
(B
(B  echo date("j F Y H:i", filemtime("ex.txt"));
(B
(B- E
(B
(B
(B-- 
(BPHP General Mailing List (http://www.php.net/)
(BTo unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] take text before '-' and after it

2002-12-12 Thread Michael Montero
You can use split() or explode().

$string = "1234-5467" ;
list( $before_dash, $after_dash ) = explode( "-", $string ) ;

or

$array = explode( "-", $string ) ;

On Thu, 12 Dec 2002 [EMAIL PROTECTED] wrote:

> 
>  Wouldn't it be simpler to just remove the '-'?
> 
> $var = str_replace("-","",$var);
> 
> Ed
> 
> 
> On Thu, 12 Dec 2002, Antti wrote:
> 
> > How can I take some text before the mark - and after it and put them for 
> > example in array. The purpose of this is to read trough mp3 files which 
> > are in the form of artist - song.mp3 and put them into a text file so I 
> > can put them into mysql db.
> > 
> > antti
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> 

-- 
Michael C. Montero
Chief Technology Officer
Community Connect Inc. Co-founder
[EMAIL PROTECTED]

-=-=-=-=-=  Community Connect Inc.  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

The Premier Source of Interactive Online Communities149 Fifth Avenue
http://www.CommunityConnectInc.com/ New York, NY 10010

http://www.AsianAvenue.com/ http://www.BlackPlanet.com/
Click into Asian AmericaThe World Is Yours

http://www.MiGente.com/ http://www.DiversityJobMarket.com/
The Power of LatinosIn partnership with The New
York Times

-  Your Message May Appear Below This Line



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




Re: [PHP] take text before '-' and after it

2002-12-12 Thread 1LT John W. Holmes
> How can I take some text before the mark - and after it and put them for 
> example in array. The purpose of this is to read trough mp3 files which 
> are in the form of artist - song.mp3 and put them into a text file so I 
> can put them into mysql db.

$array = explode("-",$song);

---John Holmes...

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




[PHP] protect downloadable files

2002-12-12 Thread Jan Grafström
Hi,
I have some zipfiles in a directory and wonder how to protect the files?

I send the customer to a downloadpage with links after succsessfull login.

What is best to do? chmod the files when I upload them and change chmod if I
have a verifief user?
Any suggestions?

--
Regards
Jan Grafstrom


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




Re: [PHP] take text before '-' and after it

2002-12-12 Thread Antti
[EMAIL PROTECTED] wrote:

 Wouldn't it be simpler to just remove the '-'?

$var = str_replace("-","",$var);

Ed


On Thu, 12 Dec 2002, Antti wrote:



How can I take some text before the mark - and after it and put them for 
example in array. The purpose of this is to read trough mp3 files which 
are in the form of artist - song.mp3 and put them into a text file so I 
can put them into mysql db.

antti


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





No, I don't want that 'couse the database has columns artist and song 
and I want to fill them with correct values. The thing is to read the 
files and put the values into an array. but I don't know how to do it...?

antti


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



Re: [PHP] protect downloadable files

2002-12-12 Thread Adam Voigt




Make the download link a PHP page:



download.php?fileid=199



Then check to make sure there session is valid, and what not

and then use the header function to make the browser know it's supposed

to give a save dialog box. I don't specifically know the code, but I

know this will work.



On Thu, 2002-12-12 at 10:56, Jan Grafström wrote:

Hi,

I have some zipfiles in a directory and wonder how to protect the files?



I send the customer to a downloadpage with links after succsessfull login.



What is best to do? chmod the files when I upload them and change chmod if I

have a verifief user?

Any suggestions?



--

Regards

Jan Grafstrom





-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php





-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP] ExpertRating launches PHP Certification Exam

2002-12-12 Thread Pete Patil

Good news for the PHP developer community- 
http://www.expertrating.com";>ExpertRating, the global 
skills assessment provider has launched an online PHP Certification 
exam. Candidates who pass the exam will be mailed a hardcopy certificate 
of 
accomplishment. The launch of this exam has generated a lot of excitement 
in the PHP developer community. 


To know more, take a look at the http://www.expertrating.
com/details.asp?examid=91">ExpertRating PHP Exam Information Page.











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




Re: [PHP] take text before '-' and after it

2002-12-12 Thread Richard Baskett
$song = "They Might Be Giants - No!.mp3"

$arr = explode(' - ', $song);
$length = strlen($arr[1]); // gets char length of song

$artist = $arr[0];
$song = substr($arr[1], 0, ($length-4); // deletes the .mp3 off of song name

Cheers!

Rick

He who is devoid of the power to forgive is devoid of the power to love. -
Dr. Martin Luther King, Jr.

> From: Antti <[EMAIL PROTECTED]>
> Date: Thu, 12 Dec 2002 17:49:14 +0200
> To: [EMAIL PROTECTED]
> Subject: [PHP] take text before '-' and after it
> 
> How can I take some text before the mark - and after it and put them for
> example in array. The purpose of this is to read trough mp3 files which
> are in the form of artist - song.mp3 and put them into a text file so I
> can put them into mysql db.
> 
> antti
> 
> 
> -- 
> 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] take text before '-' and after it

2002-12-12 Thread Antti


$array = explode("-",$song);

---John Holmes...


Ok, I got this. But still I don't know how to read the files from a 
directory and put them into an array so I can explode them.

antti


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



Re: [PHP] GD installation - Simple Question

2002-12-12 Thread Philip Olson

No, GD is only bundled as of PHP 4.3.0.

Regards,
Philip


On Thu, 12 Dec 2002 [EMAIL PROTECTED] wrote:

> Hello Phillip, hello Sean,
> 
> thank you very much, for answering the question of --with-gd  -  compiling.
> 
> I am not using 4.3 . I did it with php-4.2.3
> 
> Did I got it right - to use the bundled-gd I have to use the
> compiling-flag:
> --enable-gd
> ??
> 
> But when I run ./configure --help there isn´t shown any flag --enable-gd
> just --enable-gd-native-ttf to use GD: Enable TrueType string function.
> 
> Any hints???
> 
> Oliver Etzel
> 
> 
> 
> 
> To use the bundled gd just do: --enable-gd
> 
> Note that 4.3.0 is the first distro that includes a
> bundled GD.  Also note that as of 4.3.0 just doing
> --with-gd will also use the bundled GD.  Before this,
> --with-gd (no directory specified) would look for a
> local copy.  That seems odd yes but theory is it
> means more people will use the preferred bundled GD
> now. To use a non-bundled, you must specify the path
> so: --with-gd=/path/to/gd/dir
> 
> Note: It's strongly recommended to use the bundled GD.
> 
> Regards,
> Philip
> 
> p.s. 4.3.0-RC3 came out today! :)
> 
> 
> On Wed, 11 Dec 2002, Sean Burlington wrote:
> 
> > [EMAIL PROTECTED] wrote:
> > > Hello list,
> > >
> > > simple question:
> > >
> > > I´ve heard that it is possible to compile php with dg-support on two
> ways
> > > 1) first way: Distribution dependant with the gd-files and libraries,
> eg. gd.c, gd.lo, gd.o
> > > coming with the distribution of the compiled php-4.x-tarball
> > > compiled the follwing way:
> > >
> > > ./configure .. --with-gd 
> > >
> > >
> > > 2) second way: You can compile the newest Distribution from GD, eg.
> gd-2.0.8
> > >
> > > compiling gd-2.0.8 this way
> > > ./configure --prefix=/usr/local/gd ...
> > > eg. under  /usr/local/gd
> > >
> > > and the compile php-4.x this way
> > > ./configure  --with-gd=/usr/local 
> > >
> > >
> >  > Did I got that right ?
> >
> > almost
> >
> > I think that the value you use for 'prefix=' on gd should be the same as
> > the value for 'with-gd='
> >
> > and its probably best to install gd in /usr/local so that the libraries
> > are in an already known location.
> >
> > like this
> >
> > ./configure --prefix=/usr/local
> >   eg. under  /usr/local
> >
> > and the compile php-4.x this way
> > ./configure  --with-gd=/usr/local
> >
> > if you do this - be aware that you will have two versions of gd
> > installed - this shouldn't cause any problems but don't forget you have
> > two versions - and if you install more software make sure it finds the
> > right version.
> >
> > - you can always remove the ditro version - but eg rpm may complain
> > about dependency problems as it won't know about your /usr/local version.
> >
> > --
> >
> > Sean
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


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




Re: [PHP] take text before '-' and after it

2002-12-12 Thread 1LT John W. Holmes
> > $array = explode("-",$song);
> > 
> > ---John Holmes...
> 
> Ok, I got this. But still I don't know how to read the files from a 
> directory and put them into an array so I can explode them.

examples here:

http://www.php.net/manual/en/ref.dir.php

---John Holmes...

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




[PHP] Re: protect downloadable files

2002-12-12 Thread Martijn Grendelman
"Jan grafström" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> I have some zipfiles in a directory and wonder how to protect the files?
>
> I send the customer to a downloadpage with links after succsessfull login.
>
> What is best to do? chmod the files when I upload them and change chmod if
I
> have a verifief user?
> Any suggestions?

It depends on how your authentication system works. If you use HTTP
authentication, you could just do something with a .htaccess file (require
valid user). If you use sessions and validate users against a database or
something like that, you may need to write a script that only sends the
files to authenticated users.

In my case, a variable $uservalidated is set to true if the user is
validated. The script (download.php) looks like this:



Just call download.php?file=filename.zip
filename.zip should reside in the $filedir.

You should also have a function get_mime_type() that returns the MIME type
of the file, or just set the type to "application/x-zip" if you only serve
ZIP files.

Regards,
Martijn.



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




Re: [PHP] fgetcsv Help

2002-12-12 Thread @ Edwin
Hello,

"Justin French" <[EMAIL PROTECTED]> wrote:

[snip]
> Sample line from your CSV should look like this:
> 
> ---
> "1","foo","harry said \"what is it?\"","foo"
> "1","bah","\"don't know\" said sally","something"
> ---
> 
> When echoing these values to the browser, you would strip the slashes.
[/snip]

The double quotes aren't really necessary unless
1. You have a comma in the field
2. You have double quotes in the field

So,

  1,foo,"Harry said ""what is it""",foo

would have no problem with fgetcsv().

And, btw, the " are also "escaped" with another ".

- E

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




Re: [PHP] Forms

2002-12-12 Thread @ Edwin
Hello,

"Chris Hewitt" <[EMAIL PROTECTED]> wrote:

[snip]
> GET or  POST method (I'm not sure whether there is a default).
[/snip]

GET is the default... should be... I guess...

- E

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




[PHP] Need to place a comma into a string of 4 or 5 digits

2002-12-12 Thread rw
Hello All!

I am racking my brain and scouring the books and I can't seem to find a solution
to this simple problem.

Any help is appreciated.

Thanks

Ruusvuu 

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




Re: [PHP] Can PHP do this...?

2002-12-12 Thread @ Edwin
Hello,

"1LT John W. Holmes" <[EMAIL PROTECTED]> wrote:

> > OK. I think I understand this, but let me ask just to be sure.
> >
> > So if I setup in my page something to this effect:
> > if ($_SERVER['!HTTPS']) {
> > echo "Switching over to SSL...";
> > echo "";
> > } else {
> > echo "**Rest of Page**";
> > }
> >
> > Would this work? I am about to add a secind site to my site using an
alias
> > in Apache. Example is http://www.mysite.com for first site and
> > http://www.mysite.com/2ndsite. Except I want everything for the second
> site
> > to be https. Make sense?
>
> if(!isset($_SERVER['HTTPS']))
> { header("Location: https://www.mysite.com/2ndsite";); }
>
> That should work. Or you could echo the META redirect if you wanted to
> display a page, but this should do it transparently. There is probably a
way
> to do it with just Apache, too, that wouldn't involve PHP.

I think there's some useful info here (about doing it with "just Apache"):

  http://httpd.apache.org/docs-2.0/ssl/ssl_howto.html

Just in case...

- E

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




Re: [PHP] Need to place a comma into a string of 4 or 5 digits

2002-12-12 Thread ed

 IF you're looking to break digits into thousands by use of a comma search
the manual for number_format.

Ed


On Thu, 12 Dec 2002 [EMAIL PROTECTED] wrote:

> Hello All!
> 
> I am racking my brain and scouring the books and I can't seem to find a solution
> to this simple problem.
> 
> Any help is appreciated.
> 
> Thanks
> 
> Ruusvuu 
> 
> -- 
> 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] Error: (8) Undefined variable: - figured out

2002-12-12 Thread Dubravko Kakarigi
Due to my newbie PHP status I posted that question, but I now learned how 
to deal with it. Thanks to all who read it (no one responded, probably out 
of distaste for such a basic question :-)

...thanks


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



Re: [PHP] overview of current app frameworks

2002-12-12 Thread James Johnson
I'd also add Fusebox for PHP (www.fusebox.org,
http://sourceforge.net/projects/php-fusebox/) AND the "tone" of the user's
on the various mailing lists. The people on the PHP Fusebox list are
considerate and helpful. I made the mistake of posting a "newbie" PHP
question on the Smarty list and was amazed at the insolent messages that
we're sent back to me.

My $0.02.

Jim Johnson
- Original Message -
From: "Jonathan Ellis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 1:29 PM
Subject: [PHP] overview of current app frameworks


> I recently checked up on just about every PHP application framework I
> could find.  I thought I'd throw my conclusions out for anyone else who
> was looking for something similar.
>


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




[PHP] Re: filemtime -help

2002-12-12 Thread Mekrand
thanks
"@ Edwin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> "Mekrand" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > i have a problem with filemtime function, i want script print out the
date
> > of file last modified.
> > here is code,
> > $fp=fopen("ex.txt","r");
> > echo date("j F Y H:i", filemtime($fp));
> > fclose($fp);
>
> I guess you have to check the manual again :)
>
> You don't need fopen() and fclose() here. Just do:
>
>   echo date("j F Y H:i", filemtime("ex.txt"));
>
> - E
>



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




Re: [PHP] Need to place a comma into a string of 4 or 5 digits

2002-12-12 Thread rw
Thank you!

 I knew it would be a snap!
The problem no longer exists.

Quoting [EMAIL PROTECTED]:

### 
###  IF you're looking to break digits into thousands by use of a comma
### search
### the manual for number_format.
### 
### Ed
### 
### 
### On Thu, 12 Dec 2002 [EMAIL PROTECTED] wrote:
### 
### > Hello All!
### > 
### > I am racking my brain and scouring the books and I can't seem to find a
### solution
### > to this simple problem.
### > 
### > Any help is appreciated.
### > 
### > Thanks
### > 
### > Ruusvuu 
### > 
### > -- 
### > 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] socket_set_blocking()

2002-12-12 Thread poliva
I was not able to get php's ftp functions working for me, they were uploading zero 
byte files, so I am now attempting to use fsockopen to accomplish the task.

I found this script: http://www.phpbuilder.com/mail/php-general/2001102/1333.php

It uses the function: socket_set_blocking(), and php.net says that this is an alias 
for stream_set_blocking(). What does blocking mode mean?  I am not familiar with this 
concept, can someone explain.

As for the issue of socket_set_blocking() being an alias for stream_set_blocking(), 
why would I not just use stream_set_blocking?


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




Re: [PHP] socket_set_blocking()

2002-12-12 Thread @ Edwin
Hello,

<[EMAIL PROTECTED]> wrote:

> I was not able to get php's ftp functions working for me, they were
uploading zero byte files, so I am now attempting to use fsockopen to
accomplish the task.
>
> I found this script:
http://www.phpbuilder.com/mail/php-general/2001102/1333.php
>
> It uses the function: socket_set_blocking(), and php.net says that this is
an alias for stream_set_blocking(). What does blocking mode mean?  I am not
familiar with this concept, can someone explain.
>

I think it's explained here. (Not sure if it'll help though...)

http://www.php.net/manual/en/function.stream-set-blocking.php

> As for the issue of socket_set_blocking() being an alias for
stream_set_blocking(), why would I not just use stream_set_blocking?
>

The reason is also found above. (Hint: Because it may not be available in
the version of php you are using.)

- E

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




[PHP] Re: Objects and Classes?

2002-12-12 Thread Shawn McKenzie
Very cool!  Thanks!

"Christopher Raymond" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Shawn:
>
>   I beleive I can clarify the purpose of objects/classes for you and
> enrich my clarification with a couple of examples.
>
>
> THE DIFFERENCE BETWEEN "OBJECT" AND "CLASS":
>
>   A class defines the structure of an object. A class is a "template"
> for an object. An object is a container for data and for functions that
> operate on that data. A class is a roadmap -- it defines the object's
> structure. You can then create several objects using one class. These
> several objects are separate from one another, but identical in
> structure. Each can contain different data but use the same functions to
> operate on that data.
>
>   Functions contained within an object class are called methods.
> Functionally, methods are exactly the same as functions except that they
> are restricted to the scope of the object. Generally, a method is a
> function that operates on the object's data. An object contains variable
> data including variables, arrays and objects. These variables are called
> the object's properties.
>
>
> WHEN TO USE OBJECTS:
>
>   Objects could be used when you have several similar pieces of data
> especially when you wish to have that data manipulated by the same
> functions but wish to maintain separation between these data objects.
>
>
> EXAMPLE:
>
>   Let's say, for example, that you wished to store information about a
> number of different people within a single script execution. An
> insurance site might wish to gather information about the primary
> applicant, his wife and their three children all on the same page.
>
>   You and I would agree that all people have similar properties; we all
> have an age, a height, a weight - we might smoke etc. Therefore, a class
> for people could be defined.
>
> class Human
> {
> var $age;
> var $height_inches;
> var $weight_pounds;
> var $smoker;
>
> function HeightWeightRatio()
> {
> $ratio = $this->height_inches / $this->weight_pounds;
> return $ratio;
> } }
> } }
>
>   To create an instances of the class (an object) you would use
> something like this:
>
> $father = new Human;
> $mother = new Human;
>
>   Once you have instantiated the class (previous lines) you could then
> set the values of the object with code like:
>
> $father->age = 49;
> $father->height = "5'11";
> $father->weight = 215;
> $father->smoker = false;
>
> $father_ratio = $father->HeightWeightRatio();
>
> $mother->age = 47;
> $mother->height = "5'5";
> $mother->weight = 145;
> $mother->smoker = true;
>
> $mother_ratio = $mother->HeightWeightRatio();
>
>   By now, I'm sure you get the picture.
>
>
> THE MOST USEFUL EXAMPLE FOR ME THUS FAR:
>
> class HTMLTemplate
> {
>
> var $template;
> var $html;
> var $parameters
> = array();
> var $populated = false;
>
> function HTMLTemplate (
> $template)
> {
>
> $this->template = $template;
> $this->html =
> implode ("", (file($this->template)));
>
> }
>
> function SetParameter (
> $variable, $value)
> {
>
> $this->parameters[$variable] = $value;
>
> }
>
>
> function PopulateValues ()
> {
>
> foreach ($this->parameters as
> $key => $value)
> {
>
> $template_name = ' >';
> $this->html = str_replace ($template_name, $value, $this->html);
> }
>
>
> $this->populated = true;
> }
>
> function ReturnHTML ()
> {
> if (
> $this->populated)
> {
> return $this->html;
> }
> else
> {
>
> $this->PopulateValues();
> return $this->html;
> }
> }
> }
>
>   This class allows you to use an html template file which you can paste
> dynamic values/content into. Here's an example of how to use it:
>
> 
> $title = "My Web Page";
> $content = "Hello, this is my web page.";
>
> $template = new HTMLTemplate("/mytemplate.html");
> $template->setParameter("PAGE-TITLE", $title);
> $template->setParameter("CONTENT", $content);
>
> echo $template->ReturnHTML(); // Sends html to the browser
>
> // It is important to destroy an object once you are finished
> // using it so that you can free up the memory space that it uses
>
> unset($template); // Destroys instance of object
>
> ?>
>
> HTML TEMPLATE FILE:
>
>   My html template file might look like this:
>
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> Christopher Raymond,
> Oasis Networks <-- Web Development & Macintosh Systems Consulting



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




[PHP] Include?

2002-12-12 Thread Shawn McKenzie
It seems that if I create a php file in my dir at my hosting provider and do
include('/etc/passwd'); then wow, I see the contents of etc/passwd!

Is this expected behavior???

I am looking at creating a script that takes a var in the url and includes
the requested file.  The purpose would be for only URLs
(myscript.php?page=http://mysite.com/dir/cool.html, or relative URLs
(myscript.php?page=/dir/cool.html).

Can I do this without allowing someone to include files by filesystem
reference???

Thanks!
Shawn



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




Re: [PHP] Include?

2002-12-12 Thread Adam Voigt




The passwd file is frequently world-readable so programs that rely on it don't need

root permissions. Now if you can view /etc/shadow, then that would be a problem since

that's where the actual passwords are stored (encrypted).





On Thu, 2002-12-12 at 12:53, Shawn McKenzie wrote:

It seems that if I create a php file in my dir at my hosting provider and do

include('/etc/passwd'); then wow, I see the contents of etc/passwd!



Is this expected behavior???



I am looking at creating a script that takes a var in the url and includes

the requested file.  The purpose would be for only URLs

(myscript.php?page=http://mysite.com/dir/cool.html, or relative URLs

(myscript.php?page=/dir/cool.html).



Can I do this without allowing someone to include files by filesystem

reference???



Thanks!

Shawn







-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP] Problems connecting to a MySQL database

2002-12-12 Thread eric
Greetings!

I have a script which attempts to connect to the database in three different 
segments of code.

I'm using this code to connect to the database:

$db = mysql_connect("the_host", "the_user", $cfg['Servers'][0]['password']);
.
.
.
.
mysql_close($db);

The first time I connect ok, retrieve all of the rows from a table, and 
display portions of a column.

A user then clicks on a button to retrieve more detailed information from 
the same table in the database:

$db = mysql_connect("the_host", "the_user", $cfg['Servers'][0]['password']);

This bombs with:

Warning: Undefined offset: 0 in (directory stuff)/www/cgi-php4/my_script.php 
on line 228

Warning: Access denied for user: 'the_user' (Using password: NO) in 
(directory stuff)/www/cgi-php4/my_script.php on line 228

Warning: MySQL Connection Failed: Access denied for user: 'the_user' (Using 
password: NO) in (directory stuff)/www/cgi-php4/my_script.php on line 228

Error: Could not connect to the database.


Now, if I change the index to match the exact number of rows in the table, 
it's successfully accessed:

$db = mysql_connect("the_host", "the_user", $cfg['Servers'][4]['password']);

it works fine.  But I don't think this is right.

Any ideas as to why this is happening?

Thanks much!

Eric

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




[PHP] Cookies Help

2002-12-12 Thread Sean Mayhew
Ive created a log in that essentially if the username and password are found
in the database it displays one section of code and if its not found it
display another log in form

Im able to log in and my verifylogin() function works because if the
username and password are not found it displays the login form again but
when I click a link to another page that uses my admin class it just
displays that second log in form as if the username and password are not
carrying over I know this has something to do with my session_start or
something but I've no idea I'm very new to sessions and cookies:

Here is my page admin page display:

SetContent($redux);

$toolsneeded = "admin";
$adminroot->SetToolsNeeded($toolsneeded);
$adminroot->Display($employeeid,$password,$title);
?>


Here are the relevant parts of my class file:


##
##CLASS DECLARATION
##
class ADMINPAGE
{


##
##DISPLAY FUNCTION
##
function Display($employeeid,$password,$title)
 {
 $count = $this -> VerifyLogin($employeeid,$password);
 switch($count)
  {
  case "1":
   $this -> DisplayHeader($title,$employeeid);
   echo "";
   $this -> DisplayMenu($this->buttons);
   echo "";
   $this -> DisplayContent($this->toolsneeded,$this->content);
   echo "";
   $this -> DisplayFooter();
   break;

  default:
   $title = "Please Try Again";
   $employeeid = "";
   $password = "";
   $this -> DisplayHeader($title,$employeeid,$password);
   echo "";
   echo "Your username and password combination is incorrect. Please try
again.";
   $this->DisplayLogInForm();
   echo "";
   $this -> DisplayFooter();
   break;
  }
 }


##
##VERIFY LOGIN FUNCTION
##
function VerifyLogin($employeeid,$password)
 {
 include('dbconnection.php');
 $employeequery = "Select count(*) from employees where employeeid =
'$employeeid' and password='$password'";
 $employeeresult = mysql_query($employeequery);
 if(!$employeeresult)
  {
  echo 'Please Try Again Later.';
  exit();
  }
 $count = mysql_result($employeeresult,0,0);
 if($count>0)
  {
  $count = "1";
  }
  else
   {
   $count = "0";
   }
  return $count;
 }




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




Re: [PHP] Include?

2002-12-12 Thread Chris Hewitt
Shawn McKenzie wrote:


Is this expected behavior???


Settings such as safe_mode come into play. There is a difference between 
what a webhost provider expects from someone trusted with an account, 
and what is expectd of a user of your website. The best advice I've 
heard is to assume a user of your site is a hacker who wants to bring 
your site down. ...

(myscript.php?page=http://mysite.com/dir/cool.html, or relative URLs
(myscript.php?page=/dir/cool.html).

Can I do this without allowing someone to include files by filesystem
reference???


...so check and validate any user input. If you decide that it is not a 
good idea to allow a user to specify /etc/passwd (as all user names are 
stored there), then check and reject such things (commonly any absolute 
path).

Regards

Chris



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



[PHP] Re: Problems connecting to a MySQL database

2002-12-12 Thread Jeff Bluemel
have you tried connected to the mysql database from a prompt before using
php???


"Eric" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Greetings!
>
> I have a script which attempts to connect to the database in three
different
> segments of code.
>
> I'm using this code to connect to the database:
>
> $db = mysql_connect("the_host", "the_user",
$cfg['Servers'][0]['password']);
> .
> .
> .
> .
> mysql_close($db);
>
> The first time I connect ok, retrieve all of the rows from a table, and
> display portions of a column.
>
> A user then clicks on a button to retrieve more detailed information from
> the same table in the database:
>
> $db = mysql_connect("the_host", "the_user",
$cfg['Servers'][0]['password']);
>
> This bombs with:
>
> Warning: Undefined offset: 0 in (directory
stuff)/www/cgi-php4/my_script.php
> on line 228
>
> Warning: Access denied for user: 'the_user' (Using password: NO) in
> (directory stuff)/www/cgi-php4/my_script.php on line 228
>
> Warning: MySQL Connection Failed: Access denied for user: 'the_user'
(Using
> password: NO) in (directory stuff)/www/cgi-php4/my_script.php on line 228
>
> Error: Could not connect to the database.
>
>
> Now, if I change the index to match the exact number of rows in the table,
> it's successfully accessed:
>
> $db = mysql_connect("the_host", "the_user",
$cfg['Servers'][4]['password']);
>
> it works fine.  But I don't think this is right.
>
> Any ideas as to why this is happening?
>
> Thanks much!
>
> Eric



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




[PHP] Re: problems with jsp & php

2002-12-12 Thread Jeff Bluemel
somebody has to have an answer to this...


"Jeff Bluemel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I cannot figure out where my problem is with the following script.  I know
> I've used this syntax successfuly in the past.  when I take out the
> variables, and just set link to something without using php then this
works.
> know when I click on the form that activated the button it does nothing.
>
> function batch_close()
> {
> if (parent_window && !parent_window.closed)
> {
>  var action = ;
>   var batch = ;
>   var begin = ;
>   var end = ;
>   var amount = ;
>   var link = "maintain.html?action=" + action + "&batch=" + batch +
> "&begin=" + begin + "&end=" + end + "&amount=" + amount;
> parent_window.document.location.href=link;
> parent_window.focus();
> }
> window.close();
> }
>
>



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




[PHP] Re: Problems connecting to a MySQL database

2002-12-12 Thread eric
A prompt?  Not sure I understand.

The first time around it connects ok with PHP.  I can retrieve all the rows.  
It's the 2nd time where it doesn't.

Jeff Bluemel wrote:

> have you tried connected to the mysql database from a prompt before using
> php???
> 
> 
> "Eric" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> Greetings!
>>
>> I have a script which attempts to connect to the database in three
> different
>> segments of code.
>>
>> I'm using this code to connect to the database:
>>
>> $db = mysql_connect("the_host", "the_user",
> $cfg['Servers'][0]['password']);
>> .
>> .
>> .
>> .
>> mysql_close($db);
>>
>> The first time I connect ok, retrieve all of the rows from a table, and
>> display portions of a column.
>>
>> A user then clicks on a button to retrieve more detailed information from
>> the same table in the database:
>>
>> $db = mysql_connect("the_host", "the_user",
> $cfg['Servers'][0]['password']);
>>
>> This bombs with:
>>
>> Warning: Undefined offset: 0 in (directory
> stuff)/www/cgi-php4/my_script.php
>> on line 228
>>
>> Warning: Access denied for user: 'the_user' (Using password: NO) in
>> (directory stuff)/www/cgi-php4/my_script.php on line 228
>>
>> Warning: MySQL Connection Failed: Access denied for user: 'the_user'
> (Using
>> password: NO) in (directory stuff)/www/cgi-php4/my_script.php on line 228
>>
>> Error: Could not connect to the database.
>>
>>
>> Now, if I change the index to match the exact number of rows in the
>> table, it's successfully accessed:
>>
>> $db = mysql_connect("the_host", "the_user",
> $cfg['Servers'][4]['password']);
>>
>> it works fine.  But I don't think this is right.
>>
>> Any ideas as to why this is happening?
>>
>> Thanks much!
>>
>> Eric


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




Re: [PHP] Re: problems with jsp & php

2002-12-12 Thread Chris Wesley
I'm pretty sure everyone else is as confused by your description as I am.
(Hence, I didn't answer.)  It looks like you're trying to generate
JavaScript w/ PHP, but your subject mentions JSP.  In a nutshell, I don't
know if what you're doing is over my head, or just not explained clearly.

I can man an uncomfortable assumption, though:  You mean to generate
JavaScript and JSP has nothing to do with this problem.  Try quoting your
JavaScript variable values ...

Change:
var action = ;

To:
var action = "";

... likewise with the rest of your JavaScript variables.

g.luck,
~Chris

On Thu, 12 Dec 2002, Jeff Bluemel wrote:

> somebody has to have an answer to this...
>
>
> "Jeff Bluemel" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I cannot figure out where my problem is with the following script.  I know
> > I've used this syntax successfuly in the past.  when I take out the
> > variables, and just set link to something without using php then this
> works.
> > know when I click on the form that activated the button it does nothing.
> >
> > function batch_close()
> > {
> > if (parent_window && !parent_window.closed)
> > {
> >  var action = ;
> >   var batch = ;
> >   var begin = ;
> >   var end = ;
> >   var amount = ;
> >   var link = "maintain.html?action=" + action + "&batch=" + batch +
> > "&begin=" + begin + "&end=" + end + "&amount=" + amount;
> > parent_window.document.location.href=link;
> > parent_window.focus();
> > }
> > window.close();
> > }



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




[PHP] Fw: [SMARTY] JavaScript / PHP syntax problems

2002-12-12 Thread James Johnson
My mistake for posting to the wrong list. Meant to go to php-general.

I've got it working now. There's an option in Dreamwever for escaping quotes
with % 's or not.

Jim
- Original Message -
From: "Hoffman, Geoffrey" <[EMAIL PROTECTED]>
To: "James Johnson" <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 10:20 AM
Subject: RE: [SMARTY] JavaScript / PHP syntax problems


> When you say it's not getting passed, what do you mean exactly? Forget
about
> the iframe for a sec - If you view source on the page, is it in the code
or
> not?
>
> Are you getting
> src="pgDetail.php?siteID=1"
> or
> src="pgDetail.php?siteID="
> ?
>
> Whats %22, a single or double quote? If so you only have 1 of them in the
> snippet you posted.
> Or is that a 'feature' of the listserv?
>
> You posted:
>
>
>
> -Original Message-
> From: James Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 12, 2002 11:09 AM
> To: [EMAIL PROTECTED]
> Subject: [SMARTY] JavaScript / PHP syntax problems
>
>
> Hi,
>
> I'm using Dreamweaver as my PHP editor. I'm building an app which uses
> IFRAMES to show different PHP pages. Dreamweaver has a behavior which sets
> the text of a layer to HTML code. This works fine, until I try to pass a
> variable to the PHP page which shows up in the IFRAME.
>
> Here is what I want to pass:
>
>  height="100%" scrolling="Auto" id="pgDetail" frameborder="0">
>
> This is what DW generates:
>
> onClick="MM_setTextOfLayer('holder','','%3Ciframe
> src=%22pgDetail.php?siteID=%22 name=%22pgDetail%22
> width=%22100%25%22 height=%22100%25%22 scrolling=%22Auto%22
> id=%22pgDetail%22 frameborder=%220%22%3E%3C/iframe%3E')"
>
> But the $siteID is not getting passed.
>
> Thanks,
>
> Jim Johnson
>
>


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




[PHP] Mail() Not working right

2002-12-12 Thread Tom Culpepper
I am trying to get the mail() function to work right on my system and 
while I get no PHP errors the mail is never sent.  Running on a linux 
server with PHP3 and I have confirmed that the command line mail 
function does work along with a few perl scripts that send mail as well. 
Here is the code I am using


mail("[EMAIL PROTECTED]", "testing 1234", "this is a test message");
?>

-thanks
tom


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



[PHP] Paging / Navigation Help

2002-12-12 Thread William Martell
Hello ALL.

Can anyone tell me why the number of rows is always 1 and count is the total
number of records in my database.

Thanks in Advance,
William

[snip]








0;",$db);

 //get number of rows returned
 $number_of_rows = mysql_num_rows($result);

 if ($number_of_rows != '0')
  {
 while ($myrow = mysql_fetch_array($result))
   {
  echo "\$number_of_rows is $number_of_rows";
 echo "count: ".$myrow["count"]."\n";

 }
}

?>





[/snip]


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




[PHP] changing endianness

2002-12-12 Thread Marek Kilimajer
Hello,

Does anyone know a way to change endianness of a binary string?


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




Re: [PHP] Paging / Navigation Help

2002-12-12 Thread 1LT John W. Holmes
Ummm... because that's exactly what you're asking for. Look over your code
again. COUNT(*) returns one record in one column, one row.

---John Holmes...

- Original Message -
From: "William Martell" <[EMAIL PROTECTED]>
To: "phplist" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 12, 2002 2:56 PM
Subject: [PHP] Paging / Navigation Help


> Hello ALL.
>
> Can anyone tell me why the number of rows is always 1 and count is the
total
> number of records in my database.
>
> Thanks in Advance,
> William
>
> [snip]
>
> 
> 
> 
> 
>
> 
>
> 
>
>  $db = mysql_connect("localhost", "root");
>
>  mysql_select_db("dallas", $db);
>
>  $result =  mysql_query("SELECT COUNT(*) as count FROM partscatalog having
> count >0;",$db);
>
>  //get number of rows returned
>  $number_of_rows = mysql_num_rows($result);
>
>  if ($number_of_rows != '0')
>   {
>  while ($myrow = mysql_fetch_array($result))
>{
>   echo "\$number_of_rows is $number_of_rows";
>  echo "count: ".$myrow["count"]."\n";
>
>  }
> }
>
> ?>
>
> 
> 
>
>
> [/snip]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] PHP Redirects

2002-12-12 Thread James Johnson
Hi,

In ColdFusion, I can redirect to another page with the tag . Is there an equivalent in PHP?

Thanks,

Jim Johnson


Re: [PHP] PHP Redirects

2002-12-12 Thread Richard Baskett
Sure is:

header("Location: somepage.ext");
exit;

Cheers!

Rick

"If you think you're too small to have an impact, try going to bed with a
mosquito in the room." - Anita Koddick

> From: "James Johnson" <[EMAIL PROTECTED]>
> Date: Thu, 12 Dec 2002 12:30:19 -0800
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] PHP Redirects
> 
> Hi,
> 
> In ColdFusion, I can redirect to another page with the tag  url="somepage.ext">. Is there an equivalent in PHP?
> 
> Thanks,
> 
> Jim Johnson


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




  1   2   >