[PHP] return the amount of records in a mysql databace

2002-09-22 Thread Philip J. Newman

Can someone point me in the right direction to find out how i can return the
amount of records in a mysql databace ?

---
Philip J. Newman.
PhilipNZ.com New Zealand
http://www.philipnz.com/
[EMAIL PROTECTED]

Mob: +64 (25) 6144012.
Tele: +64 (9) 5769491.

Family Site:
Philip J. Newman
Internet Developer
http://www.newman.net.nz/
[EMAIL PROTECTED]




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




Re: [PHP] Running a PHP script automatically?

2002-09-22 Thread Tom Rogers

Hi,

Sunday, September 22, 2002, 2:44:54 PM, you wrote:
JS Folks, I have a PHP script that needs to be executed automatically every 15 
minutes. I have the option of doing this on a RedHat linux box, or on Windows 2000 
Server.

JS How would I do this (on either platform) and which would be easier?

JS I believe somehow I could create a cron job on linux, but I'm a bit confused how 
that would work. Would I just call the php script using Lynx? If so, does the Lynx 
process die when the php script
JS is finished? Will I have dozens of Lynx processes still running at the end of the 
day?

JS In Windows, I believe I could use the task scheduler, or something like that. But 
again, how exactly would I call the script? I certainly don't want a new browser 
window to open every 15 minutes,
JS especially if it doesn't close again.

JS Any insight? Thanks!

JS Joseph


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


I do this in cron

0,15,30,45 * * * * /usr/bin/lynx -dump http://domain.com/clkdown.php 1 /dev/null 2 
/dev/null

-- 
regards,
Tom


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




[PHP] counting guest users

2002-09-22 Thread Andy

Hi there,

I am wondering how some pages count guest users. An example is phpbb. They
always know how many guest users are browsing the site. Are they using
cookies or db for this, or both? Maybe there is a code snipped out for this
already?

Thank you for any hint on that.

Andy



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




Re: [PHP] Running a PHP script automatically?

2002-09-22 Thread David McInnis

This is what your are looking for.  It works great.

I think this article assumes Linux which is what I use anyway.  I guess that
if you were to use windows you could schedule the task but you would need to
call it using

c:\pathTOphp\php.exe c:\pathTOscript\script.php

Use Linux!

David

- Original Message -
From: Tom Rogers [EMAIL PROTECTED]
To: Joseph Szobody [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 12:02 AM
Subject: Re: [PHP] Running a PHP script automatically?


 Hi,

 Sunday, September 22, 2002, 2:44:54 PM, you wrote:
 JS Folks, I have a PHP script that needs to be executed automatically
every 15 minutes. I have the option of doing this on a RedHat linux box, or
on Windows 2000 Server.

 JS How would I do this (on either platform) and which would be easier?

 JS I believe somehow I could create a cron job on linux, but I'm a bit
confused how that would work. Would I just call the php script using Lynx?
If so, does the Lynx process die when the php script
 JS is finished? Will I have dozens of Lynx processes still running at the
end of the day?

 JS In Windows, I believe I could use the task scheduler, or something
like that. But again, how exactly would I call the script? I certainly don't
want a new browser window to open every 15 minutes,
 JS especially if it doesn't close again.

 JS Any insight? Thanks!

 JS Joseph


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


 I do this in cron

 0,15,30,45 * * * * /usr/bin/lynx -dump http://domain.com/clkdown.php 1
/dev/null 2 /dev/null

 --
 regards,
 Tom


 --
 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]Running a PHP script automatically? FORGOT the link

2002-09-22 Thread David McInnis

Sorry, I forgot the link.

http://phpbuilder.com/columns/darrell2319.php3

David

- Original Message -
From: David McInnis [EMAIL PROTECTED]
To: Tom Rogers [EMAIL PROTECTED]; Joseph Szobody
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 12:16 AM
Subject: Re: [PHP] Running a PHP script automatically?


 This is what your are looking for.  It works great.

 I think this article assumes Linux which is what I use anyway.  I guess
that
 if you were to use windows you could schedule the task but you would need
to
 call it using

 c:\pathTOphp\php.exe c:\pathTOscript\script.php

 Use Linux!

 David

 - Original Message -
 From: Tom Rogers [EMAIL PROTECTED]
 To: Joseph Szobody [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Sunday, September 22, 2002 12:02 AM
 Subject: Re: [PHP] Running a PHP script automatically?


  Hi,
 
  Sunday, September 22, 2002, 2:44:54 PM, you wrote:
  JS Folks, I have a PHP script that needs to be executed automatically
 every 15 minutes. I have the option of doing this on a RedHat linux box,
or
 on Windows 2000 Server.
 
  JS How would I do this (on either platform) and which would be easier?
 
  JS I believe somehow I could create a cron job on linux, but I'm a bit
 confused how that would work. Would I just call the php script using Lynx?
 If so, does the Lynx process die when the php script
  JS is finished? Will I have dozens of Lynx processes still running at
the
 end of the day?
 
  JS In Windows, I believe I could use the task scheduler, or something
 like that. But again, how exactly would I call the script? I certainly
don't
 want a new browser window to open every 15 minutes,
  JS especially if it doesn't close again.
 
  JS Any insight? Thanks!
 
  JS Joseph
 
 
  JS --
  JS PHP General Mailing List (http://www.php.net/)
  JS To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  I do this in cron
 
  0,15,30,45 * * * * /usr/bin/lynx -dump http://domain.com/clkdown.php 1
 /dev/null 2 /dev/null
 
  --
  regards,
  Tom
 
 
  --
  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] Re: Java?

2002-09-22 Thread Alexander Kleshchevnikov

On 04 ??? 2000, you wrote in php.general:

 I note that the documentation for PHP 4.0 says that Java is supported;
 I haven't been able to find any documentation on how it is supported. 
 Can someone point me to something?
 
 Hugh
 
 --
 Hugh Caley, Lumeria, Inc.
 Lead Systems Engineer
 [EMAIL PROTECTED]
 
 
 
 
Testing ...

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




[PHP] Elliptic curve cryptology

2002-09-22 Thread EjdeR

i cant find any example about Elliptic curve cryptology.. do you have any
example? i cant understand without an example :)




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




[PHP] A weired browser-session problem

2002-09-22 Thread Monil Chheda

Hello friends,

I have a weired problem with sessions.

I am using session_start();
session_register(Sessionname);

The following is my problem.
1) User with valid username and password is given an
Administration Menu.
2) Various options are there. He selects a particular
option.
3) The selected option is opened in a new page.
4) He does his job on the new window. But midway ( say
after 2 pages ), after making a few chioices, he
closes the newly opened window,leading to some
variables being registered
5) Now , after some time , selects the same option.
6) Makes his selection. But , he gets the choices that
he had used previous time inspite of him closing the
window .

How do I get rid of the problem ? I would like that
even if the user closes the browser midway and then
again checks the same , his new sessions should be
registered and not the old.

Is there a way wherein we can destroy the sessions of
the new browser window as soon as the browser is
closed ?

I would be very thankful to you for your help.
Thanks a zillion for your help.

Best Regards,
Monil Chheda
http://www.eliteral.com
http://domains.eliteral.com
http://services.eliteral.com

=
Best Regards,
Monil Chheda(INDIA)
http://domains.eliteral.com
===
===

__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

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




Re: [PHP] Elliptic curve cryptology

2002-09-22 Thread Danny Shepherd

http://www.amazon.com/exec/obidos/ASIN/1884777694/102-5129419-0804910

- Original Message -
From: EjdeR [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 11:12 AM
Subject: [PHP] Elliptic curve cryptology


 i cant find any example about Elliptic curve cryptology.. do you have
any
 example? i cant understand without an example :)




 --
 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] return the amount of records in a mysql databace

2002-09-22 Thread Mark Charette

select count(*) as n from ... where ...

-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]]

Can someone point me in the right direction to find out how i can return the
amount of records in a mysql databace ?


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




php-general Digest 22 Sep 2002 13:29:47 -0000 Issue 1600

2002-09-22 Thread php-general-digest-help


php-general Digest 22 Sep 2002 13:29:47 - Issue 1600

Topics (messages 117126 through 117161):

Re: checking if an array is empty
117126 by: Michael Sims
117128 by: electroteque
117132 by: Michael Sims
117133 by: electroteque

Re: Editor
117127 by: B.C. Lance
117140 by: Chip Wiegand
117147 by: Jeff Bluemel

[[EMAIL PROTECTED]: RE: php emails]
117129 by: The Doctor
117138 by: Michael Geier
117143 by: The Doctor

Re: sessions
117130 by: Chris Shiflett

ob_end_clean and header redirecting
117131 by: electroteque

Design question.
117134 by: Chuck PUP Payne
117136 by: Justin French
117137 by: Chris Shiflett
117139 by: Chuck PUP Payne
117145 by: . Edwin

more stress on server...
117135 by: Matt Zur

Re: Help sending IMAP mail
117141 by: Manuel Lemos

Re: Best Practice
117142 by: Peter J. Schoenster
117144 by: . Edwin
117148 by: Peter J. Schoenster

Re: accessing session variables
117146 by: Jeff Bluemel

Running a PHP script automatically?
117149 by: Joseph Szobody
117150 by: Chris Shiflett
117151 by: Keith Vance
117153 by: Tom Rogers
117155 by: David McInnis

return the amount of records in a mysql databace
117152 by: Philip J. Newman
117161 by: Mark Charette

counting guest users
117154 by: Andy

Re: Running a PHP script automatically?  FORGOT the link
117156 by: David McInnis

Re: Java?
117157 by: Alexander Kleshchevnikov

Elliptic curve cryptology
117158 by: EjdeR
117160 by: Danny Shepherd

A weired browser-session problem
117159 by: Monil Chheda

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

On Sun, 22 Sep 2002 01:13:08 +1000, you wrote:

how can i check if an array is currently empty , for instance i have a file
input field with an array name for multiple images, i need to check if there
was no file uploaded in that field name and ignore it in the loop

I find that empty() works well to test if an array contains any
elements...

---End Message---
---BeginMessage---

thats the thing , the word Array is what it returns even though there was no
input file.

Michael Sims [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Sun, 22 Sep 2002 01:13:08 +1000, you wrote:

how can i check if an array is currently empty , for instance i have a file
input field with an array name for multiple images, i need to check if
there
was no file uploaded in that field name and ignore it in the loop

I find that empty() works well to test if an array contains any
elements...



---End Message---
---BeginMessage---

On Sun, 22 Sep 2002 11:09:16 +1000, you wrote:

thats the thing , the word Array is what it returns even though there was no
input file.

Oh, I see.  Without seeing your code, the best recommendation I have
is to loop through the array and remove the empty elements, then check
to see if the array is empty, something like this:

if (is_array($array)) {
  foreach ($array as $key = $element) {
if ($element == ) {
  unset($array[$key]);
}
  }
}

if (empty($array)) {
  ...
}

Sorry if I'm still misunderstanding...

---End Message---
---BeginMessage---

yeh wicked thanks

-Original Message-
From: Michael Sims [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 22, 2002 11:48 AM
To: [EMAIL PROTECTED]
Cc: electroteque
Subject: Re: [PHP] checking if an array is empty


On Sun, 22 Sep 2002 11:09:16 +1000, you wrote:

thats the thing , the word Array is what it returns even though there was
no
input file.

Oh, I see.  Without seeing your code, the best recommendation I have
is to loop through the array and remove the empty elements, then check
to see if the array is empty, something like this:

if (is_array($array)) {
  foreach ($array as $key = $element) {
if ($element == ) {
  unset($array[$key]);
}
  }
}

if (empty($array)) {
  ...
}

Sorry if I'm still misunderstanding...


---End Message---
---BeginMessage---

http://www.phpedit.net



Bryan McLemore wrote:
 Hi guys, just wondering if anyone could recomend a good editor that is based on 
windows.  Thanks, Bryan
 


---End Message---
---BeginMessage---

On Sat, 2002-09-21 at 06:15, Bryan McLemore wrote:
 Hi guys, just wondering if anyone could recomend a good editor that is based on 
windows.  Thanks, Bryan

HTML-Kit by Chami software (www.chami.com) - saves in unix format or
windoze format, extremely configurable, direct uploads/downloads/editing
of files on the remote server, built in Tidy, etc etc.

--
Chip


---End Message---
---BeginMessage---

I am using Zend Studio, and I 

[PHP] mysql password function

2002-09-22 Thread Murat Ö.

hi,
i want to encode a string that users enter with mysql password function. but
sometimes this code works sometimes don't. mysql warns me:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in 

the code is:

$result=mysql_query(select password(.$_POST['password'].));
  while ($p = mysql_fetch_array($result, MYSQL_ASSOC)):
  $pswrd=$p['password('.$_POST['password'].')'];
  endwhile;

thanks...




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




Re: [PHP] Elliptic curve cryptology

2002-09-22 Thread EjdeR

i know searching.. and buy books. i asked for an little example..

Danny Shepherd [EMAIL PROTECTED] wrote in message
001201c2622d$4d52d640$0200a8c0@DANNYS">news:001201c2622d$4d52d640$0200a8c0@DANNYS...
 http://www.amazon.com/exec/obidos/ASIN/1884777694/102-5129419-0804910

 - Original Message -
 From: EjdeR [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 22, 2002 11:12 AM
 Subject: [PHP] Elliptic curve cryptology


  i cant find any example about Elliptic curve cryptology.. do you have
 any
  example? i cant understand without an example :)
 
 
 
 
  --
  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] A weired browser-session problem

2002-09-22 Thread Chris Shiflett

Monil,

First, from the perspective of the Web server, there is only one 
browser. Also, there is no way to know when a user closes a browser.

So, your problem just sounds like PHP is *maintaining* the session, 
which is exactly what it is supposed to do. :-) It is your job to 
maintain the data associated with a particular session, and there are 
functions to help you destroy data in a session, or you can simply 
reinitialize all of your session variables when the user first selects 
an option from the menu.

Happy hacking.

Chris

Monil Chheda wrote:

The following is my problem.
1) User with valid username and password is given an
Administration Menu.
2) Various options are there. He selects a particular
option.
3) The selected option is opened in a new page.
4) He does his job on the new window. But midway ( say
after 2 pages ), after making a few chioices, he
closes the newly opened window,leading to some
variables being registered
5) Now , after some time , selects the same option.
6) Makes his selection. But , he gets the choices that
he had used previous time inspite of him closing the
window .

How do I get rid of the problem ? I would like that
even if the user closes the browser midway and then
again checks the same , his new sessions should be
registered and not the old.

Is there a way wherein we can destroy the sessions of
the new browser window as soon as the browser is
closed ?



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




[PHP] cookies?

2002-09-22 Thread :B nerdy

i wish to POST submit to a login form on another server and then after that
POST some more information on the resulting page.

the thing is, after the first login, the website sends me a cookie. it
probably holds the session id and or authentication information. how will
can i relay this back to the page so i can view the resulting page without
being kicked out because of no cookie??

ive already used curl and am able to post things to scripts. but this cookie
problem i dont know how to get around.

any idea?
cheers




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




Re: [PHP] Re: LDAP (NDS) authentication example...

2002-09-22 Thread Stig Venaas

On Thu, Sep 12, 2002 at 09:37:22AM +1000, joshua wrote:
 i'm not sure if i follow you. i have never used ldap to write 
 authentication scripts as i've only used the .htaccess method.
 
 to retrieve data you need to bind using a username/password combination 
 that is valid. i guess you could test your user's username/password by 
 using it to attempt a bind.

The example below is correct, however in many cases you can avoid the
anonymous search. If say for all users you have entries with dn's like

uid=dj, o=users, dc=mycompany, dc=com

you can just do 

$dn = uid=$inp_uid, o=users, dc=mycompany, dc=com;
$ds = ldap_connect(ldap.someserver.com);
$r = ldap_bind($ds, $dn, $inp_passwd);

and check whether $r is true. Someone reported that there is some
implementation where this is falsely true for empty password, so
prior to this I would chech that the password string is non-empty,
just to be sure.

Stig

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




Re: [PHP] Elliptic curve cryptology

2002-09-22 Thread pan




 i cant find any example about Elliptic curve cryptology.. do you
have any
 example? i cant understand without an example :)


Ten seconds of googling produced these URLs.

http://www.certicom.com/resources/w_papers/w_papers.html

http://www.certicom.com/resources/ecc_tutorial/ecc_tutorial.html


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




[PHP] closing browser's window

2002-09-22 Thread Murat Ö.

hi,

is it possible to close client's browser's window from php script?

thanks...



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




[PHP] Create Thumbnails from image

2002-09-22 Thread Kjell Hansen

Hi,
I'm using a Win2k with php4.1 and I'd like to make some thumbnails from
pictures on my disk.
I've gotten the impression that it's possible, but I havent' found out
just how.

I've stumbled across the ImageCopyResized function but it requires a
imagehandle(?) to the file copied from. How do I get that? Is it the
right way to do this?
I guess I could use some picture manipulating program to do this, but
doing it the PHP way is nicer :)

TIA
Kjell


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




[PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Michael Sims

I have a few application design questions that I was hoping someone
might have some thoughts on.  I'll warn you in advance that this post
is kinda long winded.  I'll try my best not to use two many trendy
buzzwords, but I may not be able to avoid it. :-)

I work for a real-estate company and one of the functions of our
website is to (obviously) allow customers to search our listings
database.  I currently have a fairly straightforward set of PHP pages
that accepts search criteria, constructs SQL queries, and then
displays the listing data.  For quite some time this was more than
sufficient for our needs.

Recently we added a new application to what we provide that allows
customers to sign up to receive new listing notifications based on a
certain set of search criteria.  I was charged with the responsibility
of creating this application.  I decided (for various reasons) to
implement this application in Perl.

As I was putting the Perl script together I realized that I was going
to have to duplicate all of the business logic that existed in my PHP
pages to build the SQL queries and display the results.  For example,
different listings have different rules for display.  Some bits of
information cannot be legally displayed based on the location the
listing is in.  All of this business logic was wrapped up tightly
inside my PHP pages, and I realized I was going to have to implement
it again in my Perl script.  Worse yet, I realized that if any of this
business logic changes (which it often does), I was going to have to
remember to change it in TWO places.  Up until this point there was
only the website, but now that I had two completely seperate
applications that I have to maintain whenever anything changes.

I realized at this point that I would be really nice if the business
logic that determines how to construct the queries and which bits of
data to display were completely seperated from the presentation logic
that existed in my PHP pages.  If I had some sort of component that
merely accepted search parameters and returned data then I could
access this component from both the PHP page and the Perl script.  If
the business logic changed later I could simply update the component
and I (theoretically speaking) wouldn't have to touch the PHP page or
the Perl script.

I've been doing research into this kind of application design.  From
my limited and inexperienced perspective, it does appear that
Microsoft does offer some advantages in this area.  But COM is not an
option for me, for several reasons, not the least of which is the fact
that our servers run Linux and I cannot access PHP's COM functions.

I have considered setting up a PHP page that runs on a seperate port.
This page would accept search criteria via a query string, and then
return listing data in XML format.  Then on the PHP presentation side
(or my Perl script), I would parse the XML and either display it
manually, or use XSLT.

I don't have a lot of experience with this, however.  It seems that
XML support in PHP is still in a state of infancy.  I'm aware of
Sablotron, and I have successfully compiled PHP with Sablotron
support. But I've read articles that the SAX implementation that PHP
employs is inferior that the DOM model.  I've also read that the PHP
developers are working on improving the support for XML and XSLT by
using libxslt instead of Sablotron in later versions.  After reading
all of this, it seems like the best thing to do is to wait a bit until
XML support in PHP solidifies a little more.

Also, I am concerned that the overhead of connecting via TCP (even if
on the same physical web server), having a page generate XML,
receiving the response, and then having to parse it back out again,
might impact peformance too severely.  On our website, the most
popular thing is searching listings.  If I drastically reduce
responsiveness by adding all of this overhead, then I've made things
easier for programmers, at the expense of the end user.

Another technology I was toying around with is Java servlets and Java
Beans.  I'm a complete newbie when it comes to this stuff too, but
from what I've read it seems that Java Beans are designed to wrap up
business logic in reusable components.  Money is an issue, however, so
if I implemented anything in Java I would have to use Apache's Tomcat,
and not one of the commercial Java platforms.  I realize this is
wildly off-topic for this list, but if anyone here has any experience
with Tomcat I'd appreciate any advice (off-list if necessary) as to
whether I'm barking up the wrong tree or not. :-)

Thanks in advance to any advice anyone can give...

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




[PHP] Web site analysys

2002-09-22 Thread Rosen

Hi,
Can someone tell me where I can find a PHP script
for tracking visitors on WEB site ( IP, Refferer, e.t.c )
(Like http://extremetracking.com )

Thanks,
Rosen




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




Re: [PHP] Elliptic curve cryptology

2002-09-22 Thread EjdeR

thnx

Pan [EMAIL PROTECTED] wrote in message
004501c26249$89786a60$0901a8c0@plexus">news:004501c26249$89786a60$0901a8c0@plexus...



  i cant find any example about Elliptic curve cryptology.. do you
 have any
  example? i cant understand without an example :)
 

 Ten seconds of googling produced these URLs.

 http://www.certicom.com/resources/w_papers/w_papers.html

 http://www.certicom.com/resources/ecc_tutorial/ecc_tutorial.html




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




Re: [PHP] return the amount of records in a mysql databace

2002-09-22 Thread Jeff Bluemel

this is only going to return records in a table, and not in a database


 select count(*) as n from ... where ...

 -Original Message-
 From: Philip J. Newman [mailto:[EMAIL PROTECTED]]

 Can someone point me in the right direction to find out how i can return
the
 amount of records in a mysql databace ?




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




[PHP] Re: closing browser's window

2002-09-22 Thread EjdeR

with javascript. yes

?
echo input name=\Close\ onClick=\self.close();return false\
type=\button\ value=\Close\;
?

Murat Ö. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi,

 is it possible to close client's browser's window from php script?

 thanks...





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




[PHP] i got a method but how in php now?

2002-09-22 Thread :B nerdy

i can do what i need on a command line with curl. but how would i do it in
php  curl?

this is my curl commands
curl -D hc -d login=xxpassword=xxTYPE=login
http://someserver.com/script/
curl -b hc -d sendmsg=1min=message=test
http://someserver.com/msgscript/

so really want i need is how do i specify with curl in php HOW TO RECORD
cookies?
and then how to RELAY them back..

cheers.

:B Nerdy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i wish to POST submit to a login form on another server and then after
that
 POST some more information on the resulting page.

 the thing is, after the first login, the website sends me a cookie. it
 probably holds the session id and or authentication information. how will
 can i relay this back to the page so i can view the resulting page without
 being kicked out because of no cookie??

 ive already used curl and am able to post things to scripts. but this
cookie
 problem i dont know how to get around.

 any idea?
 cheers






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




Re: [PHP] closing browser's window

2002-09-22 Thread Chris Hewitt

Murat . wrote:

is it possible to close client's browser's window from php script?

 From a php script yes, but not by PHP, because PHP runs on the server, 
not the browser. If you use JavaScript you can close it with window.close()

HTH
Chris



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




Re: [PHP] algorythm question

2002-09-22 Thread Barýþ

oh my god. here is an example.

$userLevels = array(
1 = 'Member', 
2 = 'Admin', 
4 = 'Writer', 
8 = 'Expert');

$cat = 15;
for ($mask=1; $mask = 64; $mask *= 2) {
if ( $mask  $cat ) {
print Yes $mask is in $cat\nbr;
}
} 

here i didn't have to 'or' the IDs but it works fine
and i didn't really understand how it works?
what does it mean if 2  15, 2 can be found in
15???!!! is that a miracle;)
thank you bob...


--- bob parker [EMAIL PROTECTED] wrote:
 On Sun, 22 Sep 2002 01:10, you wrote:
 
 1. To do that you should 'or' the categories when
 the ID's are
 to be in more than one category, not add them
 eg $category = $cat1 | $cat2;
 
 2. To extract the categories within a compounded
 category
 use the 'and' operator ''
 
 eg
 
 for ($mask=1; $mask = 64; /*or whatever*/ $mask *=
 2; ) {
   if ( $mask  $category ) {
   print Yes $mask is in $category\n;
   }
 } 




original---
  consider there are categories and these have IDs
 like
  below:
  1, 2, 4, 8, 16, 32, 64...
 
  if some data belongs to more than 1 category for
  exemple 4 and 32, its category ID will be 36, the
 sum
  of cat. IDs.
  i guess this is used widely in programming. so,
 how
  can i resolve the original IDs. i mean what kind
 of
  script can tell me what+what1+what2...whatN = 79?


__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

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




[PHP] $_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var]; ???

2002-09-22 Thread Victor

$_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var] - I noticed that in
a mysql statement you can only use: $_GLOBAL[var].

I would like to get the advice of more experienced php programmers out
there about this. Which one of the above it the most best way to
write?
 
- Victor  www.argilent.com


__ 
Post your ad for free now! http://personals.yahoo.ca

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




Re: [PHP] return the amount of records in a mysql databace

2002-09-22 Thread Chris Shiflett

Look through the MySQL functions. I seem to recall that there is a 
function for just about anything, and all you really want to do is find 
how many rows are in all the tables in a particular database. Thus, a 
couple of loops is all you need, with the outer one looping through each 
table (obtained from a function) and the inner one doing a select 
count(*) or a mysql_num_rows().

Happy hacking.

Chris

Jeff Bluemel wrote:

this is only going to return records in a table, and not in a database

select count(*) as n from ... where ...

-Original Message-
From: Philip J. Newman [mailto:[EMAIL PROTECTED]]

Can someone point me in the right direction to find out how i can return

the
  

amount of records in a mysql databace ?



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




[PHP] RE: [PHP-DB] password function

2002-09-22 Thread Stephen Craton

Not sure if this has been answered yet but since the new version of PHP,
I found that it doesn't like you entering the SQL statements in the
query tag directly. Here's what you should do.

$sql = select password(.$_POST['password'].)
$conn = **YOUR DATABASE CONNECTION**
$result = mysql_query($sql, $conn);
while ($p = mysql_fetch_array($result, MYSQL_ASSOC)):
  $pswrd=$p['password('.$_POST['password'].')'];
  endwhile;

Remember to replace **YOUR DATABASE CONNECTION** with, evidently, your
database connection. What I usually do is assign a function
(db_connect()) to connect to the database and select the database then
just put $conn = db_connect().

Hope that helps!

Thanks,
Stephen Craton
http://www.melchior.us
http://php.melchior.us

:: -Original Message-
:: From: Murat Ö. [mailto:[EMAIL PROTECTED]] 
:: Sent: Sunday, September 22, 2002 7:23 AM
:: To: [EMAIL PROTECTED]
:: Subject: [PHP-DB] password function
:: 
:: 
:: hi,
:: i want to encode a string that users enter with mysql 
:: password function. but sometimes this code works sometimes 
:: don't. mysql warns me:
:: Warning: mysql_fetch_array(): supplied argument is not a 
:: valid MySQL result resource in 
:: 
:: the code is:
:: 
:: $result=mysql_query(select password(.$_POST['password'].));
::   while ($p = mysql_fetch_array($result, MYSQL_ASSOC)):
::   $pswrd=$p['password('.$_POST['password'].')'];
::   endwhile;
:: 
:: thanks...
:: 
:: 
:: 
:: -- 
:: PHP Database 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] counting guest users

2002-09-22 Thread Stephen Craton

I'm pretty sure they use cookies and see if the user is logged in or
not. I'm not sure how exactly to make the script though..

Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us

:: -Original Message-
:: From: Andy [mailto:[EMAIL PROTECTED]] 
:: Sent: Saturday, September 21, 2002 6:46 PM
:: To: [EMAIL PROTECTED]
:: Subject: [PHP] counting guest users
:: 
:: 
:: Hi there,
:: 
:: I am wondering how some pages count guest users. An example 
:: is phpbb. They always know how many guest users are browsing 
:: the site. Are they using cookies or db for this, or both? 
:: Maybe there is a code snipped out for this already?
:: 
:: Thank you for any hint on that.
:: 
:: Andy
:: 
:: 
:: 
:: -- 
:: 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] Designing N-tier applications in PHP (long)

2002-09-22 Thread Chris Shiflett

Michael Sims wrote:

Recently we added a new application to what we provide that allows
customers to sign up to receive new listing notifications based on a
certain set of search criteria.  I was charged with the responsibility
of creating this application.  I decided (for various reasons) to
implement this application in Perl.


I think this decision lies at the heart of your trouble.

As I was putting the Perl script together I realized that I was going
to have to duplicate all of the business logic that existed in my PHP
pages to build the SQL queries and display the results.


And this is why.

I realized at this point that I would be really nice if the business
logic that determines how to construct the queries and which bits of
data to display were completely seperated from the presentation logic
that existed in my PHP pages.


Yes, this is exactly what you should do. Design (redesign?) your Web 
application with a more modular approach. Make your business logic in 
separate modules. There is no need to use a different language for this, 
however, especially since your business logic is probably simple 
decision making based on information from a database.

I have considered setting up a PHP page that runs on a seperate port.


Don't forget that PHP has a CLI (command line interface). For example, 
create a script like this:

#! /usr/bin/php -q
?
echo PHP has a command line interface!;
?

Make it executable and execute it, just like a Perl script.

Basically, it's really easy to create multiple interfaces to the same 
business logic. Don't try to make things more complicated than 
necessary, and since there is no need to use multiple languages in your 
implementation, that is a complexity worth avoiding.

If your Web application utilizes a modular design, then all your PHP 
script has to do is include the appropriate business logic from your Web 
application. Then, you can set it up with cron or whatever to decide who 
needs to be emailed what.

Happy hacking.

Chris


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




[PHP] Re: [PHP-WIN] Create Thumbnails from image

2002-09-22 Thread Olivier Hubert

Hi,

Read up on the image manipulation functions of PHP at 
http://www.php.net/manual/en/ref.image.php

You will need to install the GD library if it's not already installed and 
once you do you will have access to all the functions described, including 
the ImageCopyResized function. To read the image from disk, you will 
probably have to use ImageCreateFromGif or ImageCreateFromJpeg and to 
create the destination image you will need to use CreateImage. You can then 
save the resulting thumbnail using ImageGif, ImageJpeg or anything you like.

Just as a side note, you should probably use ImageCopyResampled which uses 
interpolation to resize the image, thus creating a thumbnail of much better 
quality.

HTH

Olivier

PS: to get the image's height and width, use ImagesY and ImagesX 
respectively, once you have opened/created the image.

At 18:09 2002-09-22 +0300, Kjell Hansen wrote:
Hi,
I'm using a Win2k with php4.1 and I'd like to make some thumbnails from
pictures on my disk.
I've gotten the impression that it's possible, but I havent' found out
just how.

I've stumbled across the ImageCopyResized function but it requires a
imagehandle(?) to the file copied from. How do I get that? Is it the
right way to do this?
I guess I could use some picture manipulating program to do this, but
doing it the PHP way is nicer :)

TIA
Kjell


--
PHP Windows 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] unlink() and IIS

2002-09-22 Thread Gerard Samuel

Im running a dev box with IIS 5/Apache/php 4.1.2
I just noticed that part of a script that is supposed to delete a file 
isn't working under IIS but is under Apache.
Under IIS, php is installed as isapi.
Paths are correct, and the file in question is created by the script and 
according to the permissions, SYSTEM has full access to the file.
MARC and user notes under unlink() didn't reveal anything about why 
unlink() works for some and not for others.

Code snippet in question -
--
$log = '../../includes/error/error.log';

if (isset( $_POST['Reset'] ))
{
if (!unlink($log))
{
trigger_error('UNABLETORESETLOGFILE' , E_USER_WARNING );
}
}


Can anyone shed any light for me.
Thanks for any insight you may provide.

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




Re: [PHP] $_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var]; ???

2002-09-22 Thread Peter J. Schoenster



On 22 Sep 2002 at 12:10, Victor wrote:

 $_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var] - I noticed that in
 a mysql statement you can only use: $_GLOBAL[var].
 
 I would like to get the advice of more experienced php programmers out
 there about this. Which one of the above it the most best way to
 write?

Yeah, this through me as well. Using Perl I got completely out of using 
quotes when not essential, still don't like em.  But the php.net site's 
got the answer:

http://www.php.net/manual/en/language.types.string.php

someone put a link to another good explanation:

http://www.zend.com/zend/tut/using-strings.php

And of course take care of the magic (imho, black magic) that can go on 
with auto escaping, quoting etc. that I should fathom but haven't. 

the php.net site is wealth of info, good search, I find 98% of my 
answers there.

Peter

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




Re: [PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Peter J. Schoenster

On 22 Sep 2002 at 10:23, Michael Sims wrote:

 of creating this application.  I decided (for various reasons) to
 implement this application in Perl.

I began programming in Perl back in 1995. Took up mod_perl (the only 
way to seriously use Perl btw on web apps) but as I work primarily on 
virtual servers mod_perl was just too sophisticated for most 
environments, so I settled for just Apache::Registry which would also 
run as plain cgi. Well  ... I've finally found a nice framework using 
PHP (using smarty.php.net) with Pear and then private classes for the 
App at hand. Works like a charm. I'm a fan of Perl but you can't beat 
PHP for ease of deployment and PHP does everying Perl does (all that I 
need) (although not all that mod_perl allows but then those conditions 
are pretty rare, for instance, like taking command at any of the apache 
request phases, especially good for custom auth stuff).

 in my Perl script.  Worse yet, I realized that if any of this business
 logic changes (which it often does), I was going to have to remember to
 change it in TWO places.  Up until this point there was only the
 website, but now that I had two completely seperate applications that I
 have to maintain whenever anything changes.

Oh yeah, avoid that at all costs. Sounds like something like SOAP etc. 
could have been an answer, but then it depends on how you write your 
apps. 

I write both Perl and PHP to manipulate data. Every function has input 
and output and those are just arrays. I ran into a similar problem with 
NUKE. My customer wanted me to allow a user to join via a multi-
newsletter module I was writing. Well I got it to work but it was not 
as easy as it should have been imho. I should have been able to call 
CreateNewUser and pass it the require input and gotten back a user id 
and then I could have called soemthing like GetUser and pass it a user 
id and get back an associative array (my pref) of that user. It was not 
like that, not at all, or I missed it. It seemed that the creation of a 
new user was tightly *coupled* with an html signup process. 


 I realized at this point that I would be really nice if the business
 logic that determines how to construct the queries and which bits of
 data to display were completely seperated from the presentation logic
 that existed in my PHP pages.  If I had some sort of component that
 merely accepted search parameters and returned data then I could access
 this component from both the PHP page and the Perl script.  If the
 business logic changed later I could simply update the component and I
 (theoretically speaking) wouldn't have to touch the PHP page or the Perl
 script.

Ummm  like the other guy said, why bother? You can do that. Of 
course. But what are you doing in Perl that you cannot do in PHP? Maybe 
a cron script? I've not written any cron stuff in PHP and I'm not 
calling lynx to do it as I've seen advertised :( ... 


 I've been doing research into this kind of application design.  From my
 limited and inexperienced perspective, it does appear that Microsoft
 does offer some advantages in this area.  But COM is not an option for
 me, for several reasons, not the least of which is the fact that our
 servers run Linux and I cannot access PHP's COM functions.

SOAP, XML-RPC 

http://php.weblogs.com/xml-rpc

I just did a search on Google. I have not written anything along these 
lines but given XML you could write your own but I'd always go the 
public route if I were to do this. 

I'm reading an interesting book called Software Architect Bootcamp 
where components is the big word. It's interesting. I'm not sure if 
I've got a full grasp but it defintiely seems to have an emphasis on 
decoupling (something going back to I read about in McConnell who is 
very good).  But how to implement?  In the book I'm guilty of what he 
calls the Stovepipe System :( but I'm working on it.

 I have considered setting up a PHP page that runs on a seperate port.
 This page would accept search criteria via a query string, and then
 return listing data in XML format.  Then on the PHP presentation side
 (or my Perl script), I would parse the XML and either display it
 manually, or use XSLT.

 I don't have a lot of experience with this, however.  It seems that XML
 support in PHP is still in a state of infancy.  

I don't know about that. Works well for me. I take an Amazaon XML feed 
and run it through my smarty templates with no problem here:

http://www.readbrazil.com/books/amazon.php?mode=books

please note that above site has been more of a php playground than 
anything else.

No need to go the XSLT route although that is interesting. I use 
Template::Toolkit in Perl and have templates in html, xml, or plain 
text.

 the best thing to do is to wait a bit until XML support in PHP
 solidifies a little more.

I really don't now enough about this. Seem strong to me but I have'nt 
done much.

 Another technology I was toying around with is Java servlets and Java
 

[PHP] Update undefined List Values in DB

2002-09-22 Thread Sascha Braun

Hi,

I am creating a kind of Shopsystem right now.

One of the Funktions is going to be the possibiliy that the page admin can set an 
customer status to 1 or 0
via an listing of all customers.

My Problem is, that I have to change more than one value at a time due to the Listing, 
where all
customers are listed in one big list.

So I have to write multiple values in to the database as Update.

I don't have a clue how to do this, the only thing i could do is
to make the change possible via an extrapage per customer,
but I'm not able to change all values at a time.

Would be nice if somebody would give me a hint.

Please excuse my english

Sascha Braun



[PHP] Cannot Redeclare?

2002-09-22 Thread Stephen Craton

Hello,

I was just wondering...again...why the heck I keep getting this error.
I'm trying to make a function called login() and sometimes it works,
other times it hates me and gives me this error:

Fatal error: Cannot redeclare login() in
c:\apache\htdocs\wiredphp\member\funcs.php on line 5

Here's the contents of the function login():

function login($username, $password)
{
  $sql = select * from members where username='$username' and passwd =
password('$password');
  $result = mysql_query($sql, $wired);
  if (!$result)
 return 0;
  
  if (mysql_num_rows($result)0)
 return 1;
  else 
 return 0;
}

Please help. I don't see why this keeps happening...

Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us



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




Re: [PHP] return the amount of records in a mysql databace

2002-09-22 Thread Philip J. Newman

?php

$sql = SELECT count(*) FROM stompers  WHERE 1;
$sql_result = mysql_query($sql, $connection) or die (Could not get Query);

$row = mysql_fetch_array($sql_result);
$sUsers=$row[count(*)];

echo brWe have b$sUsers/b registered users.;

?

This would be the best way (suggestions would be cool);



- Original Message -
From: Mark Charette [EMAIL PROTECTED]
To: Philip J. Newman [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 1:28 AM
Subject: RE: [PHP] return the amount of records in a mysql databace


 select count(*) as n from ... where ...

 -Original Message-
 From: Philip J. Newman [mailto:[EMAIL PROTECTED]]

 Can someone point me in the right direction to find out how i can return
the
 amount of records in a mysql databace ?



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




[PHP] What does this error mean

2002-09-22 Thread Randy Johnson

What does this error mean?

Warning: Wrong parameter count for mysql_query() 


Thanks

Randy



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




RE: [PHP] What does this error mean

2002-09-22 Thread Daniel Kushner

Hi Randy,

It means that you are calling the function without the right amount of
parameters. The function mysql_query expects at least 1 (one) paramter:
the query String.
http://www.php.net/manual/en/function.mysql-query.php

Regards,
Daniel Kushner

Need hosting? http://thehostingcompany.us




-Original Message-
From: Randy Johnson [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 22, 2002 2:26 PM
To: Paul Nicholson; Bryan McLemore; PHP GEN LIST
Subject: [PHP] What does this error mean


What does this error mean?

Warning: Wrong parameter count for mysql_query() 


Thanks

Randy



-- 
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] Designing N-tier applications in PHP (long)

2002-09-22 Thread Michael Sims

On Sun, 22 Sep 2002 11:31:17 -0500, you wrote:

Basically, it's really easy to create multiple interfaces to the same 
business logic. Don't try to make things more complicated than 
necessary, and since there is no need to use multiple languages in your 
implementation, that is a complexity worth avoiding.

Point well taken.  However, allow me to explain some things that I
left out of my original post:

I decided to go with Perl for a few different reasons.  First of all,
I wanted to get more comfortable working with Perl, mainly so I could
get exposed to languages other than PHP.  I had used Perl in the past,
but only for small tasks.  I saw this project as an opportunity to
pick up some useful Perl experience.

Another reason I went with Perl is because IMHO some of the tasks I
needed to accomplish are just easier done in Perl.  Part of the
functionality of my script is to parse incoming email and take
different actions based on it's content.  My script responds to
certain embedded commands (subscription confirmations, unsubscribe
requests, requests for automated help, etc.).  It also forwards
unknown commands to one set of addresses, while forwarding DSN's to
another set.  This means accepting the mail on STDIN and doing a lot
of regex parsing.  I know that this is more than possible in PHP, but
Perl just seems better suited to this type of task IMHO.

In retrospect it probably would have been better for me to implement
everything in PHP, from a modularization point of view.  I could have,
like you suggested, put all of my business logic in say a class, and
included that class from both my webpage and my mail script.  But that
would lock me in to using PHP for everything that needed access to
that business logic, so I'm still not sure that is the best
solution...

Thanks for the response...

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




Re: [PHP] What does this error mean

2002-09-22 Thread Randy Johnson

I found out what it was:

I mispelled a column in the insert statement.  it actually had nothing to do
with the parameters passed to the function  i passed $query and $link and
once i spelled the column right it went through just fine.   why would it
not just tell me that the column did not exist?

Randy
- Original Message -
From: Daniel Kushner [EMAIL PROTECTED]
To: 'Randy Johnson' [EMAIL PROTECTED]; 'Paul Nicholson'
[EMAIL PROTECTED]; 'Bryan McLemore' [EMAIL PROTECTED]; 'PHP
GEN LIST' [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 2:34 PM
Subject: RE: [PHP] What does this error mean


 Hi Randy,

 It means that you are calling the function without the right amount of
 parameters. The function mysql_query expects at least 1 (one) paramter:
 the query String.
 http://www.php.net/manual/en/function.mysql-query.php

 Regards,
 Daniel Kushner
 
 Need hosting? http://thehostingcompany.us




 -Original Message-
 From: Randy Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 22, 2002 2:26 PM
 To: Paul Nicholson; Bryan McLemore; PHP GEN LIST
 Subject: [PHP] What does this error mean


 What does this error mean?

 Warning: Wrong parameter count for mysql_query()


 Thanks

 Randy



 --
 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] Designing N-tier applications in PHP (long)

2002-09-22 Thread Michael Sims

On Sun, 22 Sep 2002 13:07:05 -0500, you wrote:

Oh yeah, avoid that at all costs. Sounds like something like SOAP etc. 
could have been an answer, but then it depends on how you write your 
apps. 

Well, that is basically my question.  I considered both SOAP and
XML-RPC (which you mention later) but I wasn't sure what the impact on
performance would be.  I am basically looking for anecdotal evidence
from people who have implemented this sort of thing before...

Ummm  like the other guy said, why bother? You can do that. Of 
course. But what are you doing in Perl that you cannot do in PHP? Maybe 
a cron script? I've not written any cron stuff in PHP and I'm not 
calling lynx to do it as I've seen advertised :( ... 

I answered him in a seperate post, but I'll repeat here:  I'm familiar
with writing standalone scripts in PHP.  I used Perl because for this
particular task it seemed better suited, and I wanted to get some more
Perl experience.  In retrospect it was probably not the wisest
decision, and I probably have made things more complicated than
necessary...

 I don't have a lot of experience with this, however.  It seems that XML
 support in PHP is still in a state of infancy.  

I don't know about that. Works well for me. I take an Amazaon XML feed 
and run it through my smarty templates with no problem here:

http://www.readbrazil.com/books/amazon.php?mode=books

please note that above site has been more of a php playground than 
anything else.

That was just the impression that I picked up from my admittedly
limited research I did on XML support in PHP.  I was focusing mainly
on XSL transformations though.

Do you mind if I ask how exactly you are parsing the XML in your PHP
pages?  It seems to me that there are a few different options
available on www.php.net.  There is the --with-xml option that uses
expat, and then the DOM XML extension that is marked experimental.
I'm a real newbie when it comes to XML, but the DOM functions look a
little more attractive to me...

It sounds like to me you are looking for a framework. This what I 
looked for in PHP and I've got one now that is equal or better to my 
Perl framework. 

Thanks for your response, you've given me some nice food for thought.
I've heard of Smarty several times before but never looked into it.  I
definitely will take a look at it now...

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




[PHP] Calling class functions using string variables?

2002-09-22 Thread Nick Richardson

Hi,

Anyone know if it's possible to call a class function using 2 string
variables WITHOUT instantiating the class?

i.e.:

$clName = myClass;
$fuName = myFunc;

$clName::$fuName();

I have tried several different combinations of eval and {} and just
about everything else I can think of… and they all give parse errors
when the class name is a string var. (i.e. myClass::$fuName() works fine
(as expected) but $clName::myFunc() does not).  Everytime it doesn't
work, it just gives a simple parse error.

Any suggested are much appreciated!

Thanks in advance!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
 



RE: [PHP] Calling class functions using string variables?

2002-09-22 Thread Nick Richardson

Nevermind, I have finally figured it out... I was missing a ; in the
eval statement.

For anyone who wanted to know, there's 2 ways...
1) the long way
$clName = myClass;
$fuName = myFunc;

$t = new $clName;
$t-$fuName();
unset($t);

2) the short way
$cl = myClass;
$fu = myFunc;

eval($cl::$fu(););

-Original Message-
From: Nick Richardson [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 22, 2002 12:50 PM
To: 'PHP General'
Subject: [PHP] Calling class functions using string variables?


Hi,

Anyone know if it's possible to call a class function using 2 string
variables WITHOUT instantiating the class?

i.e.:

$clName = myClass;
$fuName = myFunc;

$clName::$fuName();

I have tried several different combinations of eval and {} and just
about everything else I can think of… and they all give parse errors
when the class name is a string var. (i.e. myClass::$fuName() works fine
(as expected) but $clName::myFunc() does not).  Everytime it doesn't
work, it just gives a simple parse error.

Any suggested are much appreciated!

Thanks in advance!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
 

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002
 


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




Re: [PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Peter J. Schoenster

On 22 Sep 2002 at 13:52, Michael Sims wrote:

 Well, that is basically my question.  I considered both SOAP and
 XML-RPC (which you mention later) but I wasn't sure what the impact on
 performance would be.  I am basically looking for anecdotal evidence
 from people who have implemented this sort of thing before...

I was just looking at my software architect book ... not half-way 
through yet. Good book. CORBA is what is mentioned know, a bit 
different than SOAP but I don't know enough of either yet to say for 
sure.

 with writing standalone scripts in PHP.  I used Perl because for this
 particular task it seemed better suited, and I wanted to get some more
 Perl experience.  In retrospect it was probably not the wisest decision,
 and I probably have made things more complicated than necessary...

Personally, I think you were correct. I cannt imagine just doing 
everything with one tool. But how to write PHP and your Perl so they 
can talk to each other. Dunno. IDL, CORBA  but as you say, it sure 
would be good to hear from someone who's been here already.


 I don't know about that. Works well for me. I take an Amazaon XML feed
 and run it through my smarty templates with no problem here:
 
 http://www.readbrazil.com/books/amazon.php?mode=books
 
 please note that above site has been more of a php playground than
 anything else.
 
 That was just the impression that I picked up from my admittedly
 limited research I did on XML support in PHP.  I was focusing mainly on
 XSL transformations though.

 Do you mind if I ask how exactly you are parsing the XML in your PHP
 pages?  It seems to me that there are a few different options available
 on www.php.net.  There is the --with-xml option that uses expat, and

Yes, I avoid XSL with the SABOLOTRON (or whatever it is) cus it's not 
in most virtual environments and that's a reason to use PHP over Perl, 
the ease of deployment. If I have my own box, heck, mod_perl is strong. 

Anyhow, I'm a lazy guy, avoid writing code at all costs :)

include_once ( 'AmazonLiteXMLParser.inc'); // 
include_once ( 'AmazonAPI.inc'); // 

written by Daniel Kushner

http://www.amazonlite.com/

And so my script is essentially this:

$xml  = new AmazonAPI();
$rxml = $xml-
keywordSearch($input['keyword'],$input['mode'],$input['page']);

$parse  = new AmazonLiteXMLParser($rxml);
$records = $parse-getRecords();

for($i = 0; $i  sizeof($records); $i++) {
for($inner = 0; $inner  sizeof($records[$i]['rating']); $inner++) 
{
$records[$i]['reviews'][$inner]['summary'] = 
$records[$i]['summary'][$inner];
$records[$i]['reviews'][$inner]['rating'] = 
$records[$i]['rating'][$inner];
$records[$i]['reviews'][$inner]['comment'] = 
$records[$i]['comment'][$inner];
}
unset($records[$i]['summary']);
unset($records[$i]['rating']);
unset($records[$i]['comment']);
}

$smarty-assign(BookLoop,$records);
$smarty-assign($input);
$smarty-display('book_index.tpl');

And that's it.

 Thanks for your response, you've given me some nice food for thought.
 I've heard of Smarty several times before but never looked into it.  I
 definitely will take a look at it now...

If you continue to use Perl, look at Template::Toolkit. I use it for 
all sorts of things, everything, really nice. 



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




Re: [PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Manuel Lemos

Hello,

On 09/22/2002 03:38 PM, Michael Sims wrote:
Basically, it's really easy to create multiple interfaces to the same 
business logic. Don't try to make things more complicated than 
necessary, and since there is no need to use multiple languages in your 
implementation, that is a complexity worth avoiding.
 
 Point well taken.  However, allow me to explain some things that I
 left out of my original post:
 
 I decided to go with Perl for a few different reasons.  First of all,
 I wanted to get more comfortable working with Perl, mainly so I could
 get exposed to languages other than PHP.  I had used Perl in the past,
 but only for small tasks.  I saw this project as an opportunity to
 pick up some useful Perl experience.

Good idea, bad project. It is good that you diversify your knowlegde if 
that helps your career but I think it is not a good idea to make 
technology shift in a project that is already written and working well 
in a certain language. I would say the same if the project was written 
in Perl and you wanted to change to PHP to diversify your knowledge.

I recommend that you do that in a low risk project that you can start 
from scratch. If you do the change now, chances are that you will face 
many difficulties and a lot more work than you could antecipate.


 Another reason I went with Perl is because IMHO some of the tasks I
 needed to accomplish are just easier done in Perl.  Part of the
 functionality of my script is to parse incoming email and take
 different actions based on it's content.  My script responds to
 certain embedded commands (subscription confirmations, unsubscribe
 requests, requests for automated help, etc.).  It also forwards
 unknown commands to one set of addresses, while forwarding DSN's to
 another set.  This means accepting the mail on STDIN and doing a lot
 of regex parsing.  I know that this is more than possible in PHP, but
 Perl just seems better suited to this type of task IMHO.

There is no evidence that is true. Maybe that is just your experience 
but doing what you mentioned in PHP is a day at the beach.

Reading from stdin is the same as reading from any file. Just use 
fopen(php://stdin,r) to get the file handle.

There are many ready to use components to parse complex e-mail if that 
is what you want. If you just need to use regular expressions, you can 
do that easily in PHP.

I can tell you that I do that myself in a site of mine and probably 
handling more complex situations like handling bounced newsletter 
messages. I do it all with PHP hands down. I do not see where Perl would 
be better.

Maybe that is my lack of Perl of experience compared to PHP experience, 
or your lack of PHP experience compared to your Perl experience.



 In retrospect it probably would have been better for me to implement
 everything in PHP, from a modularization point of view.  I could have,
 like you suggested, put all of my business logic in say a class, and
 included that class from both my webpage and my mail script.  But that
 would lock me in to using PHP for everything that needed access to
 that business logic, so I'm still not sure that is the best
 solution...

My opinion is that switching to Perl in the middle of a project that 
already works well in PHP would be a major mistake. You may want to try 
it and realize that yourself at the expense of loosing a lot of time and 
probably make your employer very nervous.

Regardless if you switch the language, you will always have trouble to 
split the business from the presentation logic from your PHP scripts. My 
advice is that you do that just splitting the logic in scripts that you 
really need to do that. Resist the temptation of doing that in all scripts.

Also, doing that and switching to a new language at the same time would 
make it worse. A sure recipe for disaster. Better safe than sorry.


-- 

Regards,
Manuel Lemos


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




[PHP] session_start() -- no more output

2002-09-22 Thread Hans Wilmer

Hi,

the following PHP script causes me trouble:


?php
session_register(bunt);
phpinfo();
?


This is just a simple example. The problem is that the script produces
no output at all when called with the browser. I could use


?php
session_start();
echo test;
?


instead, but I won't get any output either.

Everything works as expected when session_start() or
session_register() are not used --- phpinfo() then says: Apache/1.3.22
(Unix) Debian/GNU PHP/4.1.0RC2.

Any help would be appreciated; thanks in advance!


GH
-- 
This mail is copyrighted material and must not be processed by
closed-source software.

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




[PHP] JAVASCRIPT INCLUDES

2002-09-22 Thread Georgie Casey

In HTML, you can do this:
script language=JavaScript
src=http://localhost/top_stuff.php?affiliate=1;/script

But the script isn't executed before being used by the browser, it's
returned with PHP tags and all, which obviously gives JS errors. Is there
any setting you can change in Apache that let's you do this.



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




Re: [PHP] session_start() -- no more output

2002-09-22 Thread Michael Sims

On Mon, 23 Sep 2002 00:54:07 +0200, you wrote:

?php
session_register(bunt);
phpinfo();
?

This is just a simple example. The problem is that the script produces
no output at all when called with the browser.

Is it possible that display_errors is set to Off in your php.ini?
If this were the case, perhaps a fatal error is occuring when you call
the session functions but you aren't seeing it because of the
display_errors setting...?

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




Re: [PHP] JAVASCRIPT INCLUDES

2002-09-22 Thread Chris Shiflett

Georgie,

I'm not sure what you're wanting to do here, but it looks like you just 
want to use PHP to write some javascript. There's no need to make the 
browser request an additional page for this. Just do something like this 
in your PHP script:

script language=javascript
?
PHP stuff here - output is valid javascript
?
/script

or even:

script language=javascript
?
include(/home/georgie/top_stuff.php);
?
/script

However, speaking directly to your problem, see what you see when you 
access that URL (http://localhost/top_stuff.php?affiliate=1) yourself. 
If your PHP scripts are not being processed and instead are just 
displayed in the browser, then your Web server is not configured to 
process PHP.

Happy hacking.

Chris

Georgie Casey wrote:

In HTML, you can do this:
script language=JavaScript
src=http://localhost/top_stuff.php?affiliate=1;/script

But the script isn't executed before being used by the browser, it's
returned with PHP tags and all, which obviously gives JS errors. Is there
any setting you can change in Apache that let's you do this.



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




[PHP] solved

2002-09-22 Thread :B nerdy

its cool. ive solved it..

there is an option in php curl to save the headers. i just feed that back
out. and it implements the cookies

cheers

:B Nerdy [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i can do what i need on a command line with curl. but how would i do it in
 php  curl?

 this is my curl commands
 curl -D hc -d login=xxpassword=xxTYPE=login
 http://someserver.com/script/
 curl -b hc -d sendmsg=1min=message=test
 http://someserver.com/msgscript/

 so really want i need is how do i specify with curl in php HOW TO RECORD
 cookies?
 and then how to RELAY them back..

 cheers.

 :B Nerdy [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  i wish to POST submit to a login form on another server and then after
 that
  POST some more information on the resulting page.
 
  the thing is, after the first login, the website sends me a cookie. it
  probably holds the session id and or authentication information. how
will
  can i relay this back to the page so i can view the resulting page
without
  being kicked out because of no cookie??
 
  ive already used curl and am able to post things to scripts. but this
 cookie
  problem i dont know how to get around.
 
  any idea?
  cheers
 
 
 





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




Re: [PHP] JAVASCRIPT INCLUDES

2002-09-22 Thread Georgie Casey

The Javascript has to be called from other servers, some who might not even
support PHP. And yeah, when you actually visit the URL, it displays perfect
JavaScript

Thanks anyway
Chris Shiflett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Georgie,

 I'm not sure what you're wanting to do here, but it looks like you just
 want to use PHP to write some javascript. There's no need to make the
 browser request an additional page for this. Just do something like this
 in your PHP script:

 script language=javascript
 ?
 PHP stuff here - output is valid javascript
 ?
 /script

 or even:

 script language=javascript
 ?
 include(/home/georgie/top_stuff.php);
 ?
 /script

 However, speaking directly to your problem, see what you see when you
 access that URL (http://localhost/top_stuff.php?affiliate=1) yourself.
 If your PHP scripts are not being processed and instead are just
 displayed in the browser, then your Web server is not configured to
 process PHP.

 Happy hacking.

 Chris

 Georgie Casey wrote:

 In HTML, you can do this:
 script language=JavaScript
 src=http://localhost/top_stuff.php?affiliate=1;/script
 
 But the script isn't executed before being used by the browser, it's
 returned with PHP tags and all, which obviously gives JS errors. Is there
 any setting you can change in Apache that let's you do this.
 




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




[PHP] error with php and pdflib

2002-09-22 Thread Thoenen, Peter Mr. EPS

Hello everybody,

Getting the following error when trying to generate a pdf file.

Fatal error: PDFlib error: function 'PDF_set_info' must not be called in
'object' scope in E:\php\pdf.php on line 6

From what I can tell (google and php manual online) this error is caused
when your webserver (IIS 5 in this case) doesn't have write permissions to
the directory.

This is NOT the case here as far as I can tell.  Other scripts I run write
just fine and as seen in the below code, 'abc.txt' is written with no
problems before the script dies with the above error.

Any ideas?

-Peter

?php
  $fp=fopen(abc.txt, w);
  fwrite($fp, 'test');
  $pdf = pdf_new();
  pdf_open_file($pdf, e:\php\test.pdf);
  pdf_set_info($pdf, Author, Uwe Steinmann);
  pdf_close($pdf);
  pdf_delete($pdf);
  echo A HREF=getpdf.phpfinished/A;
?

##
Peter Thoenen - Systems Programmer
Commercial Communications
Camp Bondsteel, Kosovo
##

Stumbled Upon...heh (Score:5, Funny) /.
by $carab on 23:00 23 August 2002 (#4131637)

ForensicTec officials said they stumbled upon the military networks about
two months ago, while checking on network security for a private-sector
client.

Someone new to a Dvorak probably tried to type in lynx
http://www.google.com; but instead got nmap -v -p 1-1024 -sS -P0 army.mil
-T paranoid.

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




Re: [PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Michael Sims

On Sun, 22 Sep 2002 18:45:37 -0300, you wrote:

Hello,

Hi Manuel...

Good idea, bad project. It is good that you diversify your knowlegde if 
that helps your career but I think it is not a good idea to make 
technology shift in a project that is already written and working well 
in a certain language.

True, I see that now.  I guess I should have sent my email to the
group BEFORE I started working on the project and not after. :-)

 of regex parsing.  I know that this is more than possible in PHP, but
 Perl just seems better suited to this type of task IMHO.

There is no evidence that is true. 
[...]
I can tell you that I do that myself in a site of mine and probably 
handling more complex situations like handling bounced newsletter 
messages.

Yeah, I'm actually on the phpclasses mailing list, so I think I know
what you are talking about. :-)

Maybe that is my lack of Perl of experience compared to PHP experience, 
or your lack of PHP experience compared to your Perl experience.

That is a factor, although I'm no Perl expert either...  Sometimes I
fall in a trap when it comes to projects...I start focusing on what
would be cool and fun to implement and sometimes I lose sight of
what's best for the project...

My opinion is that switching to Perl in the middle of a project that 
already works well in PHP would be a major mistake. You may want to try 
it and realize that yourself at the expense of loosing a lot of time and 
probably make your employer very nervous.

I'll be honest, I didn't forsee the duplicated business logic problem
(although I should have) until I was too far along with Perl to change
my mind.  I didn't lose any time, though.  It would have taken me
about the same amount of time to implement it in PHP, simply because I
had to learn a lot about email handling and MIME messages, etc.  These
were training issues that I had to get past that were not
language-specific.

I also have the advantage of having an employer who isn't a programmer
so is fairly oblivous to the details of implementation.  He's
basically an end user who tells me how he wants the program to
function and leaves it up to me to make it work.  This can be a big
advantage because I have almost absolute freedom to do what I want,
but it can also be a disadvantage because I sometimes get carried away
with all that freedom. :-)

Regardless if you switch the language, you will always have trouble to 
split the business from the presentation logic from your PHP scripts. My 
advice is that you do that just splitting the logic in scripts that you 
really need to do that. Resist the temptation of doing that in all scripts.

Ok.  It is hard to know when you are not abstracting and modularizing
things enough, and then when you are doing it too much.  Often I'll go
to extra work to make something scalable, and then we end up never
touching it again.  At other times I will bang something out quickly
thinking it's a one shot thing and then I find out it needs to be
expanded.  Ah well, I guess I shouldn't complain, it pays the bills...
:-)

Thanks for the response...

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




Re: [PHP] JAVASCRIPT INCLUDES

2002-09-22 Thread Chris Shiflett

Georgie,

Then what you're doing should work perfectly fine. Can you give more 
details about the error received?

The reason I ask is because a Web browser will submit the exact same 
request for that URL that you do when you type it in yourself. Thus, if 
you don't see any PHP code, neither should the browser when it tries to 
execute that as javascript.

Chris

Georgie Casey wrote:

The Javascript has to be called from other servers, some who might not even
support PHP. And yeah, when you actually visit the URL, it displays perfect
JavaScript



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




[PHP] Re: JAVASCRIPT INCLUDES

2002-09-22 Thread Georgie Casey

Solved the problem.
In case anyones wondering,
I had the PHP script starting with a script and ending with /script when
I already had that done in the HTML page.

Simple
Georgie Casey [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In HTML, you can do this:
 script language=JavaScript
 src=http://localhost/top_stuff.php?affiliate=1;/script

 But the script isn't executed before being used by the browser, it's
 returned with PHP tags and all, which obviously gives JS errors. Is there
 any setting you can change in Apache that let's you do this.





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




Re: [PHP] closing browser's window

2002-09-22 Thread Justin French

I can't imagine how anyone could thing this is a good idea!

What's next?  Change my browser preferences without asking me?  Move some
files around on my hard drive?

FWIW, PHP is a SERVER SIDE language.  It doesn't interact with the
browser... by the time your browser recieves a page, it's just plain HTML,
which can be seen with view  source.

To do something as horrid as closing a browser, it would have to be done
with something like JavaScript on the browser (client-side).  For example,
self.close() (forget exact syntax) in JavaScript may do what you want.


I still can't see an occasion where you'd want this... at least not on a
consumer site.


Justin


on 23/09/02 1:03 AM, Murat Ö. ([EMAIL PROTECTED]) wrote:

 hi,
 
 is it possible to close client's browser's window from php script?
 
 thanks...
 
 


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




Re: [PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Michael Sims

On Sun, 22 Sep 2002 16:40:06 -0500, you wrote:

I was just looking at my software architect book ... not half-way 
through yet. Good book. CORBA is what is mentioned know, a bit 
different than SOAP but I don't know enough of either yet to say for 
sure.

Something like CORBA looks good to me, although it's most likely over
my head at the moment.  It would probably offer the advantages of
SOAP/XML-RPC and do it without all of the overhead.  But PHP support
for CORBA looks to be pretty shaky.  The only reference I could find
was to Universe, but the website appears to be down:

http://universe.2good.nu/

http://www.amazonlite.com/

Thanks for the pointer, I will check it out...

If you continue to use Perl, look at Template::Toolkit. I use it for 
all sorts of things, everything, really nice. 

I personally used HTML::Template, but I will take a look at that
module too...

Thanks again...

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




Re: [PHP] Re: JAVASCRIPT INCLUDES

2002-09-22 Thread David Rice

Georgie:

So just for clarity, this PHP script 
(http://localhost/top_stuff.php?affiliate=1;) was actually a file 
containing javascript? and no PHP?

And out of curiosity, if that is so, why append the file name with 
.php

-David

On Sunday, September 22, 2002, at 07:20 PM, Georgie Casey wrote:

 Solved the problem.
 In case anyones wondering,
 I had the PHP script starting with a script and ending with 
 /script when
 I already had that done in the HTML page.

 Simple
 Georgie Casey [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In HTML, you can do this:
 script language=JavaScript
 src=http://localhost/top_stuff.php?affiliate=1;/script

 But the script isn't executed before being used by the browser, it's
 returned with PHP tags and all, which obviously gives JS errors. Is 
 there
 any setting you can change in Apache that let's you do this.





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

2002-09-22 Thread Sascha Braun

Hi,

I want to post a form and after parsing i want to redirect the user to the home page.

header() doesn't work in this circumstance, what can I do else?

Greetings

Sascha



Re: [PHP] Redirection

2002-09-22 Thread Todd Pasley

I use

meta http-equiv=refresh content=DELAY;url=http://place.to.redirect.to

Todd.

- Original Message -
From: Sascha Braun [EMAIL PROTECTED]
To: PHP Mailingliste [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 9:42 AM
Subject: [PHP] Redirection


Hi,

I want to post a form and after parsing i want to redirect the user to the
home page.

header() doesn't work in this circumstance, what can I do else?

Greetings

Sascha



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




Re: [PHP] Redirection

2002-09-22 Thread Justin French

Validate the input BEFORE outputting anything to the browser... this way you
have control over such problems.

?
// validate
// code
// here


if($valid)
{
header(...);
exit;
}
?
HTML
?
if(!$valid)
{
echo error on form;
}
?
/HTML

The code below exit; will only be executed if the input was NOT valid


Regards,

Justin




on 23/09/02 9:42 AM, Sascha Braun ([EMAIL PROTECTED]) wrote:

 Hi,
 
 I want to post a form and after parsing i want to redirect the user to the
 home page.
 
 header() doesn't work in this circumstance, what can I do else?
 
 Greetings
 
 Sascha
 


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




Re: [PHP] Redirection

2002-09-22 Thread Chris Shiflett

Sascha Braun wrote:

I want to post a form and after parsing i want to redirect the user to the home page.

header() doesn't work in this circumstance, what can I do else?


header() does work in this circumstance. In what way do you think it 
doesn't?

header(Location: http://www.google.com/;);
exit;

Include that code after parsing, and your users will be redirected to 
Google's Web site. I'm not aware of any Web client that does not support 
this, regardless of how old or uncommon.

Chris


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




[PHP] Re: more stress on server...

2002-09-22 Thread Jason Morehouse

You'd be hard pressed to find any difference in how the server reacts to
either.  You'll generally have better luck in some search engines if you
use example 2.  But onless you've got some strange reason hording
all of your code in one file, I can't imagine any reason why example
1 would be of any use / advantage.

On Sat, 21 Sep 2002 22:08:42 +, Matt Zur wrote:

 Here is the site and the file names:
 Test Site:
 - index.php
 - about.php
 - services.php
 
 Which example would cause more stress on the server and/or what are the 
 advantages, disadvantages to each example?
 
 Example 1
 -index.php with these links:
 a href=index.phpHome/a
 a href=index.php?view=aboutHome/a
 a href=index.php?view=servicesHome/a
 
 With the index.php using a switch statment for the view var and file 
 includes.
 
 OR
 
 Example 2
 -index.php with these links:
 a href=index.phpHome/a
 a href=about.phpHome/a
 a href=services.phpHome/a
 
 Any help will be appreciated.
 
 -Matt

-- 
 Jason Morehouse (jm[@]netconcepts[.]com)
 Netconcepts - http://www.netconcepts.com
 Auckland, New Zealand
 Linux: Because rebooting is for adding hardware.


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




Re: [PHP] Re: more stress on server...

2002-09-22 Thread Bill Leonard

On 9/22/02 9:08 PM, Jason Morehouse [EMAIL PROTECTED] wrote:


 Example 1
 -index.php with these links:
 a href=index.phpHome/a
 a href=index.php?view=aboutHome/a
 a href=index.php?view=servicesHome/a

 all of your code in one file, I can't imagine any reason why example
 1 would be of any use / advantage.

That's easy! Modular site building.

Ever hear of Fusebox for PHP and ColdFusion (www.fusebox.org)? Corral for
Lasso (www.corralmethod.org)? These and other frameworks allow for rapid
construction of complex sites by reusing elements and conditionally doing
things on the fly! (among other stuff)

But you are correct, search engines tend to not think sites built this way
are very deep. So alternate URL coding should be considered in every case!

Good luck.


-- 
Bill Leonard   [EMAIL PROTECTED]
www.machinemen.com407.464.0147

XrackHosting.com - Mac OS X hosting done right!
http://www.xrackhosting.com/




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




RE: [PHP] return the amount of records in a mysql databace

2002-09-22 Thread John Holmes

Then do a SHOW DATABASES query before that and loop through the results,
counting the rows in each table. 

If you have to do this, though, I think you have some normalization
issues with your database...

---John Holmes...

 -Original Message-
 From: Jeff Bluemel [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 22, 2002 11:46 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] return the amount of records in a mysql databace
 
 this is only going to return records in a table, and not in a database
 
 
  select count(*) as n from ... where ...
 
  -Original Message-
  From: Philip J. Newman [mailto:[EMAIL PROTECTED]]
 
  Can someone point me in the right direction to find out how i can
return
 the
  amount of records in a mysql databace ?
 
 
 
 
 --
 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] Replace linefeed/newline from text inputs with br tag?

2002-09-22 Thread Patrick Lebon

If i have a textarea form input for users and they enter in return spaces,
how can i replace the ascci chars with html tags?



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




RE: [PHP] Date Time

2002-09-22 Thread Don Read


On 21-Sep-2002 Patrick wrote:
 Hi,,
 
 my server is located in the US and i live in Sweden, so when i try to run
 the following command i get a 8hour diffrence,, anyone got any idea of how
 to solve this?
 
 date(Y-m-j)
 
 

putenv('TZ=Europe/Stockholm');
mktime(0,0,0,1,1,1970);
echo date(Y-m-j);

-- 
Don Read   [EMAIL PROTECTED]
-- Beer is proof that God loves us and wants us to be happy.

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




php-general Digest 23 Sep 2002 01:40:35 -0000 Issue 1601

2002-09-22 Thread php-general-digest-help


php-general Digest 23 Sep 2002 01:40:35 - Issue 1601

Topics (messages 117162 through 117220):

mysql password function
117162 by: Murat Ö.

Re: Elliptic curve cryptology
117163 by: EjdeR
117168 by: pan
117172 by: EjdeR

Re: A weired browser-session problem
117164 by: Chris Shiflett

cookies?
117165 by: :B nerdy

Re: LDAP (NDS) authentication example...
117166 by: Stig Venaas

Create Thumbnails from image
117167 by: Kjell Hansen

closing browser's window
117169 by: Murat Ö.
117174 by: EjdeR
117176 by: Chris Hewitt
117209 by: Justin French

Designing N-tier applications in PHP (long)
117170 by: Michael Sims
117183 by: Chris Shiflett
117186 by: Peter J. Schoenster
117192 by: Michael Sims
117194 by: Michael Sims
117197 by: Peter J. Schoenster
117198 by: Manuel Lemos
117206 by: Michael Sims
117210 by: Michael Sims

Web site analysys
117171 by: Rosen

Re: return the amount of records in a mysql databace
117173 by: Jeff Bluemel
117180 by: Chris Shiflett
117189 by: Philip J. Newman
117218 by: John Holmes

i got a method but how in php now?
117175 by: :B nerdy

Re: algorythm question
117177 by: Barýþ

$_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var]; ???
117178 by: Victor
117185 by: Peter J. Schoenster

Re: [PHP-WIN] Create Thumbnails from image
117179 by: Olivier Hubert

Re: [PHP-DB] password function
117181 by: Stephen Craton

Re: counting guest users
117182 by: Stephen Craton

unlink() and IIS
117184 by: Gerard Samuel

Update undefined List Values in DB
117187 by: Sascha Braun

Cannot Redeclare?
117188 by: Stephen Craton

What does this error mean
117190 by: Randy Johnson
117191 by: Daniel Kushner
117193 by: Randy Johnson

Calling class functions using string variables?
117195 by: Nick Richardson
117196 by: Nick Richardson

session_start() -- no more output
117199 by: Hans Wilmer
117201 by: Michael Sims

JAVASCRIPT INCLUDES
117200 by: Georgie Casey
117202 by: Chris Shiflett
117204 by: Georgie Casey
117207 by: Chris Shiflett
117208 by: Georgie Casey
117211 by: David Rice

solved
117203 by: :B nerdy

error with php and pdflib
117205 by: Thoenen, Peter  Mr.  EPS

Redirection
117212 by: Sascha Braun
117213 by: Todd Pasley
117214 by: Justin French
117215 by: Chris Shiflett

Re: more stress on server...
117216 by: Jason Morehouse
117217 by: Bill Leonard

Replace linefeed/newline from text inputs with br tag?
117219 by: Patrick Lebon

Re: Date Time
117220 by: Don Read

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

---BeginMessage---

hi,
i want to encode a string that users enter with mysql password function. but
sometimes this code works sometimes don't. mysql warns me:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in 

the code is:

$result=mysql_query(select password(.$_POST['password'].));
  while ($p = mysql_fetch_array($result, MYSQL_ASSOC)):
  $pswrd=$p['password('.$_POST['password'].')'];
  endwhile;

thanks...




---End Message---
---BeginMessage---

i know searching.. and buy books. i asked for an little example..

Danny Shepherd [EMAIL PROTECTED] wrote in message
001201c2622d$4d52d640$0200a8c0@DANNYS">news:001201c2622d$4d52d640$0200a8c0@DANNYS...
 http://www.amazon.com/exec/obidos/ASIN/1884777694/102-5129419-0804910

 - Original Message -
 From: EjdeR [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 22, 2002 11:12 AM
 Subject: [PHP] Elliptic curve cryptology


  i cant find any example about Elliptic curve cryptology.. do you have
 any
  example? i cant understand without an example :)
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




---End Message---
---BeginMessage---




 i cant find any example about Elliptic curve cryptology.. do you
have any
 example? i cant understand without an example :)


Ten seconds of googling produced these URLs.

http://www.certicom.com/resources/w_papers/w_papers.html

http://www.certicom.com/resources/ecc_tutorial/ecc_tutorial.html


---End Message---
---BeginMessage---

thnx

Pan [EMAIL PROTECTED] wrote in message
004501c26249$89786a60$0901a8c0@plexus">news:004501c26249$89786a60$0901a8c0@plexus...



  i cant find any example about Elliptic curve cryptology.. do you
 have any
  example? i cant understand without an example :)
 

 Ten 

[PHP] Specify authentication for SMTP mailserver?

2002-09-22 Thread Joseph Szobody

I'm trying to send mail on a Windows machine using PHP. I have made the necessary 
corrections in the php.ini file for the SMTP server address, and the sendmail_from, my 
problem is that my SMTP server require authentication. How do I tell PHP to provide 
this?

Thanks!

Joseph


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




RE: [PHP] mysql password function

2002-09-22 Thread John Holmes

Use this:

$result = mysql_query(SELECT PASSWORD( . $_POST['password'] . ));
$password = mysql_result($result,0);

or just use mysql_fetch_row() or AS in your query so you don't have to
recreate that complex column name.

---John Holmes...

 -Original Message-
 From: Murat Ö. [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 22, 2002 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] mysql password function
 
 hi,
 i want to encode a string that users enter with mysql password
function.
 but
 sometimes this code works sometimes don't. mysql warns me:
 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
 result
 resource in 
 
 the code is:
 
 $result=mysql_query(select password(.$_POST['password'].));
   while ($p = mysql_fetch_array($result, MYSQL_ASSOC)):
   $pswrd=$p['password('.$_POST['password'].')'];
   endwhile;
 
 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




Re: [PHP] return the amount of records in a mysql databace

2002-09-22 Thread Philip J. Newman

select count(*) as n from ... where ...

This worked well for me.

- Original Message - 
From: John Holmes [EMAIL PROTECTED]
To: 'Jeff Bluemel' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 1:28 PM
Subject: RE: [PHP] return the amount of records in a mysql databace


 Then do a SHOW DATABASES query before that and loop through the results,
 counting the rows in each table. 
 
 If you have to do this, though, I think you have some normalization
 issues with your database...
 
 ---John Holmes...
 
  -Original Message-
  From: Jeff Bluemel [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, September 22, 2002 11:46 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] return the amount of records in a mysql databace
  
  this is only going to return records in a table, and not in a database
  
  
   select count(*) as n from ... where ...
  
   -Original Message-
   From: Philip J. Newman [mailto:[EMAIL PROTECTED]]
  
   Can someone point me in the right direction to find out how i can
 return
  the
   amount of records in a mysql databace ?
  
  
  
  
  --
  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] Redirection

2002-09-22 Thread Sascha Cunz

And also avoid including scripts that contain a linebreak or a space after any 
'?'. When I did this first time, it took me ages to find out what was 
wrong... :-)

Sascha

Am Montag, 23. September 2002 02:07 schrieb Justin French:
 Validate the input BEFORE outputting anything to the browser... this way
 you have control over such problems.

 ?
 // validate
 // code
 // here


 if($valid)
 {
 header(...);
 exit;
 }
 ?
 HTML
 ?
 if(!$valid)
 {
 echo error on form;
 }
 ?
 /HTML

 The code below exit; will only be executed if the input was NOT valid


 Regards,

 Justin

 on 23/09/02 9:42 AM, Sascha Braun ([EMAIL PROTECTED]) wrote:
  Hi,
 
  I want to post a form and after parsing i want to redirect the user to
  the home page.
 
  header() doesn't work in this circumstance, what can I do else?
 
  Greetings
 
  Sascha


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




RE: [PHP] Replace linefeed/newline from text inputs with br tag?

2002-09-22 Thread John Holmes

 If i have a textarea form input for users and they enter in return
spaces,
 how can i replace the ascci chars with html tags?

It'd be great if they had a function for this...they could call it
nl2br() or something...

www.php.net/nl2br

---John Holmes...


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




Re: [PHP] Running a PHP script automatically?

2002-09-22 Thread Sascha Cunz

 On the Linux box compile PHP as CGI (i.e. don't configure it as an apache
 mod). Then you can just run your script from the the command-line.

This is called CLI (Command Line Interface), not CGI (Common Gateway 
Interface). The CGI is called from an WebServer; CLI get's called from a 
shell-(script) or any thing.

Anyway, this is the most likely way to do this. The PHP Binaries for Windows 
already ship with a CLI-Version of PHP which lives in the root of your PHP 
folder. Most Linux Distribution have also one (I'm not using Red Hat), which 
would usually live in /usr/bin/php ( to find out, type: whereis php).
The CLI can fine be scheduled either by a Vixie-Crontab or by a windows 
scheduler task.

Sascha


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




[PHP] FW: Cannot Redeclare?

2002-09-22 Thread Stephen Craton

Hello,

I was just wondering...again...why the heck I keep getting this error.
I'm trying to make a function called login() and sometimes it works,
other times it hates me and gives me this error:

Fatal error: Cannot redeclare login() in
c:\apache\htdocs\wiredphp\member\funcs.php on line 5

Here's the contents of the function login():

function login($username, $password)
{
  $sql = select * from members where username='$username' and passwd =
password('$password');
  $result = mysql_query($sql, $wired);
  if (!$result)
 return 0;
  
  if (mysql_num_rows($result)0)
 return 1;
  else 
 return 0;
}

Please help. I don't see why this keeps happening...

Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us

P.S. I'm sending this again because I don't know if the other got
through or not...



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




RE: [PHP] FW: Cannot Redeclare?

2002-09-22 Thread John Holmes

Funcs.php is probably being included twice at some point in your code.

---John Holmes...

 -Original Message-
 From: Stephen Craton [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 22, 2002 10:56 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] FW: Cannot Redeclare?
 
 Hello,
 
 I was just wondering...again...why the heck I keep getting this error.
 I'm trying to make a function called login() and sometimes it works,
 other times it hates me and gives me this error:
 
 Fatal error: Cannot redeclare login() in
 c:\apache\htdocs\wiredphp\member\funcs.php on line 5
 
 Here's the contents of the function login():
 
 function login($username, $password)
 {
   $sql = select * from members where username='$username' and passwd
=
 password('$password');
   $result = mysql_query($sql, $wired);
   if (!$result)
  return 0;
 
   if (mysql_num_rows($result)0)
  return 1;
   else
  return 0;
 }
 
 Please help. I don't see why this keeps happening...
 
 Thanks,
 Stephen
 http://www.melchior.us
 http://php.melchior.us
 
 P.S. I'm sending this again because I don't know if the other got
 through or not...
 
 
 
 --
 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] FW: Cannot Redeclare?

2002-09-22 Thread Daniel Kushner

When including the file funcs.php use include_one().

Regards,
Daniel Kushner

Need hosting? http://thehostingcompany.us



-Original Message-
From: Stephen Craton [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 22, 2002 10:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] FW: Cannot Redeclare?


Hello,

I was just wondering...again...why the heck I keep getting this error.
I'm trying to make a function called login() and sometimes it works,
other times it hates me and gives me this error:

Fatal error: Cannot redeclare login() in
c:\apache\htdocs\wiredphp\member\funcs.php on line 5

Here's the contents of the function login():

function login($username, $password)
{
  $sql = select * from members where username='$username' and passwd =
password('$password');
  $result = mysql_query($sql, $wired);
  if (!$result)
 return 0;
  
  if (mysql_num_rows($result)0)
 return 1;
  else 
 return 0;
}

Please help. I don't see why this keeps happening...

Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us

P.S. I'm sending this again because I don't know if the other got
through or not...



-- 
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] FW: Cannot Redeclare?

2002-09-22 Thread Daniel Kushner

Typo:
include_one() === include_once()


-Original Message-
From: Daniel Kushner [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 22, 2002 11:06 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] FW: Cannot Redeclare?


When including the file funcs.php use include_one().

Regards,
Daniel Kushner

Need hosting? http://thehostingcompany.us



-Original Message-
From: Stephen Craton [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, September 22, 2002 10:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] FW: Cannot Redeclare?


Hello,

I was just wondering...again...why the heck I keep getting this error.
I'm trying to make a function called login() and sometimes it works,
other times it hates me and gives me this error:

Fatal error: Cannot redeclare login() in
c:\apache\htdocs\wiredphp\member\funcs.php on line 5

Here's the contents of the function login():

function login($username, $password)
{
  $sql = select * from members where username='$username' and passwd =
password('$password');
  $result = mysql_query($sql, $wired);
  if (!$result)
 return 0;
  
  if (mysql_num_rows($result)0)
 return 1;
  else 
 return 0;
}

Please help. I don't see why this keeps happening...

Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us

P.S. I'm sending this again because I don't know if the other got
through or not...



-- 
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] Help with mail...

2002-09-22 Thread Chuck \PUP\ Payne

Hi,

Well after read php.net and my copy php 4 bible. I am lost with mail. I can
get it to work if I do this...

Mail ('[EMAIL PROTECTED]', 'Data Added',
   $fname, $lname .);

But I can't get this to work...I know someone going to call me stupid but I
am really having people with mail(), Is there a special place to put it?

Here example of my codeany way I trying to hammer it out and using
google to see where the error of my way is.

Chuck Payne


---

HTML
HEAD
TITLEKillers Added/TITLE
/HEAD

BODY TOPMARGIN=50

?php

if ($fname==) {
echo You did not supply a first name. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
  
  if ($lname==) {
echo You did not supply a Last Name. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
  
  if ($title==) {
echo You did not supply a Movie Title. Please hit the 'Back' button on
  your browser and fill in a name.\n;
exit;
  }
 
 $dbh = mysql_connect(deathtoasp, zombieuser, eatmsbrains)
 or die (Unable to connect to database);
  mysql_select_db(slashers, $dbh)
 or die (An error was reported);
 
  $table_name = deathmovies;

  $statement = INSERT INTO $table_name (fname, lname, title) VALUES
(\$fname\, \$lname\, \$title\);

  $result = mysql_query($statement, $dbh);
  
  if ($result) {
  
echo H3Adding the following record/H3;
echo hr;
echo pstrongActor/Actress:/strongnbsp;nbsp; $fname $lname
/p;
echo br;
echo pstrongMovie:/strongnbsp;nbsp;$title/p;
echo a href='addactormovie.html'Add more Actor/Actress and Movie
which they stared in/a;
echo hr;

   $address = [EMAIL PROTECTED];
   $Subject = The new movie and actor added to phpMovie Library;
   $body = Adding the following record
Actor/Actress: '$fname $lname'
Movie: '$title';


mail('$address', '$Subject', '$body .');

  } else {
  
echo There was an error saving your entry. Please try back in a
little while.;
  }
 
?

/BODY
/HTML





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




RE: [PHP] Help with mail...

2002-09-22 Thread John Holmes

Variables are not evaluated within single quotes. You are trying to send
an email to $address, literally. If you just have a single variable,
lose the quotes entirely.

Mail($address,$subject,$body);

---John Holmes...

 -Original Message-
 From: Chuck PUP Payne [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 22, 2002 11:41 PM
 To: PHP General
 Subject: [PHP] Help with mail...
 
 Hi,
 
 Well after read php.net and my copy php 4 bible. I am lost with mail.
I
 can
 get it to work if I do this...
 
 Mail ('[EMAIL PROTECTED]', 'Data Added',
$fname, $lname .);
 
 But I can't get this to work...I know someone going to call me stupid
but
 I
 am really having people with mail(), Is there a special place to put
it?
 
 Here example of my codeany way I trying to hammer it out and using
 google to see where the error of my way is.
 
 Chuck Payne
 
 
 ---
 
 HTML
 HEAD
 TITLEKillers Added/TITLE
 /HEAD
 
 BODY TOPMARGIN=50
 
 ?php
 
 if ($fname==) {
 echo You did not supply a first name. Please hit the 'Back'
button on
   your browser and fill in a name.\n;
 exit;
   }
 
   if ($lname==) {
 echo You did not supply a Last Name. Please hit the 'Back' button
on
   your browser and fill in a name.\n;
 exit;
   }
 
   if ($title==) {
 echo You did not supply a Movie Title. Please hit the 'Back'
button
 on
   your browser and fill in a name.\n;
 exit;
   }
 
  $dbh = mysql_connect(deathtoasp, zombieuser, eatmsbrains)
  or die (Unable to connect to database);
   mysql_select_db(slashers, $dbh)
  or die (An error was reported);
 
   $table_name = deathmovies;
 
   $statement = INSERT INTO $table_name (fname, lname, title) VALUES
 (\$fname\, \$lname\, \$title\);
 
   $result = mysql_query($statement, $dbh);
 
   if ($result) {
 
 echo H3Adding the following record/H3;
 echo hr;
 echo pstrongActor/Actress:/strongnbsp;nbsp; $fname $lname
 /p;
 echo br;
 echo pstrongMovie:/strongnbsp;nbsp;$title/p;
 echo a href='addactormovie.html'Add more Actor/Actress and
Movie
 which they stared in/a;
 echo hr;
 
$address = [EMAIL PROTECTED];
$Subject = The new movie and actor added to phpMovie Library;
$body = Adding the following record
 Actor/Actress: '$fname $lname'
 Movie: '$title';
 
 
 mail('$address', '$Subject', '$body .');
 
   } else {
 
 echo There was an error saving your entry. Please try back in a
 little while.;
   }
 
 ?
 
 /BODY
 /HTML
 
 
 
 
 
 --
 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] Help with mail...

2002-09-22 Thread Chuck PUP Payne

Ok, that work. Why does the ' (quote) not make it work is it because it's an
array? Any thanks John that got it work.


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




Re: [PHP] Help with mail...

2002-09-22 Thread Justin French

strings in double quotes are evaluated looking for $vars and {$vars} to
substitute.  strings with in single quotes are not evaluated for vars.

$var = my favourite color is {$col};  // works
$var = my favourite color is $col;// works
$var = 'my favourite color is $col';// doesn't work
$var = 'my favourite color is ' . $col; // works

Same applies to strings within functions:

include('{$dir}/{$file}.inc')   // doesn't work
include('$dir/$file.inc')   // doesn't work
include($dir.'/'.$file.'.inc')  // works
include({$dir}/{$file}.inc)   // works
include($dir/$file.inc)   // probably works

Nothing to do with arrays :)

HTH

Justin


on 23/09/02 1:52 PM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:

 Ok, that work. Why does the ' (quote) not make it work is it because it's an
 array? Any thanks John that got it work.
 


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




Re: [PHP] Designing N-tier applications in PHP (long)

2002-09-22 Thread Garth Dahlstrom

If you need to bridge Perl and PHP, as suggested previously you 
could implement a web-service (SOAP or XML-RPC).  Alternatively,
you could write something Java bean and use PHP's Java support. 

Either of those will be costly from a performance point of view
CORBA will be the same (from what I have read HelloWorld in CORBA
is a painful 50 line program, one reason Java developed RMI to use 
instead).

In any case, I have to agree with folks who say mixing languages 
for the sake of gaining experince on a project is a bad idea.  There 
are definately places when introducing a new tech is a desireable 
thing, particuliarly when that tech offers some potentially large 
benefit to your project at a realtively small risk (i.e. at my 
company we recently re-wrote a JSP app to use struts+tiles moving 
to a templated set-up which will pay off as the app grows in size).

If you are only using Perl, to parse through a user's mail box, I 
would think you'd be better off to stick with PHP (the .cgi 
version),  using it as a shell script and parsing the STDIN with 
fopen(php://stdin,r) as Manuel suggested.  Split out your 
PHP logic into biz logic classes and then call your biz logic 
classes (include bizlogic.php) in both your web portion and 
your email processing portion...

#!/usr/bin/php4
[?php
# replace [?php ] brackets with angles ?php 
# email script 
include bizlogic.php;
$bl = new bizlogic();
$x = join('', file(php://stdin));
switch ($argv[0]) {
'-process': $y = preg_match( ... , $x);
$bl-processcommand($y, $x);
break;
'-profit': $bl-profit($x);
   break;
}
...
?]

-GED

Northern.CA ===--
http://www.northern.ca 
Canada's Search Engine





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




[PHP] Comparing Alphanumeric values in a range

2002-09-22 Thread Samantha Savvakis

Hi,

I have a task to generate a new document number for a given range. This
document number is alphanumeric.

Here is the problem:

$lowrange1 = 90;
$highrange1 = HZ;

$currentno = 90CZZZ;

I expect that the next number in the series is:  $nextnum = 90D000;

Before using this next number in the series, I need to confirm that the
number falls within the given range.

So I do something like this:

if ((strval($nextnum) = strval($lowrange1))  (strval($nextnum) =
strval($highrange1)))
{
// we have a valid number in the range
}
else
{
// not in the range
}

Now.. the problem is - PHP thinks that 90D000 is less than $lowrange1. I
individually tested them and $lowrange1 was consistently greater than the
number.

I put the strval function around each variable to ensure it was comparing
strings and not numbers for those variables that only contain numbers. This
seems to be a problem with the letter D and E for all positions within
the 6 character alphanumeric number, except for the last position.

ie. 90D works - $lowrange1 is less than this number and $highrange1 is
greater than this number.

For all other positions where the letter D and E are generated:

ie. 9000D0, 900D00, 90D000, 9D and 9000E0, 900E00, 90E000, 9E

Is there a known problem with this? Why it is only happening with the
letters D and E? If I have 900F00 - this works, and so on for the rest
of the letters of the alphabet.

Thanks,
Sam




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




[PHP] Re: Comparing Alphanumeric values in a range

2002-09-22 Thread Samantha Savvakis

Just quickly, forgot to mention:

I've tested this on 2 platforms:

Windows PHP 4.2.1
SCO Openserver 4.2.1

These two both don't work.

I just tested on SCO OpenUnix 4.2.1 - this one works!! Problem is, I need
this to work on SCO Openserver.

Thanks,
Sam

Samantha Savvakis [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 I have a task to generate a new document number for a given range. This
 document number is alphanumeric.

 Here is the problem:

 $lowrange1 = 90;
 $highrange1 = HZ;

 $currentno = 90CZZZ;

 I expect that the next number in the series is:  $nextnum = 90D000;

 Before using this next number in the series, I need to confirm that the
 number falls within the given range.

 So I do something like this:

 if ((strval($nextnum) = strval($lowrange1))  (strval($nextnum) =
 strval($highrange1)))
 {
 // we have a valid number in the range
 }
 else
 {
 // not in the range
 }

 Now.. the problem is - PHP thinks that 90D000 is less than $lowrange1. I
 individually tested them and $lowrange1 was consistently greater than the
 number.

 I put the strval function around each variable to ensure it was comparing
 strings and not numbers for those variables that only contain numbers.
This
 seems to be a problem with the letter D and E for all positions within
 the 6 character alphanumeric number, except for the last position.

 ie. 90D works - $lowrange1 is less than this number and $highrange1 is
 greater than this number.

 For all other positions where the letter D and E are generated:

 ie. 9000D0, 900D00, 90D000, 9D and 9000E0, 900E00, 90E000, 9E

 Is there a known problem with this? Why it is only happening with the
 letters D and E? If I have 900F00 - this works, and so on for the rest
 of the letters of the alphabet.

 Thanks,
 Sam






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




[PHP] Re: Comparing Alphanumeric values in a range

2002-09-22 Thread Samantha Savvakis

Er..no, isn't working on OpenUnix.

90DZZZ - this should be 90E000 after the increment.

This isn't working on any platform using PHP 4.2.1



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




[PHP] mysql_num_rows error

2002-09-22 Thread Nick Varner

I am new to php and that the folowing error: Warning: mysql_num_rows():
supplied argument is not a valid MySQL result resource in
/home/tbonestu/public_html/smallimages.php

i dont know what i am doing wrong here is the code:

  $db = mysql_pconnect(connect info);

 mysql_select_db(images);
 $query = select * from images where type =.$type.;
 $result = mysql_query($query);
 $num_results = mysql_num_rows($result);





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




[PHP] Wrap content with a layout file

2002-09-22 Thread Patrick Lebon

Is there a way to create a layout file that can wrap around other pages with
data in them. I am currently using two includes (one at the start of the
page and one at the end) but was wondering if there is a better way to do
this.
Thanks



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




[PHP] Re: Specify authentication for SMTP mailserver?

2002-09-22 Thread Manuel Lemos

Hello,

On 09/22/2002 10:45 PM, Joseph Szobody wrote:

  I'm trying to send mail on a Windows machine using PHP. I have made
  the necessary corrections in the php.ini file for the SMTP server
  address, and the sendmail_from, my problem is that my SMTP server
  require authentication. How do I tell PHP to provide this?

There is no way to do it.

You may want to try this class instead as it supports authentication as 
you need:

http://www.phpclasses.org/smtpclass

I have also a mail() function replacement based on that class and this 
other class that does a few other things too, but I haven't fully tested 
it. If you want to wait, I may upload it soon:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos


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




RE: [PHP] Re: Specify authentication for SMTP mailserver?

2002-09-22 Thread Pablo Oliva

You can run your own SMTP server, if it helps...
http://www.postcastserver.com/  Extremely easy to set up.


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




Re: [PHP] mysql_num_rows error

2002-09-22 Thread Tom Rogers

Hi,

Sunday, September 23, 2001, 3:25:02 PM, you wrote:
NV I am new to php and that the folowing error: Warning: mysql_num_rows():
NV supplied argument is not a valid MySQL result resource in
NV /home/tbonestu/public_html/smallimages.php

NV i dont know what i am doing wrong here is the code:

NV   $db = mysql_pconnect(connect info);

NV  mysql_select_db(images);
NV  $query = select * from images where type =.$type.;
NV  $result = mysql_query($query);
NV  $num_results = mysql_num_rows($result);


Do it this way

$query = select * from images where type = '$type';

or if you prefer
$query = select * from images where type = '.$type.';


PS check your comps date its a year out


-- 
regards,
Tom


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