Re: [PHP] PHP vs JAVA

2013-08-20 Thread PHP List
On 8/20/2013 10:00 AM, Tedd Sperling wrote:
> Hi guys:
>
> A teacher at my college made the statement that JAVA for Web Development is 
> more popular than PHP.
>
> Where can I go to prove this right or wrong -- and/or -- what references do 
> any of you have to support your answer? (sounds like a teacher, huh?)

While I don't have any references to back it up - my guess would be that
Java may be seen as more versatile in general programming terms.  A
staggering number of enterprise level web applications are built with
Java, add to that the possibility of writing Android apps with the same
knowledge.

Of course, there are many ways to make Android apps without Java - I've
written a few myself with simple HTML and Flash Builder.

I would say that, in general, the other teacher is incorrect speaking
strictly in terms of web development.  PHP has already won that crown
many times over.  That said, when I was in University, it was difficult
to find a programming class that taught anything but Java - and that was
10yrs ago now.  I chalked it up to the education bubble not being able
to see what the rest of the world is actually doing.

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



Re: [PHP] MySQL over TCP results on CLOSE_WAIT state in PHP 5.3.8

2012-03-05 Thread php-list
> > I have a MySQL server A, a server B with PHP 5.3.8 and a server C with
> > PHP 5.3.3. I'm connecting to the MySQL server on A via TCP from B and C
> > using an internal network. Server B and C use the same PHP application.
> > There are also same PHP scripts that get data from the database and then
> > calculate up to 30 minutes. I close all database connection before doing
> > the calculation to save connections (and ports) using:
> > $thread_id = mysqli_thread_id( $this->handle );
> > mysqli_kill(  $this->handle, $thread_id );
> > mysqli_close( $this->handle );
> > 
> > During a review on our servers I discovered that server B has a lot of
> > network connection in the state "CLOSE_WAIT". Server C running the same
> > PHP application has not. I see the difference that server B is using
> > mysqlnd and server C not.
> > 
> > serverB# netstat -an | grep 3306
> > tcp1  0 10.8.0.58:47455 10.8.0.1:3306  
> > CLOSE_WAIT
> > 
> > serverA# cat firewall
> > Feb 17 16:21:49 www kernel: [6587053.325075] SFW2-OUT-ERROR IN= OUT=tun0
> > SRC=10.8.0.1 DST=10.8.0.58 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF
> > PROTO=TCP SPT=3306 DPT=47455 WINDOW=0 RES=0x00 RST URGP=0
> > 
> > Does anybody have an idea why this happens? How can I avoid this or
> > investigate in this? Is this a know issue?
> 
> Is the underlying OS for servers B & C exactly the same? Down to
> kernel version (if Linux/Unix), NICs and driver version,
> configurations, etc.?  It would help if specify OS type and kernel
> version.

No, client B and C have different OS versions. You are right this can be a 
reason too. Do you have any hints how I can trace that down?

Details client B (newer OS with CLOSE_WAIT problems):
$ uname -a
Linux www3 3.1.9-1.4-default #1 SMP Fri Jan 27 08:55:10 UTC 2012 (efb5ff4) 
x86_64 x86_64 x86_64 GNU/Linux
$ mysql --version
mysql  Ver 14.14 Distrib 5.5.16, for Linux (x86_64) using readline 6.2
$ ethtool -i eth0
driver: r8169
version: 2.3LK-NAPI
firmware-version: rtl_nic/rtl8168e-2.fw
bus-info: :04:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes

Details client C:
$ uname -a
Linux www13 2.6.34.10-0.4-default #1 SMP 2011-10-19 22:16:41 +0200 x86_64 
x86_64 x86_64 GNU/Linux
$ mysql --version
mysql  Ver 14.14 Distrib 5.1.57, for suse-linux-gnu (x86_64) using readline 
6.1
$ ethtool -i eth0
driver: r8169
version: 2.3LK-NAPI
firmware-version: 
bus-info: :04:00.0

Server A:
Linux www 3.1.9-1.4-default #1 SMP Fri Jan 27 08:55:10 UTC 2012 (efb5ff4) 
x86_64 x86_64 x86_64 GNU/Linux
$ mysql --version
mysql  Ver 14.14 Distrib 5.5.16, for Linux (x86_64) using readline 6.2
$ ethtool -i eth0
driver: r8169
version: 2.3LK-NAPI
firmware-version: rtl_nic/rtl8168e-2.fw
bus-info: :04:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: yes

I also have set wait_timeout 45 in my.cnf on server A and mysqli.reconnect On 
on client B and C in php.ini.

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



[PHP] MySQL over TCP results on CLOSE_WAIT state in PHP 5.3.8

2012-02-27 Thread php-list
Hi,

I have a MySQL server A, a server B with PHP 5.3.8 and a server C with PHP 
5.3.3. I'm connecting to the MySQL server on A via TCP from B and C using an 
internal network. Server B and C use the same PHP application. There are also 
same PHP scripts that get data from the database and then calculate up to 30 
minutes. I close all database connection before doing the calculation to save 
connections (and ports) using:
$thread_id = mysqli_thread_id( $this->handle );
mysqli_kill(  $this->handle, $thread_id );
mysqli_close( $this->handle );

During a review on our servers I discovered that server B has a lot of network 
connection in the state "CLOSE_WAIT". Server C running the same PHP 
application has not. I see the difference that server B is using mysqlnd and 
server C not.

serverB# netstat -an | grep 3306
tcp1  0 10.8.0.58:47455 10.8.0.1:3306   CLOSE_WAIT

serverA# cat firewall
Feb 17 16:21:49 www kernel: [6587053.325075] SFW2-OUT-ERROR IN= OUT=tun0 
SRC=10.8.0.1 DST=10.8.0.58 LEN=40 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=TCP 
SPT=3306 DPT=47455 WINDOW=0 RES=0x00 RST URGP=0 

Does anybody have an idea why this happens? How can I avoid this or 
investigate in this? Is this a know issue?

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



Re: [PHP] OT- why is network solutions more than godaddy?

2007-08-03 Thread Eric Holt (PHP List)

How about a middle-of-the-road solution?

www.PairNIC.com

The domain services of the very good webhost, Pair Networks.  I've been 
with their hosting solutions since 1998, and with their domain 
registration services since whenever it opened (5 years ago, I spose).


Not the cheapest, not the most expensive, but great support, and great 
value of services that comes along with the registration.


Plus, its Pair!  (No, I dont work for them, just a very happy customer).


--Eric







Warren Vail wrote:

Does anyone know the relationship between goDaddy.com and
WildWestDomains.com?

:W 


-Original Message-
From: Rahul Sitaram Johari [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 03, 2007 12:47 PM

To: Austin Denyer; PHP
Subject: Re: [PHP] OT- why is network solutions more than godaddy?


Interesting read - although the whole thing is trumpeted upon their policy
"We have the right to terminate a service at any time without any reason" -
Well apparently, Network Solutions and most "Major" Domain Name Service
vendors have a similar policy - so I wouldn't be surprised to see a
"www.networkproblems.com" website one day.

:P


On 8/3/07 3:12 PM, "Austin Denyer" <[EMAIL PROTECTED]> wrote:


Robert Cummings wrote:

On Fri, 2007-08-03 at 14:22 -0400, blackwater dev wrote:
I have to register a bunch of names and am trying to figure out why 
I would pay $35 when I can just pay $9 at godaddy.  Does godaddy own 
it and I lease it from them???

No, you own it.

But, don't make your final decision until you've read this:

http://nodaddy.com

Regards,
Austin.



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



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



Re: [PHP] Re: Dealing with ImageMagick from PHP

2007-07-29 Thread Eric Holt (PHP List)
Al:  Thanks, sorry for messaging this to the list.  Can you point me in 
the direction of the official phpList forum?


Thanks a ton,
 --Eric





Al wrote:

You'd be far better off asking your questions on the phpList forum.

There are a number of hints on the forum for speeding up things. Plus, 
look in the examples section.


Eric Holt (PHP List) wrote:

Hello everyone.  This is my first post to the list, so bare with me :)

I have written an application for a client that is used in the Event 
Photography business.  It handles taking photographs, categorizing 
them, making thumbnails of them, and allows parents(customers) to view 
the photos and order them.  It runs on LAMP, and it really works great.


For the past two years, we've used ImageMagick v4.2.9 to process the 
thumbnails.  Image quality was decent enough, but the main reason for 
4.2.9 was SPEED.  In my testing, 4.2.9 was quite a bit faster than the 
lastest releases (in the 6.x.x series).  Anyway -- the clients decided 
they wanted me to do some work on the image quality, so I finally 
decided to move up to ImageMagick v.6.3.4.


Right now, I call ImageMagick from a "exec" call in PHP.  When I first 
wrote the application, it was the quickest and easiest way for me to 
get it working.  Command-line ImageMagick is pretty simple.


So, with ImageMagick 6.3.4, with the sharpening and compression I'm 
now using, the clients are absolutely in love with the thumbnail 
quality -- even though the amount of time it takes to make the 
thumbnails is much longer.  They've asked if anything can be done 
about that, but I think I've optimized the shell script as much as 
possible.


Now, after that long rambling... My question is this:  Would I see a 
big speed improvement by using the ImageMagick extension built into 
PHP (MagicWand, is it called?)?  I'd hate to spend all the time 
recoding the application to work with MagicWand, only to find out that 
I dont end up with any performance increase -- or worse of all, a 
decrease.


I wasnt convinced either way, from the Googling I had done on the 
subject, so I thought I would post the question to the PHP list.


A little more background here, before I go:  PHP iterates through a 
directory of full-sized images, directly out of the camera, and 
"exec"'s a shell script "thumbcreation.sh" with the details of what 
ImageMagick needs to do, and where it needs to store the new 
thumbnails.  The script calls convert, which creates a medium sized 
thumbnail (333x500), and then from that creates a small thumbnail 
(80x120) from the medium. Then, the script calls composite, where is 
adds a watermark to the medium size thumbnail, and saves it in the 
watermarked directory.


In my initial testing, years ago, I found that ImageMagick v4.2.9 was 
faster than the internal GD library... however, I havnt touched GD 
since my initial testing.  Perhaps GD would be faster now than IM 
v6.3.4(?).


Okay, I've rambled on plenty now, for my first post.  I greatly 
appreciate any advice anyone on the list could provide.



THANKS!!!
 --Eric




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



[PHP] Dealing with ImageMagick from PHP

2007-07-28 Thread Eric Holt (PHP List)

Hello everyone.  This is my first post to the list, so bare with me :)

I have written an application for a client that is used in the Event 
Photography business.  It handles taking photographs, categorizing them, 
making thumbnails of them, and allows parents(customers) to view the 
photos and order them.  It runs on LAMP, and it really works great.


For the past two years, we've used ImageMagick v4.2.9 to process the 
thumbnails.  Image quality was decent enough, but the main reason for 
4.2.9 was SPEED.  In my testing, 4.2.9 was quite a bit faster than the 
lastest releases (in the 6.x.x series).  Anyway -- the clients decided 
they wanted me to do some work on the image quality, so I finally 
decided to move up to ImageMagick v.6.3.4.


Right now, I call ImageMagick from a "exec" call in PHP.  When I first 
wrote the application, it was the quickest and easiest way for me to get 
it working.  Command-line ImageMagick is pretty simple.


So, with ImageMagick 6.3.4, with the sharpening and compression I'm now 
using, the clients are absolutely in love with the thumbnail quality -- 
even though the amount of time it takes to make the thumbnails is much 
longer.  They've asked if anything can be done about that, but I think 
I've optimized the shell script as much as possible.


Now, after that long rambling... My question is this:  Would I see a big 
speed improvement by using the ImageMagick extension built into PHP 
(MagicWand, is it called?)?  I'd hate to spend all the time recoding the 
application to work with MagicWand, only to find out that I dont end up 
with any performance increase -- or worse of all, a decrease.


I wasnt convinced either way, from the Googling I had done on the 
subject, so I thought I would post the question to the PHP list.


A little more background here, before I go:  PHP iterates through a 
directory of full-sized images, directly out of the camera, and "exec"'s 
a shell script "thumbcreation.sh" with the details of what ImageMagick 
needs to do, and where it needs to store the new thumbnails.  The script 
calls convert, which creates a medium sized thumbnail (333x500), and 
then from that creates a small thumbnail (80x120) from the medium. 
Then, the script calls composite, where is adds a watermark to the 
medium size thumbnail, and saves it in the watermarked directory.


In my initial testing, years ago, I found that ImageMagick v4.2.9 was 
faster than the internal GD library... however, I havnt touched GD since 
my initial testing.  Perhaps GD would be faster now than IM v6.3.4(?).


Okay, I've rambled on plenty now, for my first post.  I greatly 
appreciate any advice anyone on the list could provide.



THANKS!!!
 --Eric

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



Re: [PHP] Looking for CMS advice

2005-08-23 Thread Kim Steinhaug \(php list\)
You are referring to this page : 
http://www.opensourcecms.com/

Regards,
Kim Steinhaug
- - - - - - - - - - - - - 
http://www.easywebshop.no/


- Original Message - 
From: "Richard Lynch" <[EMAIL PROTECTED]>
To: "Erik Gyepes" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, August 23, 2005 9:28 AM
Subject: Re: [PHP] Looking for CMS advice


> On Mon, August 22, 2005 3:48 am, Erik Gyepes wrote:
> > Zachary Kessin wrote:
> >
> >> I am about to start on a project that seems like it would be right
> >> for
> >> a CMS system. It will be about 80% rather boring stuff with about
> >> 20%
> >> custom database work. I have looked at XOOPS and a few others.
> >> However
> >> I can not seem to find one rather important thing about XOOPS. I
> >> understand how to use a module that someone else wrote, but I have
> >> not
> >> found any documentation on how to build my own blocks or application
> >> components.
> >>
> >> I am not yet committed to XOOPS, so if there is different system
> >> that
> >> would be better that could work as well
> 
> There is a pretty cool site "out there" that lets you kick the tires
> on a BUNCH of different PHP/MySQL CMS products/projects.
> 
> opencms.org or something like that.
> 
> I always have a tough time finding it with Google and whatnot, but
> it's there.
> 
> Anyway, they basically installed a couple dozen CMS systems, and you
> can set yourself up with your own sandbox install on THEIR server with
> just a click of a button, then administer it and play with it, and
> then they wipe it out in about 2 hours.
> 
> So you get a chance to play with it to see if you like each CMS, and
> you've got 2 hours to check it out -- Or more, since you can start
> over with a new sandbox.  They just don't want you to try to run your
> site through theirs.
> 
> I doubt that it will actually let you write/upload arbitrary PHP for
> the missing 20%, but they MIGHT have some examples or user comments on
> their site on these issues, and at least you can play with the 80% to
> see if the features you need for that part are there.
> 
> HTH
> 
> -- 
> Like Music?
> http://l-i-e.com/artists.htm
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



Re: [PHP] Files passing through

2005-08-23 Thread Kim Steinhaug \(php list\)
I'm using this method, works fine with 50mb+ files : 

if( $fd  = fopen ($filepath, 'r')){
  while(!feof($fd)) {
$buffer = fread($fd, 2048);
print $buffer;
  }
  fclose ($fd);
  exit;
}

Regards,
Kim Steinhaug
- - - - - - - - -
www.easycms.no

- Original Message - 
From: "Evert | Rooftop" <[EMAIL PROTECTED]>
To: "PHP-Users" 
Sent: Monday, August 22, 2005 9:30 PM
Subject: [PHP] Files passing through


> Hi People,
> 
> I want to use a PHP script to pass through a file to the browser [ right 
> after some processing ].
> What is the fastest way to do this? I know 
> echo(file_get_contents('myfile')); is not a good idea ;)
> 
> Is fpassthrough the right choice?
> maybe virtual, so it won't go through php but apache does the job?
> there's also readfile
> 
> Another question, how seriously does this affect the performance in 
> comparison to let apache handle it. Is the difference big at MB+ files? 
> or only significant when dealing with a lot of tiny files?
> 
> Thanks for your help!
> Evert
> 
> -- 
> 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] AJAX coding and Sesisons

2005-08-22 Thread Kim Steinhaug \(php list\)
I have done this quite a few times lately, you shouldn't 
worry. Just have your session_start() and login security 
on the pages that you access with javascript aswell, they 
will have the same security as any other page.

The sessionID is used for all requests to the server
from the webbrowser, also from within a page from
javascript. Which again means that you can use your 
validation scheeme on theese files aswell. 

As a side note, if your on a page the user spends much time
on, having some Ajax functionality accually works like a
little heartbeat / pulse, resetting the session time 
so that the user infact can spend more time on the same
webpage without having to do some movement, :D


regards,
Kim Steinhaug
- - - - - - - 
www.steinhaug.com


- Original Message - 
From: "Bret Walker" <[EMAIL PROTECTED]>
To: "PHP-Users" 
Cc: "Ivan Meyers" <[EMAIL PROTECTED]>
Sent: Monday, August 22, 2005 9:57 PM
Subject: [PHP] AJAX coding and Sesisons


> I'm authoring a web app, and I want to use some AJAX functionality.
> 
> The users log in via PHP, and they are verified page to page by a
> session variable (which stores their username).
> 
> I want to write some PHP that alters a database, but I want to be sure
> that only authorized users can access the page, and that they can only
> delete items associated with their username (in the table).
> 
> I want to have javascript asynchronously call the php page, but I don't
> know how to protect this page.  I don't think I can rely on my session
> variable, because the user won't be directly calling the page.
> 
> I don't want user A to be able to submit a request to delete an item
> belonging to user B.  How can I secure this setup while still using AJAX?
> 
> Thanks,
> Bret
> 

Re: [PHP] session_start(), Pragma and Cache-control headers

2005-08-22 Thread Kim Steinhaug \(php list\)
I solved the problem after a while, seems it had been
reacently debated in the bug pages within php, to remove
headers which are added by the session_start(); you can 
add the following :

ini_set('session.use_cookies', false);
session_cache_limiter('');

Kind regards,
Kim Steinhaug
- - - - - - - - -
www.steinhaug.com


- Original Message - 
From: "Kim Steinhaug (php list)" <[EMAIL PROTECTED]>
To: 
Sent: Monday, August 22, 2005 7:01 PM
Subject: [PHP] session_start(), Pragma and Cache-control headers


> Hello,
> 
> I'm working on a downbload script which serves M3U
> files (Winamp playlist files) through a PHP file
> like this :
> 
> somepath/download.m3u.php?id=2
> 
> Then in the PHP script I generate the M3U file, and
> serve up the headers I want. Swell so far, but a
> little problem appears.
> 
> The downloads are for members only, and therefor I
> need to check if the user is logged in, I do this by
> sessions and therefore I add a session_start() at the
> start of my file. When I do this some headers are
> added to the file, namely :
> 
> Set-Cookie: PHPSESSID=xxx; path=/
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> 
> Theese headers are not needed, and I dont want them
> either, exept I cant seem to get rid of them since I
> need the session_start() in the beginning of the file.
> 
> Sure, I could wish for a function unset_potensial_header(pragma);
> 
> I guess there are no way to remove theese unwanted headers?
> Yesterday I had to give up another problem, but luckily I
> found the answer here :  http://bugs.php.net/bug.php?id=33057
> 
> So to sum it up :
> How can I remove the Cache-Control and Pragma headers?
> 
> And Im not looking for this answer :
>   header('Pragma: ');
>   header('Cache-control: ');
> 
> The headers are still sendt, exept they are empty, doesnt look
> like a nice sollution for a production environment.
> 
> Kind regards,
> Kim Steinhaug
> - - - - - - - - -
> www.steinhaug.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



[PHP] session_start(), Pragma and Cache-control headers

2005-08-22 Thread Kim Steinhaug \(php list\)
Hello,

I'm working on a downbload script which serves M3U
files (Winamp playlist files) through a PHP file
like this :

somepath/download.m3u.php?id=2

Then in the PHP script I generate the M3U file, and
serve up the headers I want. Swell so far, but a
little problem appears.

The downloads are for members only, and therefor I
need to check if the user is logged in, I do this by
sessions and therefore I add a session_start() at the
start of my file. When I do this some headers are
added to the file, namely :

Set-Cookie: PHPSESSID=xxx; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache

Theese headers are not needed, and I dont want them
either, exept I cant seem to get rid of them since I
need the session_start() in the beginning of the file.

Sure, I could wish for a function unset_potensial_header(pragma);

I guess there are no way to remove theese unwanted headers?
Yesterday I had to give up another problem, but luckily I
found the answer here :  http://bugs.php.net/bug.php?id=33057

So to sum it up :
How can I remove the Cache-Control and Pragma headers?

And Im not looking for this answer :
  header('Pragma: ');
  header('Cache-control: ');

The headers are still sendt, exept they are empty, doesnt look
like a nice sollution for a production environment.

Kind regards,
Kim Steinhaug
- - - - - - - - -
www.steinhaug.com

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



RE: [PHP] Help With Error

2004-10-19 Thread php-list
Pablo,

Thanks for responding. I found out what the problem was. There was an
argument that was empty (i.e. empty string) in the add_cat() method. Thanks
for your help, I really appreciate it.  :)

[snip]
Notice: Undefined index: 0 in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
77
[/snip]

It's telling you that $data['0'], which is used twice in your query, is not
a valid index (ie. it doesn't exist) for the $data array.

Why don't you dump the $data array after it is set to see where the problem
is:

$data = $this->get_cat_coord($child);
print_r($data);
die();

Take a look at what comprises the $data array and you should find your
problem.

HTH,

Pablo

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 17, 2004 8:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help With Error

Hello Everyone,

I keep getting the following errors in my class and I don't know why. Maybe
something has changed in PHP 5.x that I don't know about? Here are the
errors and the methods of that class:

---
Notice: Undefined index: 0 in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
77

Notice: Undefined index: 0 in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
77

Fatal error: Cannot use object of type DB_Error as array in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
46
---


Line 77 is the 5th line of the following function:


---
function get_ancestors($child) {
// get child's lft & rgt values
$data = $this->get_cat_coord($child);
// get ancestors of child based on child's lft and rgt values
$tree = $this->fetch('SELECT * FROM tree WHERE lft <
'.$data['0']['lft'].' AND rgt > '.$data['0']['rgt'].' ORDER BY lft ASC');
return $tree;
}
---


Line 46 is the 3rd line of the following function


---
function get_parent($child) {
$parent = $this->get_ancestors($child);
$parent = $parent[count($parent)-1];
if (count($parent) > 0) {
return $parent;
} else {
return 0;
}
}
---


I am calling the following function which calls the other two child
functions above:


---
function add_cat($cat, $addAfterCat_name='', $addAfterCat_lft='') {
if (!$this->exists_in_category($cat, $addAfterCat_name)) {
$db = $this->dbconnect();
if ($cat != '' && $addAfterCat_lft != '') {
$db->query("UPDATE tree SET rgt=rgt+2 WHERE
rgt>".$addAfterCat_lft);
$db->query("UPDATE tree SET lft=lft+2 WHERE
lft>".$addAfterCat_lft);
$add_query = "INSERT INTO tree SET lft='";
$add_query .= $addAfterCat_lft+1;
$add_query .= "', rgt='";
$add_query .= $addAfterCat_lft+2;
$add_query .= "', category='$cat'";
echo $add_query;
$db->query($add_query);
$message = 'Category Added To Tree';
} elseif ($cat != '' && $addAfterCat_lft == '') {
$message = 'Please Input A Category To Add';
} elseif ($cat == '' && $addAfterCat_lft != '') {
$message = 'Please Choose A Category To Add This Category
To';
}
} else {
$message = 'Category Already Exists In The Parent Category';
}
return $message;
}
---

What am I doing wrong?

-- 
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] Help With Error

2004-10-17 Thread php-list
Hello Everyone,

I keep getting the following errors in my class and I don't know why. Maybe
something has changed in PHP 5.x that I don't know about? Here are the
errors and the methods of that class:

---
Notice: Undefined index: 0 in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
77

Notice: Undefined index: 0 in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
77

Fatal error: Cannot use object of type DB_Error as array in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
46
---


Line 77 is the 5th line of the following function:


---
function get_ancestors($child) {
// get child's lft & rgt values
$data = $this->get_cat_coord($child);
// get ancestors of child based on child's lft and rgt values
$tree = $this->fetch('SELECT * FROM tree WHERE lft <
'.$data['0']['lft'].' AND rgt > '.$data['0']['rgt'].' ORDER BY lft ASC');
return $tree;
}
---


Line 46 is the 3rd line of the following function


---
function get_parent($child) {
$parent = $this->get_ancestors($child);
$parent = $parent[count($parent)-1];
if (count($parent) > 0) {
return $parent;
} else {
return 0;
}
}
---


I am calling the following function which calls the other two child
functions above:


---
function add_cat($cat, $addAfterCat_name='', $addAfterCat_lft='') {
if (!$this->exists_in_category($cat, $addAfterCat_name)) {
$db = $this->dbconnect();
if ($cat != '' && $addAfterCat_lft != '') {
$db->query("UPDATE tree SET rgt=rgt+2 WHERE
rgt>".$addAfterCat_lft);
$db->query("UPDATE tree SET lft=lft+2 WHERE
lft>".$addAfterCat_lft);
$add_query = "INSERT INTO tree SET lft='";
$add_query .= $addAfterCat_lft+1;
$add_query .= "', rgt='";
$add_query .= $addAfterCat_lft+2;
$add_query .= "', category='$cat'";
echo $add_query;
$db->query($add_query);
$message = 'Category Added To Tree';
} elseif ($cat != '' && $addAfterCat_lft == '') {
$message = 'Please Input A Category To Add';
} elseif ($cat == '' && $addAfterCat_lft != '') {
$message = 'Please Choose A Category To Add This Category
To';
}
} else {
$message = 'Category Already Exists In The Parent Category';
}
return $message;
}
---

What am I doing wrong?

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



RE: [PHP] Meaningful Subject

2004-10-11 Thread php-list


-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 11, 2004 8:09 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP]

On Monday 11 October 2004 19:41, [EMAIL PROTECTED] wrote:
> Never mind guys, I figured it out. I appreciate your help. Thanks for
> everything!

Next time you start a thread please give it a meaningful subject.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The three best things about going to school are June, July, and August.
*/

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

2004-10-11 Thread php-list
Never mind guys, I figured it out. I appreciate your help. Thanks for
everything!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 10, 2004 10:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] 

Thanks to all of you for your explanation of my method. Minuk, thanks for
the detailed explanation, it really helps me understand what I'm doing
wrong.

Now I have one more problem. When the $children array is empty, it returns a
10 instead of a 0. Why is that? Here's the method again with the recommended
improvements you guys provided:



function get_children($parent) {
// FORMULA: rgt value of first child + 1 = left value of second
child
//  check rgt value of parent against each child (rgt + 1).
//  If rgt valueof child plus 1 equals rgt value of parent
then
//  that child is the last child of the parent.
$parent_coord = tree::get_item_coord($parent);
$descendants = $this->get_descendants($parent);
$children = array();
for ($i = 0; $i < count($descendants); $i++) {
if ((empty($children)) && (($parent_coord['0']['lft'] + 1) ==
$descendants[$i]['lft'])) {
$children[] = $descendants[$i]; // found first child
}
elseif (($children[count($children)-1]['rgt'] + 1 ==
$descendants[$i]['lft']) && $children[count($children)-1]['rgt'] + 1 !=
$parent_coord['0']['rgt']) {
$children[] = $descendants[$i]; // find next children
}
}
if (count($children)>0) {
return $children;
} else {
return 0;
}
}



-Original Message-
From: Minuk Choi [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 10, 2004 1:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] 

I can tell you from a quick glance that you have the following case

function X()
{
if ()
{
$children=...
}
elseif ()
{
$children=...
}
return $children;
}

Have you tried giving $children an initial value, such as

function X()
{
$children = array();

if ()
{
$children[]=...
}
elseif ()
{
$children[]=...
}

if (count($children)>0)
return $children;
return 0;
}

I may be getting a head of myself, but the

$children[]=...

line adds the $descendants into the ARRAY variable, $children.  Unless I'm 
wrong, you MUST declare $children as an ARRAY FIRST(see first line of the 
function, "$children=array();")

Secondly, if you want the function to return 0 if no $descendant entries are

added to $children, you must check to see if the $children ARRAY is EMPTY.

if (count($children)>0)
return $children;

that line basically says if ARRAY variable $children has more than 0 
elements, return that ARRAY.

Finally,

return 0;

if the ARRAY variable $children has 0 elements(count($children) returns the 
number of elements in ARRAY variable, $children), "return $children" is NOT 
executed.  The next line is "return 0".

This is a lazy way of writing the following :

if (count($children)>0)
return $children;
else
return 0;

If it seems like I'm explaining too much, it's because from the code 
snipplet you provided, it sounds like you're a novice to PHP... and you did 
write, '...explain this error to me'. :-P


Hope This Helps
-Minuk

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 09, 2004 10:29 PM
Subject: [PHP]

> Hello everyone,
>
> I'm hoping you guys can help me with this error. Here's what I'm getting:
>
> Notice: Undefined variable: children in
> L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
> 58
>
> This error occurs only when the class's method outputs $children as having

> a
> value of zero. Below is the class. I want it to return zero but I don't 
> want
> this error. Do I need to change my error settings in my php.ini file? The
> error level is currently set to E_ALL and I'm using PHP 5.0.1. If at all
> possible, I want to keep this error setting at high because I want
> everything to be coded strictly. What did I do wrong in my class and how 
> can
> I fix it to where it doesn't output an error when a class's method returns

> a
> value of zero? Here's the class:
>
>function get_children($parent) {
>$parent_coord = tree::get_item_coord($parent);
>$descendants = $this->get_descendants($parent);
>for ($i = 0; $i < count($descendants); $i++) {
>if ((empty($children)) && (($parent_coord['0']['lft'] + 1) ==
> $descendants[$i]['lft'])) {
>$children[] = $descendants[$i]; // found first child
>}
>elseif (($children[count($children)-1]['rgt'] + 1 ==
> $descendants[$i]['lft']) && $children[count($children)-1]['rgt'] + 1 !=
> $parent_coord['0']['rgt']) {
>

[PHP]

2004-10-10 Thread php-list
Thanks to all of you for your explanation of my method. Minuk, thanks for
the detailed explanation, it really helps me understand what I'm doing
wrong.

Now I have one more problem. When the $children array is empty, it returns a
10 instead of a 0. Why is that? Here's the method again with the recommended
improvements you guys provided:



function get_children($parent) {
// FORMULA: rgt value of first child + 1 = left value of second
child
//  check rgt value of parent against each child (rgt + 1).
//  If rgt valueof child plus 1 equals rgt value of parent
then
//  that child is the last child of the parent.
$parent_coord = tree::get_item_coord($parent);
$descendants = $this->get_descendants($parent);
$children = array();
for ($i = 0; $i < count($descendants); $i++) {
if ((empty($children)) && (($parent_coord['0']['lft'] + 1) ==
$descendants[$i]['lft'])) {
$children[] = $descendants[$i]; // found first child
}
elseif (($children[count($children)-1]['rgt'] + 1 ==
$descendants[$i]['lft']) && $children[count($children)-1]['rgt'] + 1 !=
$parent_coord['0']['rgt']) {
$children[] = $descendants[$i]; // find next children
}
}
if (count($children)>0) {
return $children;
} else {
return 0;
}
}



-Original Message-
From: Minuk Choi [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 10, 2004 1:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] 

I can tell you from a quick glance that you have the following case

function X()
{
if ()
{
$children=...
}
elseif ()
{
$children=...
}
return $children;
}

Have you tried giving $children an initial value, such as

function X()
{
$children = array();

if ()
{
$children[]=...
}
elseif ()
{
$children[]=...
}

if (count($children)>0)
return $children;
return 0;
}

I may be getting a head of myself, but the

$children[]=...

line adds the $descendants into the ARRAY variable, $children.  Unless I'm 
wrong, you MUST declare $children as an ARRAY FIRST(see first line of the 
function, "$children=array();")

Secondly, if you want the function to return 0 if no $descendant entries are

added to $children, you must check to see if the $children ARRAY is EMPTY.

if (count($children)>0)
return $children;

that line basically says if ARRAY variable $children has more than 0 
elements, return that ARRAY.

Finally,

return 0;

if the ARRAY variable $children has 0 elements(count($children) returns the 
number of elements in ARRAY variable, $children), "return $children" is NOT 
executed.  The next line is "return 0".

This is a lazy way of writing the following :

if (count($children)>0)
return $children;
else
return 0;

If it seems like I'm explaining too much, it's because from the code 
snipplet you provided, it sounds like you're a novice to PHP... and you did 
write, '...explain this error to me'. :-P


Hope This Helps
-Minuk

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, October 09, 2004 10:29 PM
Subject: [PHP]

> Hello everyone,
>
> I'm hoping you guys can help me with this error. Here's what I'm getting:
>
> Notice: Undefined variable: children in
> L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
> 58
>
> This error occurs only when the class's method outputs $children as having

> a
> value of zero. Below is the class. I want it to return zero but I don't 
> want
> this error. Do I need to change my error settings in my php.ini file? The
> error level is currently set to E_ALL and I'm using PHP 5.0.1. If at all
> possible, I want to keep this error setting at high because I want
> everything to be coded strictly. What did I do wrong in my class and how 
> can
> I fix it to where it doesn't output an error when a class's method returns

> a
> value of zero? Here's the class:
>
>function get_children($parent) {
>$parent_coord = tree::get_item_coord($parent);
>$descendants = $this->get_descendants($parent);
>for ($i = 0; $i < count($descendants); $i++) {
>if ((empty($children)) && (($parent_coord['0']['lft'] + 1) ==
> $descendants[$i]['lft'])) {
>$children[] = $descendants[$i]; // found first child
>}
>elseif (($children[count($children)-1]['rgt'] + 1 ==
> $descendants[$i]['lft']) && $children[count($children)-1]['rgt'] + 1 !=
> $parent_coord['0']['rgt']) {
>$children[] = $descendants[$i]; // find next children
>}
>}
>return $children;
>}
>
>
> Thanks in advance to anyone that can explain this error to me.
>
> Nilaab
>
> -- 
> PHP General Mailing List (http://www

[PHP]

2004-10-09 Thread php-list
Hello everyone,

I'm hoping you guys can help me with this error. Here's what I'm getting:

Notice: Undefined variable: children in
L:\localhost\catalog\catalog_0.1.0\includes\classes\tree.class.php on line
58

This error occurs only when the class's method outputs $children as having a
value of zero. Below is the class. I want it to return zero but I don't want
this error. Do I need to change my error settings in my php.ini file? The
error level is currently set to E_ALL and I'm using PHP 5.0.1. If at all
possible, I want to keep this error setting at high because I want
everything to be coded strictly. What did I do wrong in my class and how can
I fix it to where it doesn't output an error when a class's method returns a
value of zero? Here's the class:

function get_children($parent) {
$parent_coord = tree::get_item_coord($parent);
$descendants = $this->get_descendants($parent);
for ($i = 0; $i < count($descendants); $i++) {
if ((empty($children)) && (($parent_coord['0']['lft'] + 1) ==
$descendants[$i]['lft'])) {
$children[] = $descendants[$i]; // found first child
}
elseif (($children[count($children)-1]['rgt'] + 1 ==
$descendants[$i]['lft']) && $children[count($children)-1]['rgt'] + 1 !=
$parent_coord['0']['rgt']) {
$children[] = $descendants[$i]; // find next children
}
}
return $children;
}


Thanks in advance to anyone that can explain this error to me.

Nilaab

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



[PHP] Host for Mod PHP5

2004-09-16 Thread php-list
Hello everyone,

 

I know this is going to be tough but I need a hosting company that supports
PHP5, has unlimited disk space and a good amount of bandwidth with a
decently fast connection for a decent price. I realize that this might be
rare, but is anyone offering such a package like this anywhere? My client
doesn't want a dedicated server because it costs too much for him at the
moment. He wants to build a music website where people can download free
music from. The music is recorded by him and he has artists that are eager
to get their music out there into the public. Any suggestions on a temporary
shared hosting company for him? Any help would be appreciated.

 

Nilaab



RE: [PHP] Help With PEAR::DB Connection

2004-09-12 Thread php-list
Jim,

Thank you. Problem solved thanks to you. The moment you said that PEAR::DB
is not finding the MySQL extention I realized that the extension in php.ini
hasn't been commented out and the extension folder had not been recognized
by PHP. I forgot we had to do that in PHP5. Everything is working like a
charm now. I really appreciate your time and concern.

Nilaab


P.S. -- And sorry, I'm using Windows XP as the development environment and
Linux as the server. The Windows OS is where I was having the problem.
Thanks again...


-Original Message-
From: James Kaufman [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 11, 2004 7:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Help With PEAR::DB Connection

On Sat, Sep 11, 2004 at 01:48:43AM -0500, [EMAIL PROTECTED] wrote:
> Hello everyone,
> 
> I have a problem connecting to the Database. When I execute the code at
the
> bottom, it gives me this message: "DB Error: extension not found". It sees
> the DB file and the parameters are correct. I checked the include path and
> it was correct. Did I do something wrong? Any help would be greatly
> appreciated. Thank you.
> 
> 
> require_once 'DB.php';
> $user = 'foo';
> $pass = 'bar';
> $host = 'localhost';
> $db_name = 'clients_db';
> $dsn = "mysql://$user:[EMAIL PROTECTED]/$db_name";
> $db = DB::connect($dsn);
> if (DB::isError($db)) {
> die ($db->getMessage());
> }
> 
> -- Nilaab
> 

The message 'extension not found' means that PEAR couldn't find the mysql db
extension. Hmm. In cases like this, create a phpinfo.php file as documented
on
this list and see what shows up. Or, you can type at the command prompt: php
-i, then look for the MySQL extension in the output.

Also, you neglected to tell us what OS you are running, etc.

-- 
Jim Kaufman
Linux Evangelist
public key 0x6D802619
---
A dog teaches a boy fidelity, perseverance, and to turn around three
times before lying down.
-- Robert Benchley

-- 
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] Help With PEAR::DB Connection

2004-09-10 Thread php-list
Hello everyone,

I have a problem connecting to the Database. When I execute the code at the
bottom, it gives me this message: "DB Error: extension not found". It sees
the DB file and the parameters are correct. I checked the include path and
it was correct. Did I do something wrong? Any help would be greatly
appreciated. Thank you.


require_once 'DB.php';
$user = 'foo';
$pass = 'bar';
$host = 'localhost';
$db_name = 'clients_db';
$dsn = "mysql://$user:[EMAIL PROTECTED]/$db_name";
$db = DB::connect($dsn);
if (DB::isError($db)) {
die ($db->getMessage());
}



-- Nilaab

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



RE: [PHP] PHP5 - How Do I Let Users Download Music Files?

2004-09-05 Thread php-list
Thanks Anders and Daniel. Daniel, I like your approach. I want to make it as
secure as possible. I'm going to place the files outside the web directory
and use authentication to approve that the user can download some particular
song. I didn't know you could do a forced download. I will definitely have
to try that. Thanks again.

Nilaab


-Original Message-
From: Daniel Schierbeck [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 05, 2003 5:45 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP5 - How Do I Let Users Download Music Files?

[EMAIL PROTECTED] wrote:

> Hello everyone,
> 
>  
> 
> I want to build a music site, all copyrights intact, and I want users to
be
> able to download mp3 or realplayer files using a one-click link. When they
> click on a link they will simply be given a typical download window to
save
> that music file. How do I go about doing that and how should my file
> structure work? What should the link include? Is it possible to just say,
> for example, http://somesite.com/music/something.mp3?
If you want more control over the files you could have the mp3's in a 
private directory, then using PHP to force a download. There are some 
other threads about the Content-Type header, which is probably what 
you're looking for

Imagine that your file, 3416.mp3 is in /songs. 3416 is the song ID, so 
you can grab info such as artist, album and song name from a DB. Below 
is download.php, to download 3416.mp3, you should type 
download.php?file=3416





> Also, if I wanted them
> to listen to streamed music does PHP have any specialized functions I
could
> use to achieve that? 

You should take a look at the Ming library and the mp3 stream function 
(http://www.php.net/manual/en/function.swfmovie.streammp3.php). It's a 
bit tricky though, but i can't think of anything else.

-- 
Daniel Schierbeck

-- 
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] PHP5 - How Do I Let Users Download Music Files?

2004-09-04 Thread php-list
Hello everyone,

 

I want to build a music site, all copyrights intact, and I want users to be
able to download mp3 or realplayer files using a one-click link. When they
click on a link they will simply be given a typical download window to save
that music file. How do I go about doing that and how should my file
structure work? What should the link include? Is it possible to just say,
for example, http://somesite.com/music/something.mp3? Also, if I wanted them
to listen to streamed music does PHP have any specialized functions I could
use to achieve that? I just need some direction. Any help would be
appreciated. Thank you.

 

Nilaab

 



RE: [PHP] Is javascript enable?

2004-08-25 Thread php-list
Try phpsniff at http://phpsniff.sourceforge.net/. It not only detects
javascript using PHP, but many other things as well. You will wonder how you
lived without it. It's pretty cool...

Navid

-Original Message-
From: Thomas Goyne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 25, 2004 8:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Is javascript enable?

On Wed, 25 Aug 2004 16:36:41 -0300, Marcos Thiago M. Fabis  
<[EMAIL PROTECTED]> wrote:

>
> i share your opinion, but belive-me when i say that this situation  
> requires
> it.
>

It is quite literally impossible to enforce security with JS.  Anything  
you try to do I could get around with Proxomitron and/or Opera.
-- 

Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

-- 
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] For Loop Problems

2004-07-28 Thread php-list
Hello Everyone,

I'm building a hotel management system and I can't seem to figure out why my
for() loop doesn't work the way it should. I'm using patTemplate to create
the HTML Template (I like using it and I don't want to start a pro/con
template war). Here is the script:

for ($j = 0; $j < 32; $j++) {
for ($i = 0; $i < count($num_days); $i++) {
$template->addVar("room_num", "ROOM_NUM", '101');
$template->addVar("room_type", "ROOM_TYPE", 'NQQ');
$template->addVar("guest_NameRate", "GUEST_NAME", 'NAVID YAR');
$template->addVar("guest_NameRate", "GUEST_ID", 'fname');
$template->addVar("guest_NameRate", "CLASS_GUEST", 'fname');
$template->addVar("guest_NameRate", "ROOM_RATE", '49.95');
$template->parseTemplate("guest_NameRate", "a");
}
$template->parseTemplate("guest_row", "a");
}

This inner for() loop works great. It creates a SINGLE row with 7 columns of
data (one column for each day of the week). However, the outer for() loop
does not work like it should. I want it to display 32 rows of 7 columns per
row. But what happens is that on every row after the first row it appends 7
more columns at the end of each row. So row 2 will have 14 columns, row 3
will have 21 columns, row 4 will have 28 columns, and so on. I can't figure
out why this is. Either it's something new in PHP5 or I'm doing something
really stupid. I am sending a PDF attachment of a snapshot showing a hint,
made purely with HTML, of what I am trying to achieve. If anyone can help me
it would be greatly appreciated. Thanks guys.

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

RE: [PHP] what is difference between php and perl

2004-07-22 Thread php-list
PHP is more of a "binding" language that takes advantage of many different
coding practices and puts them together. PHP is not jealous and does not
separate or shun itself from other languages and borrows many of the ideas,
schemes, similar libraries, etc. from these other languages. And yet, it is
completely unique in its own way. Its easy-to-learn, low-cost and
cross-platform identity has made it very popular in recent years.

Perl is a great but is more of a mature language that has been around for
the longest time and it doesn't have the same flexibility as PHP does on the
web. You will find that PHP will far out-pace Perl coding, saving you both
time and money. PHP works concurrently with free solution components such as
Linux OS, Apache Web Server, MySQL Database and others (LAMP -
Linux-Apache-MySQL-PHP). These components all work together beautifully,
yielding fast and stable applications. Invest some time into it and see what
we mean.



-Original Message-
From: Syed Ghouse [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 21, 2004 2:06 AM
To: php mailinglists
Subject: [PHP] what is difference between php and perl

Hi all

will anybody tell me the difference between perl and php

Regards
Syed

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



RE: [PHP] Creating Rows and Columns Using for() Loops

2004-07-19 Thread php-list
No, no...that's actually a great idea. I like your approach, especially in
my case. Thank you for the suggestion!   :)

Navid

-Original Message-
From: Rory McKinley [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 09, 2004 3:57 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Creating Rows and Columns Using for() Loops

[EMAIL PROTECTED] wrote:

>
>|--|--|
-
>-|
>  |MON JUL 5 |TUE JUL 6 |
etc...
>|
>-||--|--|--
-
>---||-|
>Rm # |Rm Type |  First Name | Last Name  |  First Name | Last Name  |
etc...
>|Rm Type |Rm # |
>-||--|--|--
-
>---||-|
>101  | NQQ| Isaac Newton | (empty room) |
etc...
>| NQQ|101  |
>-||--|--|--
-
>---||-|
>102  | NK | Alexander Flemming   | Alexander Flemming   |
etc...
>| NK |102  |
>-||--|--|--
-
>---||-|
>103  | K  | Charles Darwin   | Robert Kennedy   |
etc...
>| K  |103  |
>-||--|--|--
-
>---||-|
>104  | QQ | Roger Rabbit | (empty room) |
etc...
>| QQ |104  |
>-||--|--|--
-
>---||-|
>...  | ...| ... etc  | ... etc  |
etc...
>| ...|...  |
>-||--|--|--
-
>---||-|
>
>
>  
>


Hi

I know this not what you asked and please feel free to tell me to mind 
my own business, but a more useful design for your DB would be something 
like this:

Table : rooms
Fields: room_number (PK), room_type

Table: Customers
Fields: customer_id (PK, autoincrement), first_name, last_name, etc, etc

Table: bookings
Fields: room_number, booking_date, customer_id - PK(room_number, date)

In the short term, changing your db will be a bit of a pain cos of the 
code rework, but the db design will be more scalable and more useful in 
the long run. To get the display that you required you can do something 
like this - assuming that you want a seven day span starting from today 
(for example) - showing only the first two days

$query = SELECT a.room_number, a.room_type, IFNULL(CONCAT_WS(" ", 
b.first_name, b.last_name), "Empty Room"), d.room_number, d.room_type, 
IFNULL(CONCAT_WS(" ", e.first_name, e.last_name), "Empty Room")
FROM rooms a LEFT JOIN bookings c ON a.room_number = c.room_number AND 
c.booking_date = "2004-07-09", customers b, rooms d LEFT JOIN bookings f 
ON d.room_number = f.room_number AND f.booking_date = "2004-07-10", 
customers e
WHERE b.customer_id = c.customer_id AND e.customer_id = f.customer_id

You will still have to add more code for the other five days, but if you 
want to be really clever and save wear and tear on your keyboard you can 
build the query dynamically using a loop...

You don't have to use a query this complicated, but if you do, you shift 
the bulk of the data processing and arranging to the DB (which does it a 
lot more efficiently than PHP). Then you just have to use PHP to create 
the table, the relevant headings and to populate the cells.

Ok, I am finished sticking my oar in...

Rory



-- 
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] Creating Rows and Columns Using for() Loops

2004-07-08 Thread php-list
I wrote this in plain text. I hope it came out well...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 9:02 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Creating Rows and Columns Using for() Loops

Chris,

It's a little difficult to do in ascii, but here's an attempt. This is a
simple hotel/motel log of who's staying in certain rooms. The 7 columns are
the 7 days in the week and guest names fall under whichever date they
checked in. So, let's see if I can give you a visual representation of this.
I will only include two columns and a few rows, for now. You may have to fix
your viewing window to allow this table to expand horizontally...

 
|--|--|-
-|
  |MON JUL 5 |TUE JUL 6 | etc...
|
-||--|--|---
---||-|
Rm # |Rm Type |  First Name | Last Name  |  First Name | Last Name  | etc...
|Rm Type |Rm # |
-||--|--|---
---||-|
101  | NQQ| Isaac Newton | (empty room) | etc...
| NQQ|101  |
-||--|--|---
---||-|
102  | NK | Alexander Flemming   | Alexander Flemming   | etc...
| NK |102  |
-||--|--|---
---||-|
103  | K  | Charles Darwin   | Robert Kennedy   | etc...
| K  |103  |
-||--|--|---
---||-|
104  | QQ | Roger Rabbit | (empty room) | etc...
| QQ |104  |
-||--|--|---
---||-|
...  | ...| ... etc  | ... etc  | etc...
| ...|...  |
-||--|--|---
---||-|


Thanks...


-Original Message-
From: barophobia [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 6:54 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Creating Rows and Columns Using for() Loops

On Thu, 8 Jul 2004 18:17:25 -0500, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

> for ($i = 0; $i < count($num_days); $i++) {
[snip]
> for ($j = 0; $j < 32; $j++) {
[snip]
> }
[snip]
> }

> How do I fix it to where each date column has
> exactly 32 rows of guest names?

it looks like you need to set up your loops the other way around.
right now your code is like this:

for (columns)
{
  for (rows)
  {
  }
}

you want:

for (rows)
{
  for (columns)
  {
  }
}

explained in english: you need to handle one row/person at a time and
not one column/date at a time.

on the other hand i'm not sure i totally understand your desired
output, so maybe a quick ascii table would help me/us?


chris.

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

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



RE: [PHP] Creating Rows and Columns Using for() Loops

2004-07-08 Thread php-list
Chris,

It's a little difficult to do in ascii, but here's an attempt. This is a
simple hotel/motel log of who's staying in certain rooms. The 7 columns are
the 7 days in the week and guest names fall under whichever date they
checked in. So, let's see if I can give you a visual representation of this.
I will only include two columns and a few rows, for now. You may have to fix
your viewing window to allow this table to expand horizontally...

 
|--|--|-
-|
  |MON JUL 5 |TUE JUL 6 | etc...
|
-||--|--|---
---||-|
Rm # |Rm Type |  First Name | Last Name  |  First Name | Last Name  | etc...
|Rm Type |Rm # |
-||--|--|---
---||-|
101  | NQQ| Isaac Newton | (empty room) | etc...
| NQQ|101  |
-||--|--|---
---||-|
102  | NK | Alexander Flemming   | Alexander Flemming   | etc...
| NK |102  |
-||--|--|---
---||-|
103  | K  | Charles Darwin   | Robert Kennedy   | etc...
| K  |103  |
-||--|--|---
---||-|
104  | QQ | Roger Rabbit | (empty room) | etc...
| QQ |104  |
-||--|--|---
---||-|
...  | ...| ... etc  | ... etc  | etc...
| ...|...  |
-||--|--|---
---||-|


Thanks...


-Original Message-
From: barophobia [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 6:54 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Creating Rows and Columns Using for() Loops

On Thu, 8 Jul 2004 18:17:25 -0500, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:

> for ($i = 0; $i < count($num_days); $i++) {
[snip]
> for ($j = 0; $j < 32; $j++) {
[snip]
> }
[snip]
> }

> How do I fix it to where each date column has
> exactly 32 rows of guest names?

it looks like you need to set up your loops the other way around.
right now your code is like this:

for (columns)
{
  for (rows)
  {
  }
}

you want:

for (rows)
{
  for (columns)
  {
  }
}

explained in english: you need to handle one row/person at a time and
not one column/date at a time.

on the other hand i'm not sure i totally understand your desired
output, so maybe a quick ascii table would help me/us?


chris.

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



[PHP] Creating Rows and Columns Using for() Loops

2004-07-08 Thread php-list
Hello Everyone,

I have an HTML table with 7 columns and 32 rows, not including table headers
and footers. I want to create a tabular data table that spans 7 columns and
32 rows. I get my info from MySQL and use for() loops to loop through two
types of arrays. An array containing the dates (the columns) and a table
containing first and last names. The names will go underneath whichever date
it is associated with, with a maximum of 32 names per column (hence the 32
rows). I am using patTemplate to create the table. Here is what I have so
far:

for ($i = 0; $i < count($num_days); $i++) {
$template->addVar("date_column", "DAY", $num_days[$i]['day_text']);
$template->addVar("date_column", "DATE", $num_days[$i]['month_text'].'
'.$num_days[$i]['date']);
$template->parseTemplate("date_column", "a");

$template->addVar("sort_row", "SORT_FNAME", 'fname');
$template->addVar("sort_row", "SORT_LNAME", 'lname');
$template->addVar("sort_row", "SORT_RATE", 'rate');
$template->parseTemplate("sort_row", "a");

for ($j = 0; $j < 32; $j++) {
$template->addVar("guest_NameRate", "GUEST_NAME", 'BOB RICHIE');
$template->addVar("guest_NameRate", "GUEST_ID", 'fname');
$template->addVar("guest_NameRate", "CLASS_GUEST", 'fname');
$template->addVar("guest_NameRate", "ROOM_RATE", '49.95');
}
$template->parseTemplate("guest_NameRate", "a");
$template->addVar("room_num", "ROOM_NUM", '101');
$template->addVar("room_type", "ROOM_TYPE", 'NQQ');
$template->parseTemplate("guest_row", "a");
}

I populated the guest's name statically so I can see how the loop works. The
looping is wrong and it only yields 7 rows. In the first row it has 1 column
of data, the second row has two columns of data, the third one has three
columns of data, and so on. How do I fix it to where each date column has
exactly 32 rows of guest names?

I hope this makes sense. Any help will be appreciated.

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



RE: [PHP] Re: Graphical calendar

2004-05-08 Thread php-list
You can try using PEAR's Calendar System. It works great for what you might
need. Here's a website of what you can do with PEAR Calendar:

http://pearcalendar.sourceforge.net/examples/

-Original Message-
From: Todd Cary [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 08, 2004 12:59 PM
To: Manuel Lemos
Cc: [EMAIL PROTECTED]
Subject: [PHP] Re: Graphical calendar

Works like a champ!

Question: has anyone extended the class so that when one clicks on a 
day, the year, month, day is returned?

Todd

Manuel Lemos wrote:
> Hello,
> 
> On 05/07/2004 11:36 PM, Todd Cary wrote:
> 
>> I need to bring up a calendar so the user can determine what day of 
>> the week a certain falls on, etc.  My search with Google appears to 
>> have calendars that are like appointment books.
>>
>> Is there a simple graphical calendar where the use can pick a month 
>> and see the days of the week?
> 
> 
> You may want to try this class that does precisely that:
> 
> Class: Calendar generation class 
> http://www.phpclasses.org/calendargenerator
> 
> 

-- 
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] PHP5 and PEAR

2004-05-04 Thread php-list
So other than Config (for now), most other packages are compatible with PHP
5 already? What about the answers to my other questions? How will PEAR be
organized in PHP 5? What do I need to look out for when making the
transition, etc?? Thanks.

-Original Message-
From: Oliver Kuhl [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 04, 2004 3:48 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP5 and PEAR

Hi,

> How will PHP5 affect the current PEAR libraries? Will some of the PEAR
> libraries be unusable? Will PEAR be distributed a different way with a
> different type of file structure than the default PHP uses for PEAR? How
> will it be organized and what do I need to watch out for? I haven't used
> PEAR in the past and I'm just now starting to use some of the very useful
> libraries. But the problem is that we're so close to PHP5 that I don't
want
> to get STUCK with a project in the near future that I need to write in
PHP5
> and not have the same PEAR libraries that I enjoyed in PHP4. I want to
know
> if it would be better if I waited for PHP5 to come out before I start
using
> PEAR. Any suggestions, comments, etc? If you know of any websites with
> articles that talk about this issue then that would be great. Anything
would
> be helpful at this point. I feel very lost.
as I experienced some minutes ago, the package "config" has some 
problems with xml-parsing. I don't know where is the problem exactly, 
but it is not compatible.

But if I am informed correctly, some of the packages are already compatible.

Gruss,
Ollie.

-- 
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] Freelance PHP Bids

2004-04-19 Thread php-list
Hello,

There is a person asking me where she can find a website developer that will
create an e-commerce solution for her. I don't feel I'm ready to help her
out in that area yet, but I still want her to be able to have other choices.

I remember there was a main website where freelance programmers and clients
come together and bid on projects with different levels of experiences and
prices, but I don't remember where that is now. Can anyone direct me to a
website such as that? Any help would be appreciated. Thank you.

Navid

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



[PHP] AOL Email client

2003-08-08 Thread php list
I am using php mail and setting all my $headers info to show From:, To:,
etc.
It work perfectly on my computer. I use MS Outlook.
I am doing this for a client who received his email via his aol account.
When he receives the email, the email comes in with "Unknown Sender".

Is there issues with this? Do I need to so something different for AOL email
to receive this information properly?

Thanks.
Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo



mailto:[EMAIL PROTECTED]



Re: [PHP] HTTPS POST without user/client intervention

2003-07-15 Thread PHP List
On Tue, 2003-07-15 at 15:12, Chris Shiflett wrote:
> --- PHP List <[EMAIL PROTECTED]> wrote:
> > I am writing a php script to accept an HTTPS POST of data from a
> > remote site, process the data, and send an HTTPS POST response back
> > (not necessarily to the same remote site).
> 
> Can you perhaps rephrase what you are trying to do? The way I interpret what
> you are asking may be much simpler than what you really mean to do.
> 
> To "accept" an HTTPS POST only requires that your Web server is SSL-enabled.
> There is nothing special you must do. For example, a PHP script can print out
> all posted data like this:
> 
> print_r($_POST);
Yup...I already accept the https posts just fine...


> 
> As for sending a POST request to a remote site via SSL, just check out cURL,
> which also has a convenient PEAR package.

This is what I am trying to do...and thanks for point out cURL...I will
check it out.

Sorry for being unclear...

-- 
Woody

In a world without boundaries why
do we need Gates and Windows?


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



[PHP] HTTPS POST without user/client intervention

2003-07-15 Thread PHP List
I am writing a php script to accept an HTTPS POST of data from a remote
site, process the data, and send an HTTPS POST response back (not
necessarily to the same remote site). I can do this pretty easily in
PERL (which I may have to if I can't find a PHP solution).  Also I need
to do the https post without any kind of client or user interaction. I
have checked through php.net and phpbuilder.com but have only come up
with things for HTTP POST (no SSL Encryption).  Anyone run across
something like this, or can point me in a direction to look?

-- 
Woody

In a world without boundaries why
do we need Gates and Windows?


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



[PHP] Session Question

2003-03-20 Thread PHP List
Hi All,
I have a question about sessions.
I need to pass session data from one domain to a secure domain. (www.mydomain.com to 
www.securedomain.com).
I would like to preserve the session data in case the visitor goes back to 
www.mydomain.com. I thought about just passing the session ID to www.securedomain.com, 
but if I need to destroy the session while the visitor is in www.securedomain.com, I 
am hoping this will also include destroying data from www.mydomain.com.
Basically, I am talking about a shopping cart system. If the user decides to stop half 
way through the checkout on the secure site and continue shopping in the store, I want 
the cart to remain. But if the user completes the checkout process on the secure 
domain, their cart should be empty when going back to the original domain.

Thanks for any help.

Chris


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.461 / Virus Database: 260 - Release Date: 3/11/2003

RE: [PHP] mysql_num_rows() error

2003-01-09 Thread Jay \(PHP List\)
You query is incorrect.  Try doing the same query from the MySQL clent.

|-> -Original Message-
|-> From: Phil Powell [mailto:[EMAIL PROTECTED]] 
|-> Sent: Thursday, January 09, 2003 7:46 PM
|-> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
|-> Subject: [PHP] mysql_num_rows() error
|-> 
|-> 
|-> > Anyone know why this is happening? I have mySQL on 
|-> Win2000 Server with 
|-> > IIS and PHP:
|-> >
|-> > mysql_num_rows(): supplied argument is not a valid MySQL result 
|-> > resource
|-> >
|-> > Here is my code:
|-> >
|-> >  >   $conn = mysql_connect('localhost', "xxx", "yyy") or 
|-> die('Could not
|-> connect
|-> > to db');
|-> >   $result = mysql_query('select * from blah');
|-> >   echo "Number of rows: " . mysql_num_rows($result);
|-> >   if (mysql_num_rows($result) > 0) {
|-> >while ($row = mysql_fetch_row($result)) {
|-> > for ($i = 0; $i < sizeOf($row); $i++) {
|-> >  echo "$i: " . $row[$i] . "";
|-> > }
|-> >}
|-> >   }
|-> > ?>
|-> >
|-> > It couldn't get any simpler.  I just installed mySQL on 
|-> my machine and 
|-> > am trying to see what I can do with it giving Win2K and IIS.
|-> >
|-> > AUGH! Thanx
|-> > Phil
|-> >
|-> 
|-> 
|-> -- 
|-> 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] Upgrade help!

2003-01-08 Thread PHP List
In case any one else needs to know:
I had to erase the rpm version of gd, gd-devel and libpng, libpng-devel The
rpm versions were 1.0.12. For some reason the configure
option -with-png-dir=../libpng-1.2.1 was using the headers from the right
dir, but somehow used the rpm version for compiling instead.  Is this a bug?
Shouldn't it use libpng-1.2.1 for everything?
Once I got rid of the rpm versions, I know longer had a problem.

- Original Message -
From: "PHP List" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, January 07, 2003 4:34 PM
Subject: [PHP] Upgrade help!


Hi,
I am trying to upgrade to php4.3.0, everything works, but when I try to use
any gd image functions I get the following error:

libpng warning: Application was compiled with png.h from libpng-1.2.1
libpng warning: Application  is running with png.c from libpng-1.0.12
gd-png:  fatal libpng error: Incompatible libpng version in application and
library
[Tue Jan  7 16:30:21 2003] [notice] child pid 14014 exit signal Segmentation
fault (11)


I downloaded and installed libpng-1.2.1
I configured php with:
./configure' '--with-jpeg-dir=../jpeg-6b' '--with-mysql=/usr/'
'--with-apxs=/usr/local/apache/bin/apxs' '--with-gd'
'--with-mcrypt=../libmcrypt-2.4.22' '--with-png-dir=../libpng-1.2.1'
'--with-zlib-dir=../zlib-1.1.3' '--enable-exif'
'--with-freetype-dir=../freetype-2.1.3'

Where is is getting the libpng-1.0.12 from? I can't find it anywhere on the
server.
I am using apache 1.3.27 on redhat 7

Thanks for any help.


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




[PHP] Upgrade help!

2003-01-07 Thread PHP List
Hi,
I am trying to upgrade to php4.3.0, everything works, but when I try to use any gd 
image functions I get the following error:

libpng warning: Application was compiled with png.h from libpng-1.2.1
libpng warning: Application  is running with png.c from libpng-1.0.12
gd-png:  fatal libpng error: Incompatible libpng version in application and library
[Tue Jan  7 16:30:21 2003] [notice] child pid 14014 exit signal Segmentation fault (11)


I downloaded and installed libpng-1.2.1
I configured php with:
./configure' '--with-jpeg-dir=../jpeg-6b' '--with-mysql=/usr/' 
'--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' 
'--with-mcrypt=../libmcrypt-2.4.22' '--with-png-dir=../libpng-1.2.1' 
'--with-zlib-dir=../zlib-1.1.3' '--enable-exif' 
'--with-freetype-dir=../freetype-2.1.3' 

Where is is getting the libpng-1.0.12 from? I can't find it anywhere on the server.
I am using apache 1.3.27 on redhat 7

Thanks for any help.


[PHP] Upgrading to 4.3.0

2003-01-07 Thread PHP List
Hi,
According to the docs, 4.3.0 comes with gd bundled in. Do I still have to use libpng 
and jpg and free type seperately?
Do I still need --with-png-dir= in the configuration of php or is it part of the built 
in gd library?

Thanks for any help.


[PHP] Using fopen() to open a php file with variables.

2002-12-11 Thread Jay \(PHP List\)
Okay, I need to retrieve the output of a php file with variables being
passed to it.  Example:

$calendar_file = "make_calendar.php3?month=$month&year=$year";
$fp = $fp = fopen("$calendar_file", "r");
while (!feof ($fp)) {
$buffer = fgets($fp, 4096);
$calendar_html .= $buffer;
}
fclose($fp);

It gives me an error that the file doesn't exist, but it does.  Any
suggestions?

Jay Douglas
Systems Consultant
Fort Collins, CO




Re: [PHP] Script Question

2002-11-21 Thread PHP List
Same problem, I still get an undefined error.


> Try using the string functions.
>
> document.myform.mytextfield.value or something...
>
> On Thu, 2002-11-21 at 13:25, PHP List wrote:
> > Hi,
> > This is more of a Javascript question so please forgive.
> >
> > I generate a dynamic form with php.
> >
> > I need to be able to test in javascript if a certain field exists:
> >
> > .
> > .
> > if (document.myform.mytextfield) {
> > .
> > .
> >
> > This line will give me the javascript error "document.myform.mytextfield
is undefined"
> >
> > If it does exist, then it works fine.
> >
> > So how do I test if a field exists without getting an error?
> >
> > Thanks for any help.
> --
>
> Ray Hunter
> email: [EMAIL PROTECTED]
> www: http://venticon.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] Script Question

2002-11-21 Thread PHP List
Hi,
This is more of a Javascript question so please forgive.

I generate a dynamic form with php.

I need to be able to test in javascript if a certain field exists:

.
.
if (document.myform.mytextfield) {
.
.

This line will give me the javascript error "document.myform.mytextfield is undefined"

If it does exist, then it works fine.

So how do I test if a field exists without getting an error?

Thanks for any help.


Re: [PHP] Firewall Question

2002-11-05 Thread PHP List
Are you sure there even is a firewall?
If it is just a simple 10 port network hub, chances are it does not have any
firewall capability.


> There lies another problem. I'm not sure there is a number, I tried
reading
> the manual but it didn't say much about all that. Mostly how to get your
> network up and running...
>
>
> - Original Message -

>
>
> > If the firewall is built into the "HUB", there should be a specific
> address
> > you can point your webbrowser to that will access the HUB's built in
> > administration to change the configuration. See the HUB's manual.
> >
> >
> > > My OS is Windows XP Pro but the computer with admin privaliges is
> Windows
> > > 98. It's not software, it's hardware. It's built into the HUB of the
> LAN.
> > > There is some software to open ports but I'm not sure what it is or
> > anything
> > > like that. Thanks for the help so far.
> > >
> > >
> > > - Original Message -
> > > From: "Paul Marinas" <[EMAIL PROTECTED]>
> > > To: "incoming" <[EMAIL PROTECTED]>
> > > Cc: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
> > > <[EMAIL PROTECTED]>
> > > Sent: Tuesday, November 05, 2002 4:57 PM
> > > Subject: Re: [PHP] Firewall Question
> > >
> > >
> > > > it depends on the operating system your running.
> > > >
> > > > Paul Marinas
> > > > Technical Support
> > > > RDS Craiova
> > > >
> > > >
> > > > Phone:  +402-51-410-194
> > > > Mobile: +407-22-451-439
> > > > Fax:+402-51-416-579
> > > > www.rdsnet.ro
> > > > .
> > > >
> > > > Privileged/Confidential Information may be contained in this
message.
> If
> > > you
> > > > are not the addressee indicated in this
> > > > message (or responsible for delivery of the message to such person),
> you
> > > may
> > > > not copy or deliver this message to
> > > > anyone. In such a case, you should destroy this message and kindly
> > notify
> > > > the sender by reply e-mail.
> > > >
> > > > On Tue, 5 Nov 2002, incoming wrote:
> > > >
> > > > > Depends on your firewall software.
> > > > >
> > > > > --Joseph Guhlin
> > > > > Web Developer / Unix Consultant
> > > > > http://www.bahwi.cc/
> > > > >
> > > > > Stephen wrote:
> > > > >
> > > > > >Err, I'm extremely new to Firewalls and the firewall is
protecting
> > the
> > > LAN
> > > > > >I'm on for the house. I think I should need to just do port 80
for
> > this
> > > but
> > > > > >how would I go about opening it?
> > > > > >
> > > > > >While I'm on the subject, I also need to open ports , 7778,
> 7787,
> > > 7788,
> > > > > >28900, 28902 for a game. Again, how would I open them either from
> my
> > > > > >computer or the computer with admin privilages to the firewall?
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > 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] Firewall Question

2002-11-05 Thread PHP List
If the firewall is built into the "HUB", there should be a specific address
you can point your webbrowser to that will access the HUB's built in
administration to change the configuration. See the HUB's manual.


> My OS is Windows XP Pro but the computer with admin privaliges is Windows
> 98. It's not software, it's hardware. It's built into the HUB of the LAN.
> There is some software to open ports but I'm not sure what it is or
anything
> like that. Thanks for the help so far.
>
>
> - Original Message -
> From: "Paul Marinas" <[EMAIL PROTECTED]>
> To: "incoming" <[EMAIL PROTECTED]>
> Cc: "Stephen" <[EMAIL PROTECTED]>; "PHP List"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, November 05, 2002 4:57 PM
> Subject: Re: [PHP] Firewall Question
>
>
> > it depends on the operating system your running.
> >
> > Paul Marinas
> > Technical Support
> > RDS Craiova
> >
> >
> > Phone:  +402-51-410-194
> > Mobile: +407-22-451-439
> > Fax:+402-51-416-579
> > www.rdsnet.ro
> > .
> >
> > Privileged/Confidential Information may be contained in this message. If
> you
> > are not the addressee indicated in this
> > message (or responsible for delivery of the message to such person), you
> may
> > not copy or deliver this message to
> > anyone. In such a case, you should destroy this message and kindly
notify
> > the sender by reply e-mail.
> >
> > On Tue, 5 Nov 2002, incoming wrote:
> >
> > > Depends on your firewall software.
> > >
> > > --Joseph Guhlin
> > > Web Developer / Unix Consultant
> > > http://www.bahwi.cc/
> > >
> > > Stephen wrote:
> > >
> > > >Err, I'm extremely new to Firewalls and the firewall is protecting
the
> LAN
> > > >I'm on for the house. I think I should need to just do port 80 for
this
> but
> > > >how would I go about opening it?
> > > >
> > > >While I'm on the subject, I also need to open ports , 7778, 7787,
> 7788,
> > > >28900, 28902 for a game. Again, how would I open them either from my
> > > >computer or the computer with admin privilages to the firewall?
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > 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] How printing the name and value of a variable ?

2002-10-31 Thread PHP List
Why?
echo "THE VARIABLE ".(please help me right here)." EQUALS ".$tigidizougou;

Obviously the variables name is tigidizougou, so just do this:

echo "THE VARIABLE  tigidizougou EQUALS ".$tigidizougou;

Or am I missing something here?


> Theoriquement it is not possible, because you cannot use any variable
since
> you don't know its name-
>
> But you can cope something with get_defined_vars() in which you set every
> variable without distinction into an array- and after you select the
> variable you need using some criterias.
>
> like this
> $array = get_defined_vars() ;
> foreach ($array as $key=>$value)
> if (ereg("EREG_CRITERIA",$key))  echo "La variable $KEY est egale a
$value"
> ;
>
> Elsewhere if you know the name of the variable you would like to use
> do simply like this:
>
> $tigidizougou = 12;
> echo "THE VARIABLE tigidizougou EQUALS ".$tigidizougou;
>
>
> - Original Message -
> From: "franck raynal" <[EMAIL PROTECTED]>
> To: "php-general" <[EMAIL PROTECTED]>
> Sent: Friday, November 01, 2002 9:09 AM
> Subject: [PHP] How printing the name and value of a variable ?
>
>
> Hello,
> I'd like to print the name of a variable, in order to get something like
> this  :
>
> THE VARIABLE tigidizougou EQUALS 12 !
>
> from the original code below :
>
> $tigidizougou = 12;
> echo "THE VARIABLE ".(please help me right here)." EQUALS ".$tigidizougou;
>
> Any idea ? Thanks you.
>
> Franck
>
>
> --
> 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] Form Question

2002-10-31 Thread PHP List
Thanks, but same problem.
alert() will give me the correct values, but it is still not unchecking the
boxes.

Strange, it obviously sees them as the statement
if (document.LevelListForm.elements['rgItems[]'][i].checked == true)
is correctly found for every checked box, but it just can't seem to find
them to uncheck them.
And I don't get any javascript errors.



> Try this
>
> 
> <!--
> function ClearLevelListForm()
> {
> for (var i=0;i<document.LevelListForm.elements['rgItems[]'].length;i++)
> {
> if (document.LevelListForm.elements['rgItems[]'][i].checked == true)
> {
> alert(document.LevelListForm.elements['rgItems[]'][i].value);
> document.LevelListForm.elements['rgItems[]'][i].checked = false;
> }
> }
> }
> //-->
> 
>
> PHP List wrote:
> > Hi,
> > I am hopeing someone can help me with this.
> > This is more of a javascript problem I suppose.
> > I have a bunch of check boxes on a from that I have given a name of
rgItems[] so I can access them as an array in php.
> > But I can't find a way to clear all the checkboxes on the form at once.
a reset button only resets the form to the original values, but I need to be
able to clear all the check boxes.
> >
> > 
> > <!--
> > function ClearLevelListForm()
> > {
> >  for (var i=0;i<document.LevelListForm.elements.length;i++)
> >  {
> >   if (document.LevelListForm.elements[i].checked == true)
> >   {
> > alert(document.LevelListForm.elements[i].value);
> > document.LevelListForm.elements[i].checked = false;
> >   }
> >  }
> > }
> > //-->
> > 
> > I do get the correct alerts from the above script corresponding to the
number of checked boxes, however, the second line does not seem to be
unchecking the boxes. I am not sure if this has something to do with the
fact that all the boxes have the same name rgItems[] and the browser doesn't
know which one to uncheck.
> > Has anybody else come accross this?
> > Thanks,
> > And I apologize for asking this question on the PHP List, but I am
hoping someone here may have had the same problem when name mutliple form
elements using the array style:   blah[]
>
>
>
> --
> 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] PHP - Internal linking in a page

2002-10-31 Thread PHP List
Your get statement is wrong:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
use
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php&id=7

You only get 1 question mark, any after will be treated as part of the
variable page.



Hi!

I started to learn PHP yesterday, and I have just entered a little problem.
In my index.php file. I have this line:



wich controles the main page locaton, just like frames. It makes the files
appear in the middle of the site.

Now over to the problem:

I am making a newsscript with PHP and PostgreSQL. I have now gotten PHP to
extract the news from the database.
I am using numbers as ID for each post. 1, 2 ,3, 4, 5, 6 and so on.
I use them to make a READ MORE link on the news posts.
I am calling my "READ MORE"-page for main2.php, this contains PHP code that
finds the story thats connected to the given number. and I use this to make
it appear: http://maloyportalen.no/~critical/maloy/main2.php?id=7

But that makes it go on a seperate page.
And this link does not work at all:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7
It returns this error:

Warning: Failed opening 'main2.php?id=7' for inclusion
(include_path='.:/usr/share/pear') in
/home/critical/public_html/maloy/index.php on line 21


Line 21 is the following:


How can I write it so I can use:
http://maloyportalen.no/~critical/maloy/index.php?page=main2.php?id=7

Regards
Paul Ottar Tornes.




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




Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread PHP List
Why not use the Memorize button to set a hidden field? Or just use a check
box.
Since you are going to be submitting the data anyway, save the fields at
that time depending on whether or not the check box/hidden filed is set?


> Hi,
>
> I have a form where the user enters some information.  For a particular
> section of the form, I'd like the user to be able to save what he/she
> entered so that the next time they feel out the form, they can recall
> without the need to retype.  This is not for the entire form but only for
a
> few input text fields.
>
> I created a button called "Memorize" but how do I have the page save the
> values to my MySQL database when the user clicks on the button.  I
> understand that I can only use JavaScript to trap the "OnClick()" function
> and not PHP but I cannot use JavaScript to write to a MySQL table.  I do
not
> want to submit as that would reload the form and the user would lose other
> changes to other fields.
>
> Any idea?
>
> Don
>
>
>
> --
> 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] Form Question

2002-10-31 Thread PHP List
Hi,
I am hopeing someone can help me with this.
This is more of a javascript problem I suppose.
I have a bunch of check boxes on a from that I have given a name of rgItems[] so I can 
access them as an array in php.
But I can't find a way to clear all the checkboxes on the form at once. a reset button 
only resets the form to the original values, but I need to be able to clear all the 
check boxes.


<!--
function ClearLevelListForm()
{
 for (var i=0;i<document.LevelListForm.elements.length;i++)
 {
  if (document.LevelListForm.elements[i].checked == true)
  {   
alert(document.LevelListForm.elements[i].value);
document.LevelListForm.elements[i].checked = false;  
  }
 }
}
//-->

I do get the correct alerts from the above script corresponding to the number of 
checked boxes, however, the second line does not seem to be unchecking the boxes. I am 
not sure if this has something to do with the fact that all the boxes have the same 
name rgItems[] and the browser doesn't know which one to uncheck.
Has anybody else come accross this?
Thanks,
And I apologize for asking this question on the PHP List, but I am hoping someone here 
may have had the same problem when name mutliple form elements using the array style:  
 blah[]


RE: [PHP] search tricks of the trade

2002-10-31 Thread PHP List
Too many to list in an email. This site has allot of information.

http://searchenginewatch.com/



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




[PHP] Re: Dazed and Confused

2002-10-30 Thread PHP List
I think the fog is starting to clear, thanks for the help.

I do have one more question:
If I want to use array_walk in a class, how do I refer to a function in that
class?

Class MyClass
{
.
.
.
function DoArrayStuff(&$item1, $key, $nMode)
{
echo $item1;
}
function SomeOtherFunction
{
.
.
$myarray already filled with, say, 5 items;
array_walk($myarray,'DoArrayStuff',1);  <--- PHP error:
DoArrayStuff() - function does not exist in . . .

I have tried 'MyClass::DoArrayStuff', 'this->DoArrayStuff',
'$this->DoArrayStuff' but none work.
The only way I can seem to use DoArraySuff is to define the funcion
seperate(outside) from the class, which seems kind of odd since the only
time the function is needed is internally by this class.
}

}


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




Re: [PHP] Dazed and Confused

2002-10-30 Thread PHP List
So are you saying there really is no array pointer?
Lets say I have an array with several different values like:
$myarray["a"] = "s";
$myarray[3] = "d";
$myarray["sdf"] = "y";
There is no way of saying give me the value in the array at position 2?
Since the size of the array is returned as 3, should there not be a way of
doing this?

Like I said, I seem to be blanking on arrays.

> Because you haven't put anything in array index 0.  The only array index
> that has anything is "test".  There is no difference between numeric and
> string indices.  You seem to be assuming that somehow the first element in
> an array can always be accessed as index 0 which is not the case and never
> has been.
>
> -Rasmus
>
> On Wed, 30 Oct 2002, PHP List wrote:
>
> > For some reason my brain is not operating within normal parameters this
week.
> >
> > $myarray["test"] = "sd";
> > echo $myarray[0];
> >
> > Why will nothing echo? Do I somehow have to initialize indexing on the
array $myarray?
> > php says that $myarray is an array, but I can't access it with numeric
indexes.
> >
> > I know if I do this:
> > $myarray = array("test"=>"sd");
> > that I can now echo $myarray[0] and get the value of sd returned.
> >
> >
>


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




[PHP] Dazed and Confused

2002-10-30 Thread PHP List
For some reason my brain is not operating within normal parameters this week.

$myarray["test"] = "sd";
echo $myarray[0];

Why will nothing echo? Do I somehow have to initialize indexing on the array $myarray?
php says that $myarray is an array, but I can't access it with numeric indexes.

I know if I do this:
$myarray = array("test"=>"sd");
that I can now echo $myarray[0] and get the value of sd returned.
 



Re: [PHP] Array Question

2002-10-29 Thread PHP List
No, array_keys does not do what I want, in order to user array_keys, it
assumes I know the value of the key, but I don't, I want to get the value of
the key but all I know is the index.


> Perhaps you want to look at array_keys().
>
> On Monday, October 28, 2002, at 05:48 PM, PHP List wrote:
>
> > How can I get the name of the index?
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
>
>
> --
> 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] Array Question

2002-10-28 Thread PHP List
This doesn't seem to work for anything past the first key:
echo array_search(0,$myarray);
will print 'a';

None of these give me anything:
echo array_search(1,$myarray);
echo array_search("1",$myarray);
echo array_search(1,$myarray,true);
echo array_search("1",$myarray,true);
so how do I get 'd'?



> I think you are looking for array_search()
>
> On Mon, 28 Oct 2002, PHP List wrote:
>
> > Hi,
> > Lets say I have a simple array like this:
> > $myarray = array("a"=>"b","d"=>"c");
> >
> > echo $myarray[0] will return 'b';
> >
> > How can I get the name of the index? so:
> >
> > echo $myarray[something] would return 'a';
> >
> > I know I can do a list($key,$value) but I don't need to loop through the
array, I just need to be able to retrieve the key name from any point in the
array.
> >
> >
> > Thanks for any help.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




[PHP] Array Question

2002-10-28 Thread PHP List
Hi,
Lets say I have a simple array like this:
$myarray = array("a"=>"b","d"=>"c");

echo $myarray[0] will return 'b';

How can I get the name of the index? so:

echo $myarray[something] would return 'a';

I know I can do a list($key,$value) but I don't need to loop through the array, I just 
need to be able to retrieve the key name from any point in the array.


Thanks for any help.


Re: [PHP] DB speed

2002-10-10 Thread PHP List

>From my experience, I found this:

Selecting 1000 records from 2 tables using a join, 10secs and up.

Selecting 1000 records for table 1, all records from table 2, then using php
to figure out which rows from table 2 belong to table 1 and building my own
combined array, less than a second.



> Would access be a lot slower than these then for a query with multiple
> tables and other such things? Is there a resource on the net regarding
> this?
>
> -Original Message-
> From: Dan Ostrowski [mailto:[EMAIL PROTECTED]]
> Sent: 10 October 2002 18:43
> To: tuxen
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] DB speed
>
> For SIMPLE SIMPLE selects and inserts, MySQL will probably remain
> faster.  If you are doing a very simple web set up where you are mostly
> inserting and spitting out single table information, MySQL will be the
> way to go.
>
> Anything else, I would recommend PostgreSQL. It's got FAR superior
> features and anytime you start very complex queries ( like JOINS and
> multi-table aggregate functions, etc ) postgres will blow MySQL out of
> the water.
>
> They are both nice, just for different purposes. MySQL = simple,
> PostgreSQL = anything else.
>
> Also, you can run "EXPLAIN " on PostgreSQL to find out exactly
> what is happening when you do a query and if it's using an index
> properly or not.
>
>
> regards,
> dan
>
>
> tuxen wrote:
>
> >I think i read something a while ago, about mysql being faster, having
> >less features, but postgres being a little slower but able to handle
> >LARGE databases better than mysql. I could be wrong, so dont take my
> >word for it. At the end of the day they are both good db's.
> >
> >On Thu, 2002-10-10 at 09:02, Simon Taylor wrote:
> >
> >
> >>Well obviously - cos MySQL rocks!!, but seriously I also did some
> tests and
> >>got variable results from different db's - even got an odbc connection
> to
> >>access to run faster than mysql at one stage!! - something tells me
> there
> >>are other factors contributing..
> >>Cheers
> >>Simon
> >>
> >>-Original Message-
> >>From: Uros Gruber [mailto:[EMAIL PROTECTED]]
> >>Sent: 10 October 2002 14:17
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] DB speed
> >>
> >>
> >>Hi!
> >>
> >> I'm making some testing over DB.php  (PEAR)
> >>
> >> And i wan't to know if this is normal.
> >>
> >> I've made some script where I connect do SQL server
> >> and execute one simple (1row) query.
> >>
> >> I use pgsql and mysql. tables and indexes are same for both  servers.
> So
> >>test table is identical
> >>
> >> Whe i execute those script i get some timing results
> >>
> >>PGSQL
> >>Total time: 0.0576
> >>Execution time: 0.0185
> >>
> >>MySQL
> >>Total time: 0.0086
> >>Execution time: 0.0028
> >>
> >>Time is in seconds.
> >>
> >>My machine is PIII 333 MHz with 128MB RAM. I table is only 3 rows of
> data.
> >>
> >>I want to know why is sucsh diference. Both servers runing
> >>with socket connections and using connnect (non-persistant)
> >>
> >>--
> >>tia,
> >> Uros  mailto:[EMAIL PROTECTED]
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
>
>
>
>
> --
> 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] Mime Types

2002-10-03 Thread PHP List

Hi,
Is it possible to get a mime type of a file? 
I need to be able to attach files, but I won't always know the mime type of what is 
being attached.
I could look at the extension of the file for a general Idea, but I wouldn't know if a 
.jpg file is an image/jpg or image/jpeg.(progressive) and there seems to be a 
difference between the two. 

Thanks for any help.
Chris



Re: [PHP] Finding out what week it is

2002-05-15 Thread PHP List

but remember, this wasn't added until PHP version 4.1.0

Jim Lucas
www.zonedzero.net
www.giantmaps.com

- Original Message -
From: "PHP lists" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 9:43 AM
Subject: Re: [PHP] Finding out what week it is


> $week = date("W");
>
> DOJ> Is there any way to determin what week of the year it is, for example
to
> DOJ> day it is the 20th week of the year.
>
> DOJ> Thanks
>
> DOJ>   
> DOJ> Davíð Örn Jóhannssson
> DOJ> Vefforritari
> DOJ> 
> DOJ> Atómstöðin hf.
> DOJ> Austurstræti 12
> DOJ> 101 Reykjavík
> DOJ> 
> DOJ> sími: 520-8105
> DOJ>   [EMAIL PROTECTED]
> DOJ>   http://www.atom.is
> DOJ> 
>
>
> --
> 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] Include Files self aware?

2002-04-30 Thread PHP List

Hi,
Is it possible to detect if a file is being called as an include or require?

ex:
include("file.php")<-- file.php code can "detect" that is has been
called as an include.

Thanks,
Chris


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




[PHP] To store or not to store . . .

2002-04-24 Thread PHP List

Hi,
I was wondering about the following:
Should I store a picture directly in a MySQL table? Or just store the link
to a file on the system somewhere?

I would think that leaving the picture as an actual file and just storing
the link would be quicker. But what are the dis/advantages of storing right
in the table? I like the idea of not cluttering up my file system. Pictures
would only be about in the 20K range.

Thanks,
Chris


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




Re: [PHP] Upgrading PHP

2002-02-28 Thread PHP List

Yes, you have to re-compile php because php compile and install a module
under apache_1.3.xx/src/modules





> Thanks for the reply.   I have another question. If I have to recompile
> Apache can I take this opportunity to upgrade it as well. I'm using 1.3.14
> but would like to upgrade to a more recent version.  Also, I remember when
> I compiled PHP the first time I had to have the Apache source and when I
> compiled  PHP one of the configure parameters was
> --with-apache=../apache1.3.14  . Since I didn't do that for this recent
> compile of PHP will I have to compile PHP over again?
>
> TIA - Frank
>
> At 03:37 PM 2/28/2002, you wrote:
>
> >Frank,
> >
> >Using PHP as an Apache module requires you recompile apache as a whole.
> >It's still using the php4.0.3 module, and when you recompile with the new
> >php it will register the 4.1.2 module.
> >
> >Mike
> >- Original Message -
> >From: "Frank Miller" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Thursday, February 28, 2002 4:32 PM
> >Subject: [PHP] Upgrading PHP
> >
> >
> > > All,
> > >  I have a question about upgrading php. With the CERT
> > > advisory coming yesterday and the quick response from the PHP website
I
> > > thought today would be a good day to upgrade my PHP.   I initially
> > > installed the php 4.03 src in /usr/src and built it as an apache
module
> > > DSO. To upgrade I deleted the old source still in /usr/src and
untarred
> >php
> > > 4.1.2 . I then configured it and ran make and make install. Everything
> >went
> > > well until I run the phpinfo() test script I made, I did stop and
start
> > > Apache. It still shows me as using PHP 4.0.3 . Can someone tell me
what I
> > > need to do to get rid of the older version of PHP and upgrade to the
new?
> > >
> > > Thanks in advance - Frank
> > >
> > > Frank Miller
> > > Computer Specialist and Webmaster
> > > Technology and Distance Education
> > > Texas A&M University-Texarkana
> > > 2600 North Robison Rd
> > > Texarkana, Texas 75501
> > >
> > > Phone:  903-223-3156
> > > Fax:  903-223-3139
> > > Office:   165
> > >
> >
> >
>
>---
-
> >
> >
> >
> > >
> > > ---
> > > Outgoing mail is certified Virus Free.
> > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/2002
> > >
> > >
> >
> >
>
>---
-
> >
> >
> >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >---
> >Incoming mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/2002
>
> Frank Miller
> Computer Specialist and Webmaster
> Technology and Distance Education
> Texas A&M University-Texarkana
> 2600 North Robison Rd
> Texarkana, Texas 75501
>
> Phone:  903-223-3156
> Fax:  903-223-3139
> Office:   165
>






>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.325 / Virus Database: 182 - Release Date: 2/19/2002
>
>






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

2002-02-28 Thread PHP List

Thanks,
Sorry I asked, I should have just searched for it, but my clue-x-4 is
broken.

> > Does anyone know where the PNG library went?
> > The manual points to cdrom.com/pub/png, but that does not exist anymore.
>
> http://www.libpng.org/pub/png/
>
> 
> Greg Donald - http://destiney.com/
> http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
> 
>


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




Re: [PHP] Stupid Question

2002-02-28 Thread PHP List

RE: [PHP] Stupid QuestionThanks for all the responses.

Just to be clear, I have php installed as a module, so I have to re-compile apache.



  - Original Message - 
  From: Adam Plocher 
  To: 'PHP List' 
  Sent: Thursday, February 28, 2002 9:46 AM
  Subject: RE: [PHP] Stupid Question


  It depends on how you have php setup to begin with.  If you have it setup to be used 
as a loadable module, then you can just recompile the php module and re-insert it (I 
don't remember how exactly).  If you don't know how it's setup, I'm guessing it's not 
a loadable module and you will need to recompile apache.

  FYI. http://www.php.net/manual/en/installation.php <-- installation instructions. 

  -----Original Message- 
  From: PHP List [mailto:[EMAIL PROTECTED]] 
  Sent: Thursday, February 28, 2002 9:27 AM 
  To: php 
  Subject: [PHP] Stupid Question 



  Yes, this is probably in the manual, but I can't find it. 

  If I want to upgrade from 4.0.6 to 4.1.2, do I have to re-compile apache as well? 

  Thanks 

  Chris 



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



[PHP] PNG Lib

2002-02-28 Thread PHP List

Hi,
Does anyone know where the PNG library went?
The manual points to cdrom.com/pub/png, but that does not exist anymore.

Thanks for any help.
Chris



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




[PHP] Stupid Question

2002-02-28 Thread PHP List

Yes, this is probably in the manual, but I can't find it.

If I want to upgrade from 4.0.6 to 4.1.2, do I have to re-compile apache as
well?

Thanks

Chris


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




[PHP] Sessions and Classes

2002-02-05 Thread PHP-List

What is the proper way to transfer class properties through-out my pages...

let's say i have a ShoppingCart Class and i have methods like
addToCart(id, qty) and deleteFromCart(id)
also i have properties like CartItems("id" => array(), "qty"=> array())

this is what i do...

//when the user enters my site, i do some...
-
if (!session_is_registered("myCart")){
$myCart = new ShoppingCart();
 (some other stuffs...)
session_register("myCart");
}
else {
$myCart = new ShoppingCart();
}

--
if the object in the session is not present
i would create an instance and then register 
it to the session.
else if it is present, i would just reconstruct it...
because if i don't, even though it is in the 
sessions, the properties and methods are 
not constructed (no handler, i don't know how 
to call it).

my code works, but is there any other way
to do this, because i think it's kinda slow 

another question, is it ok to have a database-driven
shopping cart? i make use of the database to as the 
actual cart holder?


i need your opinions on these


thanks!



Brian Feliciano
---

i lost my connection to the list for a while, so
i have never heard your answers, please post it again or
email it to me directly..

thanks...



-- 
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] RePOST: Sessions and Classes

2002-02-05 Thread PHP-List

What is the proper way to transfer class properties through-out my pages...

let's say i have a ShoppingCart Class and i have methods like
addToCart(id, qty) and deleteFromCart(id)
also i have properties like CartItems("id" => array(), "qty"=> array())

this is what i do...

//when the user enters my site, i do some...
-
if (!session_is_registered("myCart")){
$myCart = new ShoppingCart();
 (some other stuffs...)
session_register("myCart");
}
else {
$myCart = new ShoppingCart();
}

--
if the object in the session is not present
i would create an instance and then register 
it to the session.
else if it is present, i would just reconstruct it...
because if i don't, even though it is in the 
sessions, the properties and methods are 
not constructed (no handler, i don't know how 
to call it).

my code works, but is there any other way
to do this, because i think it's kinda slow 

another question, is it ok to have a database-driven
shopping cart? i make use of the database to as the 
actual cart holder?


i need your opinions on these


thanks!



Brian Feliciano
---

i lost my connection to the list for a while, so
i have never heard your answers, please post it again or
email it to me directly..

thanks...



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




[PHP] PHP Classes and Sessions

2002-02-04 Thread PHP-List

What is the proper way to transfer class properties through-out my pages...

let's say i have a ShoppingCart Class and i have methods like
addToCart(id, qty) and deleteFromCart(id)
also i have properties like CartItems("id" => array(), "qty"=> array())

this is what i do...

//when the user enters my site, i do some...
-
if (!session_is_registered("myCart")){
$myCart = new ShoppingCart();
 (some other stuffs...)
session_register("myCart");
}
else {
$myCart = new ShoppingCart();
}

--
if the object in the session is not present
i would create an instance and then register 
it to the session.
else if it is present, i would just reconstruct it...
because if i don't, even though it is in the 
sessions, the properties and methods are 
not constructed (no handler, i don't know how 
to call it).

my code works, but is there any other way
to do this, because i think it's kinda slow 

another question, is it ok to have a database-driven
shopping cart? i make use of the database to as the 
actual cart holder?


i need your opinions on these


thanks!



Brian Feliciano





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




[PHP] Regex error

2002-01-18 Thread PHP List

Hi,
Can someone please tell me why the this is happening:

1)   $szTag = "test|3";
2)   $rgTemp = split("|",$szTag);
3)   $szTag = $rgTemp[0];
4)   $nItemID = $rgTemp[1];
^line numbers for ref only, not in actual code.


Will give me the error:
PHP Warning:  unexpected regex error(14) in /test.php on line 2

What is an error 14 ?



Thanks,
Chris



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




Re: [PHP] printing html

2002-01-18 Thread PHP List

You could just change the code for the generated page to re-generate the
page without the headers, etc. Then just link to the same page with a print
command:

echo "Click here for a printable version of
this page.";


if ($print <> "yes")
include("header.inc");


Something like that anyways.

- Original Message -
From: "fitiux" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Friday, January 18, 2002 12:44 PM
Subject: [PHP] printing html


> Hi friends,  =)
>
> someone have experience using  printer functions  ?
> I mean... I would like to print a php generated page with a link within
this
> page
>
> example:
> I have an html page with a table..but I need to print without header,
footer
> and also I need to print in landscape... all of this with a link within
this
> generated page.
>
>  can I do this with PHP ?
>
>
> thanks for your advice.
> best regards..
>
> (sorry me... my english isn't good enough)   :-)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Images

2001-12-20 Thread PHP List

Thanks, but my html is valid, and what you are doing is not what I want to
do.
I want to display a random image included in the page, just like a banner
program would work.
I do not allow php execution on the page so the only way to get the image is
to call the script with the img src tag, just like a banner program would.


> First of all your HTML is not valid.  Secondly I believe you're making it
> more complex than it needs to be.  And since this is ending up in HTML
> anyway you don't need to concern yourself with the headers.   Start off
with
> something simple like what I have below, and go from there.
>
> 
> Display myPicture.gif
>
>  if ($image) {echo "http://www.myurl.com/mypicture.gif\";>;}
> ?>
> 
>
> Hope this helps,
> Kevin
>
> > Hi,
> > I am trying to do something like this:
> > 
> >
> > The code is like this:
> >
> > 
> > $szPicture = "myimage.gif";
> >
> > $url = "http://www.mysite.com/"; . $szPicture;
> > header("Content-type: image/gif");
> > header("Content-Length: " . strlen($url));
> > echo $url;
> > 
> >
> > But nothing happens, I just get the broken image.
> > My logs show nothing about a script failure or about a file not being
> found.
> > I tried without the header("Content-Length: " . strlen($url)); but no
> diff.
> >
> > Thanks for any help.
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >


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




[PHP] Images

2001-12-20 Thread PHP List

Hi,
I am trying to do something like this:


The code is like this:


$szPicture = "myimage.gif";

$url = "http://www.mysite.com/"; . $szPicture;
header("Content-type: image/gif");
header("Content-Length: " . strlen($url));
echo $url;


But nothing happens, I just get the broken image.
My logs show nothing about a script failure or about a file not being found.
I tried without the header("Content-Length: " . strlen($url)); but no diff.

Thanks for any help.


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




Re: [PHP] Process bar

2001-11-20 Thread PHP List

There is a way to do it with javascript, works in IE but have not tried it
with Netscape.


> Hello,
> I have to solve one problem - my script searches simply text document,
so - if this document is big enought - i have to "replace" timeout of my
script, besides - i have to make, that then this proceeds some kind of
process bar must scroll until script finishes his job...
> so - any ideas ?
> Thnx anyway :)


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




Re: Re: [PHP] How do I convert from perl to php?

2001-11-20 Thread PHP List

How about like this:

$required = array("field1","field2","field3");

for ($i=0;$i
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 20, 2001 2:21 PM
Subject: Re: Re: [PHP] How do I convert from perl to php?


> So I would have to write a seperate if condition for each form input field
i wanted to require? that doesn't make for a very dynamic script...
>
> > if(!(isset($name) && isset($address) && isset($phone)) {
> > echo "You left one empty.";
> > }
> >
> > On Tue, 20 Nov 2001 [EMAIL PROTECTED] wrote:
> >
> > > I am a perl user trying to convert to php
> > >
> > > how would i turn this perl into php?
> > >
> > > use CGI;
> > >
> > > $name = param(name);
> > > $address = param(address);
> > > $phone = param(phone);
> > >
> > > @required = qw( name address phone );
> > >
> > > foreach $key($required)
> > > {
> > >  if (!$$key) { &out("You left one empty."); }
> > > }
> > >
> > > ??
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Check contents of variable

2001-11-20 Thread PHP List

Correct, the third parameter is for the number of characters to read,
nothing means entire string.

Function details can be found here:
http://download.php.net/manual/en/function.substr.php


> > How about:
> >
> > if (substr($url,0,7) <> "http://";)
> > $url = "http://"; . $url;
>
> Thanks!
>
> That´s just the function i am looking for. I looked it up in the manual.
> Correct me if i am wrong - if i don´t set the second parameter in substr
it
> just continues to read until the variable is finished? If i set it to 7
(as
> above) it stops reading after 7 characters?
>
> - Daniel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Check contents of variable

2001-11-20 Thread PHP List

How about:

if (substr($url,0,7) <> "http://";)
$url = "http://"; . $url;


> Hi,
>
> which function would i use to check if a certain value is in the contents
of
> a variable?
>
> I have a form where the users submits url's. I need the url with http://
in
> the beginning. Since there is more data after the http:// i can´t just do
a
> simple if-statement. So what do i do?
>
> After i determined if there is a http:// in the variable or not i guess i
> just have to $url = "http://"; + $url; (?)...
>
> Regards
> # Daniel Alsén| www.mindbash.com #
> # [EMAIL PROTECTED]  | +46 704 86 14 92 #
> # ICQ: 63006462   |  #
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] htaccess

2001-09-21 Thread PHP List

Hi,
I heard it was possible to turn off/on php execution in a directory using
the .htaccess file.
Can some one tell me how to do that?

Thanks.



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




Re: [PHP] Engine Question

2001-09-04 Thread PHP List

Thanks,
The manual doesn't really make it clear though, all it says is:
This sets the value of the specified variable.

php_flag name on|off

And then it later it says:

engine boolean

This directive is really only useful in the Apache module version of PHP. It
is used by sites that would like to turn PHP parsing on and off on a
per-directory or per-virtual server basis. By putting engine off in the
appropriate places in the httpd.conf file, PHP can be enabled or disabled.



Kind of misleading that last part.

- Original Message -
From: "Steve Edberg" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]>
Sent: Tuesday, September 04, 2001 11:52 AM
Subject: Re: [PHP] Engine Question


> PHP4's configuration syntax has changed; see
>
> http://www.php.net/manual/en/configuration.php
>
> Try using the line
>
> php_flag engine on
>
>
> -steve
>
>
> At 11:35 AM -0700 9/4/01, PHP List wrote:
> >Hi,
> >I am trying to update my server to php4. Everything seemd to compile
fine.
> >httpd -l shows mod_php4.c in the list.
> >
> >I used to use these entries in my httpd.conf to specifically turn
> >php on in certain dirs instead of default on for everyting.
> >
> >
> >php3_engine on
> >
> >
> >But I cannot find a combo that works now, I allways get an error.
> >How do I do this with php4?
>
> --
> + Open source questions? +
> | Steve Edberg   University of California, Davis |
> | [EMAIL PROTECTED]   Computer Consultant |
> | http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
> +--- http://pgfsun.ucdavis.edu/open-source-tools.html ---+
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] Engine Question

2001-09-04 Thread PHP List

Hi,
I am trying to update my server to php4. Everything seemd to compile fine.
httpd -l shows mod_php4.c in the list.

I used to use these entries in my httpd.conf to specifically turn php on in certain 
dirs instead of default on for everyting.

   
php3_engine on


But I cannot find a combo that works now, I allways get an error.  How do I do this 
with php4?



Re: [PHP] Strange Form Error

2001-08-30 Thread PHP List


> On Thu, 30 Aug 2001 02:25, PHP List wrote:
> > Hi,
> > Can anyone tell me why php is behaving like this?
> >
> > If I use enctype="multipart/form-data", it seems the first form field
> > is not passed to php. ex:
> >  > enctype="multipart/form-data">  > value="edit">
> >
> > $cmd will not be passed to php, I have to do this:
> >
> >  > enctype="multipart/form-data">  > value="null">
> > 
> >
> > Now I can use $cmd.
> > Is this normal?
>
> If you are trying to upload a file, I think you need to have a hidden
> field for MAX_FILE_SIZE - check the Handling File Uploads section of the
> manual.
>

I do have that field later on in the form and the uploading is working fine.
It just seems to ignore the first form field.


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




[PHP] Strange Form Error

2001-08-29 Thread PHP List

Hi,
Can anyone tell me why php is behaving like this?

If I use enctype="multipart/form-data", it seems the first form field is not passed to 
php.
ex:



$cmd will not be passed to php, I have to do this:





Now I can use $cmd.
Is this normal?
 
Windows Law 1: What boots up must come down...
 All I ask of life is a constant and exaggerated sense of my own
importance.  
Chris Kovalcik
Systems Administrator
Interactive Broadcasting Corporation
[EMAIL PROTECTED]
-
Creators of:
BC Adventure Network www.bcadventure.com
BC Books www.bcbooks.com
Casting Shadows www.castingshadows.com
Cowboylife www.cowboylife.com
Fish BC www.fishbc.com
Western Fly Fisher Magazine www.westernflyfisher.com




Re: [PHP] Win One of 25 Dream Vacation Getaways!! .

2001-08-16 Thread PHP List

Ge, does this mean we ALL won?  :O


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 16, 2001 2:40 PM
Subject: [PHP] Win One of 25 Dream Vacation Getaways!! .


> You have been specially selected to qualify for the following:
>
> Premium Vacation Package and Pentium PC Giveaway
> To review the details of the please click on the link
> with the confirmation number below:
>
> http://www.1xin.net/wintrip
>
> Confirmation Number#Lh340
> Please confirm your entry within 24 hours of receipt of this confirmation.
>
> Wishing you a fun filled vacation!
> If you should have any additional questions or cann't connect to the site
> do not hesitate to contact me direct:
> mailto:[EMAIL PROTECTED]?subject=Help!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: SV: [PHP] Sending alots of mail

2001-08-16 Thread PHP List

Thats interesting.
I tried to do the same thing with 5000 emails using sendmail, and I found
that only about 1/2 were actually sent, it seems like the multiple calls to
mail caused some of them to be ignored. I had to sleep for a couple of
seconds before each call to mail() in order to get them all out.

No one else had this problem?

- Original Message -
From: "Tim" <[EMAIL PROTECTED]>
To: "Jimmy Bäckström" <[EMAIL PROTECTED]>
Cc: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, August 16, 2001 9:39 AM
Subject: Re: SV: [PHP] Sending alots of mail


> I have a system where we send periodic batches of 60,000 messages at a
> time, so it's definitely doable.  It helps to put some throttling in
> there (i.e. a sleep() periodically) to be kind to your e-mail server.
>
> - Tim
>
> On 16 Aug 2001 18:34:11 +0200, Jimmy Bäckström wrote:
> > Hmm I knew that =)
> > I just wondered if it's such a good idea. 5000 mail is very much you
know.
> >
> > /Jimmy
> > - Original Message -
> > From: Tyler Longren <[EMAIL PROTECTED]>
> > To: Jimmy Bäckström <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Thursday, August 16, 2001 6:25 PM
> > Subject: Re: [PHP] Sending alots of mail
> >
> >
> > > This was just discussed last week.  Here's how:
> > > $connection = mysql_connect("host","user","pass");
> > > $db = mysql_select_db("db_name", $connection);
> > > $sql = mysql_query("SELECT * FROM table_name ORDER BY email ASC");
> > > while ($row = mysql_fetch_array($sql)) {
> > > $email = $row["email"];
> > > $name = $row["name"];
> > > // code to send email (use the mail() function)
> > > }
> > >
> > > Good luck,
> > > Tyler Longren
> > > Captain Jack Communications
> > > [EMAIL PROTECTED]
> > > www.captainjack.com
> > >
> > >
> > >
> > > On Thu, 16 Aug 2001 18:29:04 +0200
> > > Jimmy Bäckström <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hi list!
> > > > I'm about to write an application that takes about 5000 mailadresses
> > > > from a database, and then sends a mail to each one of them. I
haven't
> > > > done this kind of apps before, so I don't know if it's a good idea.
Does
> > > > anyone have any suggestions?
> > > >
> > > > /Jimmy
> > > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Need open source community help!

2001-08-15 Thread PHP List

IMO
I would have to say it depends on the Timeline of your Boss.
Releasing the app to the open source community would be great, the more
there is, the more reason for people to stop using MS, but you can't demand
a schedule of when new features will be added.
You may have to go with the MS for now, and wait for your app to be
developed with the new features, then convince your boss on moving to your
software. You should be able to move all the data from one to the other
without to much trouble.

Chris

- Original Message -
From: "Jay Paulson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 1:39 PM
Subject: [PHP] Need open source community help!


> Hello everyone-
>
> (skip to the *'s to see the questions if you don't want to read all of
> this thanks)
>
> This might be a little off topic here but I really need some help and a
> great opionion on this matter.  Here's the situation, I have created this
> software in php and mysql.  What it is is it has user authetification,
event
> calendar for several web sites, a personal calendar for each user of the
> calendar, and a company calendar.  I'm hoping that I can get to a point
soon
> to release this under the gpl and have the open source community help
> develope the software, if they wish.
>
> What I'm using this software for... The company I work for only has one
> developer (me :) ) and they have 6 web sites they want done.  So what I
have
> done is created this software so that I can enter all the employee's of
the
> company and then give them access to the sections they need.  For example,
> human resources has access to add new employee's, delete employee's, and
> update employee's information.  The average user has access to a personal
> calendar in which they can add events give the event a time, a name, and a
> description.  Also, the average user has the ablity to chance certain
things
> about their own profile.. i.e. address, phone #s etc.
>
> Now people who I give access can have access to the event calendars for
each
> website and they will be able to add events, delete events, and update
> events.  The options when adding an event is the event name, the category
of
> the event (i.e. concert, on location promo etc), where the event is being
> held, the person to contact for the event, time of the event, price of the
> event, the description of the event, and an option to either show the
event
> on the web or not.
>
> Also, the admin has the ability to add new "modules" to the software and
> then give access to whomever he/she see needs access to it.   Lastly,
there
> is a huge help file that is generated dynamically when you add these new
> "modules."
>
> (sorry about the lenght of this but it's necessary)
>
> Now here's the evil twist of fate...
>
> There's a company who has some calendar software that has a TON of
features
> that I don't have in my software (as of yet).  However, they are a total
> Microsoft shop running all their code in VB, ASP, and their DB is MSSQL 7.
> I really don't like the fact that they use Microsoft because I am going to
> be the one to administer the box this is going to be running on (would
much
> rather run unix set it up once and leave it alone, unlike Microsoft where
> you have to babysit the damn thing).
>
> Now I've been talking with these people and they pretty much refuse to
move
> any of their code to php, mysql, or any varient of unix because it
wouldn't
> be cost effective to them right now (they said that they might do it later
> when they can hire a team to convert all the code over to it).
>
> Here's the thing.. I've been working on this software for about 4 months
now
> so I really want to use it, but the big guns here in the company want to
use
> this other ASP Microsoft stuff that has a ton more features.  If we go
with
> ASP crap, I'm going to have to learn ASP and VB (I'm assuming most DB's
are
> the same so learning MSSQL 7 wouldn't be too hard) and I'm going to have
to
> babysit the Win2k server, which is something else I don't want to do.
>
> *
> So with all this said I'm wondering just how welcome you think this
software
> would be in the open source community?  Is there a need for something like
I
> have and am still developing?  Do you all think that I could get some more
> developers to work on this software to make it even more powerful than it
is
> now?
>
> The reason why I ask these qestions is I don't want to go with Micro$oft,
> throw away 4 months of work, and have to learn entirely new stuff.
>
> Any suggestions or help would be great!
> Thanks SO much!
> Jay Paulson
> Internet Program Director
> LBJS
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit

[PHP] Engine help

2001-08-15 Thread PHP List

Hi,
I am trying to upgrade from php3 to php4, I recompiled apache_1.3.20 and php4.0.6 as 
per instructions(http://www.php.net/manual/en/install.apache.php).

Everything seemed ok, but LoadModule in the httpd.conf was no longer recognized so I # 
all the LoadModule and AddModule lines. httpd -l shows mod_php4.c in the list.

However, I was using this before:

php3_engine on


What do I use now? I tried just engine on, but httpd complains:
Invalid command 'engine', perhaps mis-spelled or defined by a module not included in 
the server configuration

Thanks for any help.



Re: [PHP] Loop error?

2001-08-14 Thread PHP List

Oops, well, that is just mental.
Must be getting tired or something, yes, that's it :)

Thanks.


- Original Message - 
From: "Gyozo Papp" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]>
Sent: Tuesday, August 14, 2001 4:58 PM
Subject: Re: [PHP] Loop error?


> Hi,
> 
> clear that semicolon(;) after the while statement!
> 
> this makes the trick
> - Original Message - 
> From: "PHP List" <[EMAIL PROTECTED]>
> To: "php" <[EMAIL PROTECTED]>
> Sent: 2001. augusztus 15. 01:49
> Subject: [PHP] Loop error?
> 
> 
> Hi,
> Can anyone tell me why this is a never ending loop?
> 
> $i=0;
> $count = 1;
> while ($count > $i);
> {
> echo "$i ";
> $i++;
> }
> Chris
> 


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




[PHP] Loop error?

2001-08-14 Thread PHP List

Hi,
Can anyone tell me why this is a never ending loop?

$i=0;
$count = 1;
while ($count > $i);
{
echo "$i ";
$i++;
}
Chris



[PHP] mysql table dump problem

2001-01-20 Thread PHP List

Hi list,

I have scoured the archives with no good game plans.

Here is what I am trying to accomplish:

dump a table to a file on my server:
$sql = "SELECT * INTO OUTFILE '/tmp/test.txt' FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n' FROM table_name";

take the file and email it to someone:
using a mime-mail class from http://phpclasses.upperdesign.com

The above works perfectly.  I am able to create the file and email it to a
designated address.

Problem is that once I have created the dump file, it will not allow me to
overwrite it and it gives me an error.  Error = rm: cannot unlink
`test.txt': Operation not permitted.  It is owned by mysql:mysql.  So it
looks like it must be deleted by root or I need to change the ownership of
the file so it can be deleted.  So...

What is the best way to remove the file before re-dumping it to the /tmp
directory?  I'm not sure if it is possible to switch to root...but I know
that is probably a very bad idea.  How can I change the ownership of the
file so it can be deleted from PHP code?

TIA,

Scott

P.S.  Please cc: me on any responses as I am no longer a member of the list.


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