[PHP] Is it possible to pass arguements when using PHP before 4.3.n?[SOLVED]

2004-05-13 Thread Jay Blanchard
Is it possible to pass arguements when using PHP before 4.3.n when doing
command line stuff?

I have built a small script that opens a file, reads from it, and
returns some results. Instead of changing the fopen line each time I
would just like to pass the name of the file to be tested.

I tried as a URL

/usr/local/bin/php mySmallScript.php?n=foo.php

Didn't work. Wait...

Heck.

Works fine if you do not mind the headers. $argv and $argc are the
answers. 

/usr/local/bin/php mySmallScript.php foo.php

foo.php will be in $argv[1] 

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



[PHP] a passion to perform ;)

2004-05-13 Thread Matthias H. Risse
Hi,

i just benchmarked some of my applications with PEAR::Benchmark
and would like to know if any of you have good literature
regarding PHP and performance in generall? I am not talking
about precompiled scripts (ioncube, zend, ..)
Basically I am trying to find out how good a standard HTML rendering 
PHP-Applications usually performs? Furthermore I wonder of there are any 
usability papers/studies regarding this topic?

(how long is long for a user? how
long is a user on broadband usually expectin a page to load without
thinking damn. why does this take so long?)
Maybe anyone knows of a good free performace and memory profiler?

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


RE: [PHP] a passion to perform ;)

2004-05-13 Thread Robert Sossomon
I still stick with the old rule:
If it takes more then 2 seconds to load anything, 5 seconds to do a
complete page with lots of images on dial-up then you have to go back to
the drawing board.  2-5 seconds has always been your window to get a
page to load and keep the visitor.  On top of that stay away from
flash/shockwave and you are ahead of the game.

My $.02

Robert

-Original Message-
From: Matthias H. Risse [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 13, 2004 11:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] a passion to perform ;)



Hi,

i just benchmarked some of my applications with PEAR::Benchmark and
would like to know if any of you have good literature regarding PHP and
performance in generall? I am not talking about precompiled scripts
(ioncube, zend, ..)

Basically I am trying to find out how good a standard HTML rendering 
PHP-Applications usually performs? Furthermore I wonder of there are any

usability papers/studies regarding this topic?

(how long is long for a user? how
long is a user on broadband usually expectin a page to load without
thinking damn. why does this take so long?)

Maybe anyone knows of a good free performace and memory profiler?

Yours,
Matthias

-- 
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] Is it possible to pass arguements when using PHP before 4.3.n?[SOLVED]

2004-05-13 Thread Marek Kilimajer
Jay Blanchard wrote:
Is it possible to pass arguements when using PHP before 4.3.n when doing
command line stuff?
I have built a small script that opens a file, reads from it, and
returns some results. Instead of changing the fopen line each time I
would just like to pass the name of the file to be tested.
I tried as a URL

/usr/local/bin/php mySmallScript.php?n=foo.php

Didn't work. Wait...

Heck.

Works fine if you do not mind the headers. $argv and $argc are the
answers. 

/usr/local/bin/php mySmallScript.php foo.php

foo.php will be in $argv[1] 

Use -q if you don't want the headers:

/usr/local/bin/php -q mySmallScript.php foo.php

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


[PHP] php-mysql problem

2004-05-13 Thread Jianping Zhu


I  have redhat 9.0 and Server version: Apache/2.0.40.
  i have installed rpms php-4.2.2-17.2.i386.rpm
   php-mysql-4.2.2-17.2.i386.rpm


   After i create a database called mydb and serveral tables in mysql,
   I tried to run following testdb.php script


   --
   html
   body
   ?php
   $db = mysql_connect(localhost, root,xx);
   mysql_select_db(mydb,$db);
   $result = mysql_query(SELECT * FROM employees,$db);
   printf(First Name: %sbr\n, mysql_result($result,0,first));
   printf(Last Name: %sbr\n, mysql_result($result,0,last));
   printf(Address: %sbr\n, mysql_result($result,0,address));
   printf(Position: %sbr\n, mysql_result($result,0,position));
   ?
   /body
   /html
   ---

   but i got error message with:
   http://coopunit.forestry.uga.edu:8080/testdb.php
   the error is:
   Fatal error: Call to undefined function:
   mysql_connect() in /var/www/html/testdb.php on line 13

   How can Fix this problem? Thanks
   

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



Re: [PHP] site search engine.. not dynamic

2004-05-13 Thread Marek Kilimajer
Aaron Wolski wrote:
Hi all,
 
Can anyone point me in the direction of a site search engine that reads
files in a directory find relevant results for an search term that a
person might enter on a site?
 
I need to build a site search engine but the problem is. the site isn't
dynamic (yet) so I need to read actual files to pull things together.
 
Anything out there?
 
Thanks!
 
Aaron
I recomend you use some soft like htdig for this task

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


[PHP] dinamic hashes

2004-05-13 Thread Yivi
Hello everyone.
I am having a stupid problem with a couple of arrays, tried a couple of 
things but I am feeling disconcerted.

The thing is, I thought it was possible to create arrays in a dynamic 
fashion, as in:
$newarray['newkey'] = new_value;
And the array would be incremented accordingly.
And afterwards, if I wanted to add a new key to the thing, just doing:
$newarray['anotherkey'] = anothervalue; would be enough.
Generally speaking I have been trying that and it was working, but right 
now I am having some trouble with this.

I am parsing a kind of referrals log file, and as I get the values I 
want to create  a hash with all the values I get into a hash to use 
later on.

Each line of the log is processed in a while() loop, and after 
extracting the values for $searchSource, $searchDomain and $searchTerm I 
try to create the hash entries with these lines:

$table[$searchSource][$searchDomain][$searchTerm][total]+=$row['order_total'];
$table[$searchSource][$searchDomain][$searchTerm][count]++;
total is an amount that I want to aggregate for each $seachTerm, and 
count an obvious counter with total hits per $searchTerm/Domain/Source 
combination. $table is an array which I create before entering the loop 
with: $table = array();

The problem is that I keep getting this warnings and notices:
Notice: Undefined index: GGAW in 
c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Notice: Undefined index: www.google.com in 
c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Notice: Undefined index: obscuredterm in 
c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Notice: Undefined index: total in 
c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Notice: Undefined index: count in 
c:\www\deepswarm.co.uk\script\monthlytable.php on line 62

Using the @ operator the scripts works perfectly, but I still want to 
know why I am generating so many notices, and if there is any other 
cleaner way of doing things.

I can't create the hash with all necessary keys beforehand because I 
won't know the values until runtime, so doing something like:
$table = array (GGAW =
		array (www.google.com =
			array (obscuredterm =
			array(total, count)
			)
		)
	)
before going into the actual loop is out of the question.

Any ideas? This is probably very obvious, but I keep hitting my head 
against the wall. Light would be greatly appreciated.

Thanks for your help.

Regards,

I.-

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


[PHP] Webcapture to PDF

2004-05-13 Thread Ashley M. Kirchner
   Looking for a (open source) solution here: is there some way that I 
can convert an already existing HTML page to a PDF file, by means of a 
script (on a unix box)?  What I'd like to do is have a button on all of 
our pages that, when clicked on, will perform a capture of that page, 
including all images, convert to PDF, and serve it back to the user's 
browser.  I don't just want what the user's viewing (I doubt that's 
possible anyway from a server-side point.)  I want a full page capture, 
and then converted.

   Basically, something similar to what www.browsercam.com is doing 
when you submit a URL to them.  Does anyone know of a way, a script, or 
something, that can accomplish this?

--
W | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] dinamic hashes

2004-05-13 Thread Tom Rogers
Hi,

Thursday, May 13, 2004, 9:59:23 PM, you wrote:
Y Hello everyone.
Y I am having a stupid problem with a couple of arrays, tried a couple of
Y things but I am feeling disconcerted.

Y The thing is, I thought it was possible to create arrays in a dynamic
Y fashion, as in:
Y $newarray['newkey'] = new_value;
Y And the array would be incremented accordingly.
Y And afterwards, if I wanted to add a new key to the thing, just doing:
Y $newarray['anotherkey'] = anothervalue; would be enough.
Y Generally speaking I have been trying that and it was working, but right
Y now I am having some trouble with this.

Y I am parsing a kind of referrals log file, and as I get the values I
Y want to create  a hash with all the values I get into a hash to use
Y later on.

Y Each line of the log is processed in a while() loop, and after 
Y extracting the values for $searchSource, $searchDomain and $searchTerm I
Y try to create the hash entries with these lines:

Y 
$table[$searchSource][$searchDomain][$searchTerm][total]+=$row['order_total'];
Y $table[$searchSource][$searchDomain][$searchTerm][count]++;

Y total is an amount that I want to aggregate for each $seachTerm, and
Y count an obvious counter with total hits per $searchTerm/Domain/Source
Y combination. $table is an array which I create before entering the loop
Y with: $table = array();

Y The problem is that I keep getting this warnings and notices:
Y Notice: Undefined index: GGAW in 
Y c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Y Notice: Undefined index: www.google.com in 
Y c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Y Notice: Undefined index: obscuredterm in 
Y c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Y Notice: Undefined index: total in 
Y c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

Y Notice: Undefined index: count in 
Y c:\www\deepswarm.co.uk\script\monthlytable.php on line 62

Y Using the @ operator the scripts works perfectly, but I still want to
Y know why I am generating so many notices, and if there is any other
Y cleaner way of doing things.

Y I can't create the hash with all necessary keys beforehand because I
Y won't know the values until runtime, so doing something like:
Y $table = array (GGAW =
Y  array (www.google.com =
Y  array (obscuredterm =
Y  array(total, count)
Y  )
Y  )
Y  )
Y before going into the actual loop is out of the question.

Y Any ideas? This is probably very obvious, but I keep hitting my head
Y against the wall. Light would be greatly appreciated.

Y Thanks for your help.

Y Regards,

Y I.-


you have to do it like this:

$table[$searchSource][$searchDomain][$searchTerm][total]=
(isset($table[$searchSource][$searchDomain][$searchTerm][total]))? 
$table[$searchSource][$searchDomain][$searchTerm][total] + $row['order_total'] 
: 1;

-- 
regards,
Tom

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



Re: [PHP] php-mysql problem

2004-05-13 Thread Oliver Hankeln
Hello,

[snip]

   but i got error message with:
   http://coopunit.forestry.uga.edu:8080/testdb.php
   the error is:
   Fatal error: Call to undefined function:
   mysql_connect() in /var/www/html/testdb.php on line 13
   How can Fix this problem? Thanks
[/snip]

Your PHP is compiled without mysql support (see 
http://coopunit.forestry.uga.edu:8080/test.php) You do however have dbx 
support. You might want to look at http://de.php.net/manual/de/ref.dbx.php
Your mysql_connect has to be replaced by dbx_connect and so on...
Alternativly you could recompile php with mysql support.

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


Re: [PHP] Webcapture to PDF

2004-05-13 Thread Matt Matijevich
[snip]
Looking for a (open source) solution here: is there some way that I 
can convert an already existing HTML page to a PDF file, by means of a

script (on a unix box)?
[/snip]


You could try http://www.easysw.com/htmldoc/

I have not used it but there is php examples on the site

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



[PHP] Saving and mailing remote file

2004-05-13 Thread Sascha Meyer
Hi there!

I need to email linked files (URLs are retrieved from a database) with PHP 
but after I downloaded the remote file through my script the downloaded 
file headers are always damaged ( I tried to download pdf and zip files).

Could one of you help me in saving the remote file to the local webserver? 
The delivery of the mail with attachment already works fine ...

Thank you in advance!

Sascha

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



php-general Digest 13 May 2004 08:26:03 -0000 Issue 2760

2004-05-13 Thread php-general-digest-help

php-general Digest 13 May 2004 08:26:03 - Issue 2760

Topics (messages 186042 through 186076):

SuExec and PHP
186042 by: Travis Low

Re: include (or require) doesn't seem to work
186043 by: Torsten Roehr

Re: User/Group rights system?
186044 by: Torsten Roehr

mcrypt  pdflib configuration
186045 by: William Holroyd

Re: Memory usage
186046 by: Torsten Roehr

Breaking out of a loop...
186047 by: René Fournier
186049 by: Curt Zirzow
186054 by: René Fournier
186055 by: Curt Zirzow
186057 by: Tom Rogers

Re: HTTP_RAW_POST_DATA
186048 by: Chris Shiflett
186050 by: Michal Migurski
186056 by: Chris Shiflett
186063 by: raditha dissanayake
186064 by: raditha dissanayake
186066 by: Curt Zirzow
186068 by: Michal Migurski

mysql went away
186051 by: Bill Green
186061 by: raditha dissanayake

security and extended ascii characters
186052 by: Chris W

Re: PHP Session Handlers
186053 by: Paul Higgins

Re: Reshuffling an array
186058 by: Todd Cary

Re: Ordering alphabetical in secondary select string
186059 by: R.G. Vervoort

site search engine.. not dynamic
186060 by: Aaron Wolski

Zip-code Form Validation Scripts and Zipcode Program
186062 by: Ryan Munevar
186065 by: Manuel Lemos

a good user directory application...
186067 by: bruce
186069 by: Ryan A
186070 by: bruce

PHP5 - instanceof
186071 by: Martin Towell
186072 by: Travis Low

Multiple Socket's at one time
186073 by: Terence

Re: PHP5 - instanceof [SOLVED]
186074 by: Martin Towell

problem install pws and php
186075 by: lee 03

Saving and mailing remote file
186076 by: Sascha Meyer

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---
Greetings.  We have a need for our PHP scripts to run as the user and group 
associated with each Apache virtual domain on our Redhat server.  Currently, 
all PHP scripts run as nobody.nobody.

I know that the apache suexec module allows CGI scripts to run as the user and 
group of the virtual host, but that doesn't seem to be the case for PHP scripts 
run under the apache php module (mod_php).

So my questions are:

(1) Can we use suexec to force PHP scripts (running under mod_php) to run as 
the user/group associated with the virtual host?  If so, how?  Are there any 
special configuration tricks to make this happen?

(2) If we CAN'T use suexec with mod_php, I assume we can run PHP as CGI to 
solve our problem.  However, I'm worried about performance.  Have any of you 
done this on linux?  Is it difficult to configure?  Do you have to audit all of 
your PHP scripts?  Etc., etc.

I did read the pages http://www.php.net/security.cgi_bin and 
http://www.php.net/manual/en/security.apache.php, but did not come away with 
clear answers to my questions.  There were also a lot of contradictory comments 
at the bottom of those pages, and a whole mess of stuff on google, so I'm 
getting more lost, not less.  Please help!

cheers,

Travis

--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
---End Message---
---BeginMessage---
Daniel Barbar [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks Torsten! Using the file-system relative path made it work (I had
 tried only with the absolute path, which ddidn't work). However, I checked
 again and I did have 'allow_url_fopen = On' in /etc/php.ini. I'll take a
 closer look later and report the problem if I find it. Thanks again,

 Daniel

Using the absolute path works as well - but you have to use the full LOCAL
file path, e.g. /htdocs/www/your-domain etc.

You can get this value from $_SERVER['DOCUMENT_ROOT'].

Regards, Torsten


 Torsten Roehr [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   Try including it as a local file:
   require_once library.php'; // if it is in the same directory as the
file
  you
 
  Forgot a quote here, sorry:
  require_once 'library.php';
 
  Torsten
---End Message---
---BeginMessage---
David David [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello,

 Does anyone know of an open source user/group based
 permission system built with php/MySQL?

 That is, the effective rights for any user on a
 specific secured object are computed from various
 permit/deny permissions assigned to the user or any of
 the groups he/she belongs to.

 PEAR::Auth seems only to support basic user
 authentication.



Take a look at PEAR's LiveUser:
http://pear.php.net/package/LiveUser

Regards, Torsten
---End Message---
---BeginMessage---
I've already posted this question in comp.lang.php but no one seemed to have
an answer to 

[PHP] Re: Ordering alphabetical in secondary select string

2004-05-13 Thread Dennis Biletsky

R.G. Vervoort [EMAIL PROTECTED] ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ: news:[EMAIL PROTECTED]




 Does anyone have a suggestion how I can order a list with names in a
 secondary select string.



 The first string selects a number of locations where people work



 From this string I get several id's form people (in the location table
there
 are no names but id's form the people table) that work on those locations



 No I make another select to get the name form the people table using the
id
 I got before.



 I would like to have the table ordered alphabetical by the name of the
 people



 Since the number op people is very long is will be to slow working the
other
 way around (first selecting people and then  looking for the location)



 Example:



 Location 1Name A

 Name B

 Name C

 Location 3Name D

 Name E

 Location 5Name F

 Location 2Name G

 Location 9Name H

 Location 7Name I








ORDER BY name ASC

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



[PHP] php and bugport problem

2004-05-13 Thread Heba Mushtaha
Hello,  I have installed bugport (it is a bug tracking tool (web based interface), for 
developers , testers , QA  to report bugs and track them through out the whole 
development life cycle, it uses php as its language , the link is 
http://www.incogen.com/index.php?type=Generalparam=bugport ) exactly the same way as 
instructed in the installation notes Yet when I try : 
http://localhost/bugport/index.html it redirects me to 
http://localhost/bugport/php/index.php and this what should happen , yet I get this .. 
here is index.php (I didn't change anything)


RE: [PHP] FIXED: Max file size for uploads?

2004-05-13 Thread Ford, Mike [LSS]
On 12 May 2004 16:48, Robert Sossomon wrote:

 It's fixed now..
 
 If using Apache on RedHat here is everything to fix at once:
 
 FIRST AND FOREMOST DECIDE THE MAX SIZE YOU WANT IN MB, ADD A COUPLE
 MORE TO IT, AND THEN CONVERT TO BYTES (MB * 1024 * 1024)
 
 1.  httpd/conf.d/php.conf
 LimitRequestBody  ?? #byte size you calculated
 
 2.  /etc/php.ini
 max_file_size = ???M #Max size in MB
 post_max_size = ???M #Max size in MB

post_max_size should be larger than max_file_size, since you need to allow
space for any other fields in the form.  If any of your forms have more than
one file upload field, post_max_size should be the appropriate multiple of
max_file_size, plus some overhead.  Apache's LimitRequestBody should also be
adjusted accordingly.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Re: PHP5 and static attributes

2004-05-13 Thread Rudy Metzger
On Thu, 2004-05-13 at 11:41, Gregory wrote:
 Rudy Metzger wrote:
 
 Although you are correct with your explanations to better use methods
 and private/protected attributes, this is not the core of the problem.
 The problem is that self:: always refers to the current class (A or B or
 C), so if you would call self::Something() in C it would not access
 A::Something(). The same counts for parent::. It only accesses the
 instance DIRECTLY below. 
 
 An yes, A::$myInstance is easy to remember. But what if I put it into B
 at some later points, because I am shifting around class structure (for
 whatever well thought out reason)? Then I would have to change all
 occurances of A::$myInstance, which I really do not want.
 
 I think a good solution for this would be to modify parent::, that it
 does not only access its DIRECT superclass, but goes up the hierarchy
 until the static variable is found.
 
 Cheerio
 /rudy
 
 
 I understand what you want to do (or to avoid). Yes, by directly access 
 static
 functions/properties, class hierarchy becomes useless and doesn't allow 
 a complete
 modularity anymore.
 Then the parent:: keyword must go up until a matching function/variable 
 is found.
 You're totally right on this.
 
 Greg

Actually only modifying parent:: does not solve it, because the static
could be in self:: - thus either self:: also has to go up the hierarchy
or a new keyword (static::, class::) is invented. Or even better: Why
not allow this:: to access static variables, e.g. this::$myInstance.
Would make the most sense, i guess.

Cheerio
/rudy

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



Re: [PHP] PHP /\ UML

2004-05-13 Thread Martin Hjort Eriksen
Matthias H. Risse wrote:

thanks. i just dislike the idea of usingdesktop apps bound
to a single gui. why the hell we need this in times of java/awt/swing,
.net, xul and other funky technologies? any more ideas?
/m

A late reply, but I just discovered that Dia also supports PHP, or 
rather, a subproject to Dia supports PHP.

Dia:
http://www.lysator.liu.se/~alla/dia/
Dia2Code:
http://dia2code.sourceforge.net/
/Martin

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


[PHP] Common Functions

2004-05-13 Thread Shaun
Hi,

I have designed my site such that all my common functions are stored in one
file which is included in all other files. So if ever someone presses a
submit button or a link with a special $_GET variable that matches a
variable in the common file the function is performed. e.g.

//common.php
if(isset($_POST[add_user])){
//add user to db...
}

This makes the maintenance of the site very easy as all functions in one
file, however this file has over 2500 lines of code. The site runs on a
dedicated server and performance is not a problem, I would just be very
interested to hear your opinions on this design structure and any problems I
may face with this design pattern.

Thanks for your help

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



[PHP] Re: Common Functions

2004-05-13 Thread Aidan Lister
This doesn't sound like a very secure method of doing things at all. Also,
managing a file that big sounds like quite a nightmare.

Have you looked at using OOP stuff?

Use a couple of standard pear classes like Auth, MDB2, and you're well on
your way to having a very maintainable site.


Shaun [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I have designed my site such that all my common functions are stored in
one
 file which is included in all other files. So if ever someone presses a
 submit button or a link with a special $_GET variable that matches a
 variable in the common file the function is performed. e.g.

 //common.php
 if(isset($_POST[add_user])){
 //add user to db...
 }

 This makes the maintenance of the site very easy as all functions in one
 file, however this file has over 2500 lines of code. The site runs on a
 dedicated server and performance is not a problem, I would just be very
 interested to hear your opinions on this design structure and any problems
I
 may face with this design pattern.

 Thanks for your help

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



Re: [PHP] a good user directory application...

2004-05-13 Thread Aidan Lister
Nothing this big will be solid, if you're looking for a complete PHP website
system, try postnuke/phpnuke whatever.


Bruce [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 ryan...

 we've seen apps that have had some of the functions we're looking for...
ie
 dating apps, cms systems, etc... we're curious if anybody has seen/used
 something that they've considered to be really good/solid...

 -bruce
 [EMAIL PROTECTED]


 -Original Message-
 From: Ryan A [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 12, 2004 8:59 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] a good user directory application...



 On 5/13/2004 4:29:52 AM, [EMAIL PROTECTED] wrote:
  hey...
 
  hi.
  we're looking for a good/really good web based user directory
  application. we'd
  like the app to be able to allow users to login, and add
  information to their profile.
  we'd prefer an app that would provide the
  ability to select/add additional information fields and not constrain
us.
 we
  would also like an app that allows the user to upload a picture for the
  other users to be able to see...
 
  we're
  looking for something that will allow our users to be able to search
  through the profile information, to find other users with the skills
that
  they need. The goal is to be able to support a distributed team of
users.
  this would be a way of allowing them to kind of stay in touch.
 
  we'd also prefer that the app have a good admin function.
 
  if need be, we could always rip this function out of an existing app if
 you
  know of one, and create a stand alone app
 
  Of course we'd
  also prefer that the app be open source...

 Of course...why pay for something so useful??
 Maybe you would also prefer for someone to make this for you...open source
 and free of course :-)

 Cheers,
 -Ryan

 --
 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: Ordering alphabetical in secondary select string

2004-05-13 Thread Joe Parish
Can you combine the queries?

Take the following example, given that there is a table post and there is a
table sprite. The post table contains several fields including a SPRITEID
field whos value corresponds directly the unique identifier of the same name
(SPRITEID) in the sprite table. The sprite table also contains a SPRITENAME
field that corresponds to the relative path of an image file.

Select post.POSTID, post.SPRITEID, sprite.SPRITENAME, sprite.SPRITEID
from  post, sprite where post.SPRITEID = sprite.SPRITEID order by
sprite.SPRITENAME desc;

I have this table here and these are the first few results:

'post.POSTID',' post.SPRITEID', 'sprite.SPRITENAME',
'sprite.SPRITEID'
'245', '21', '..\..\graphical
dump\esd\wizardjames.gif','21'
'252', '21', '..\..\graphical
dump\esd\wizardjames.gif','21'
'188', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'216', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'220', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'228', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'232', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'233', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'238', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'242', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'243', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'248', '13', '..\..\graphical
dump\esd\trevor.gif', '13'
'183', '10', '..\..\graphical
dump\esd\stew.gif','10'
'202', '10', '..\..\graphical
dump\esd\stew.gif','10'
'208', '10', '..\..\graphical
dump\esd\stew.gif','10'
'213', '10', '..\..\graphical
dump\esd\stew.gif','10'

If you really want, look at the attatched txt file to see the full
results.

This is from a silly news poster/CMS type thing I wrote called ESDNews

I hope that helps you to work it out, if I'm understanding the question
correctly.

Joe Parish


R.G. Vervoort [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 it are different table and the first table does not contain names, onlu
the
 id form names.

 Ordering ASC woll not work because it is not in the first query

 thank for thinking with me anyway
 Dennis Biletsky [EMAIL PROTECTED] schreef in bericht
 news:[EMAIL PROTECTED]
 
  R.G. Vervoort [EMAIL PROTECTED] ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ ×
ÎÏ×ÏÓÔÑÈ
  ÓÌÅÄÕÀÝÅÅ: news:[EMAIL PROTECTED]
  
  
  
  
   Does anyone have a suggestion how I can order a list with names in a
   secondary select string.
  
  
  
   The first string selects a number of locations where people work
  
  
  
   From this string I get several id's form people (in the location table
  there
   are no names but id's form the people table) that work on those
 locations
  
  
  
   No I make another select to get the name form the people table using
the
  id
   I got before.
  
  
  
   I would like to have the table ordered alphabetical by the name of the
   people
  
  
  
   Since the number op people is very long is will be to slow working the
  other
   way around (first selecting people and then  looking for the location)
  
  
  
   Example:
  
  
  
   Location 1Name A
  
   Name B
  
   Name C
  
   Location 3Name D
  
   Name E
  
   Location 5Name F
  
   Location 2Name G
  
   Location 9Name H
  
   Location 7Name I
  
  
  
  
  
  
  
  
  ORDER BY name ASC
 
 



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



[PHP] updating pdf

2004-05-13 Thread mserra
hi,

I'm working on a project and i need to modify some pdf files before
printing them.

In fact, i got some pdf models, and a database which contains informations
to print. I want to add this informations in pdf files and then start
printing. My problem at this time is that i don't find any free class or
module that allow that. I know that it's possible to do it with pdflib or
clibpdf but you must pay to use them commercially.

Can you please tell me if you know something that could be used in php to
do it freely.

Thanks,

Marc.

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



RE: [PHP] updating pdf

2004-05-13 Thread Jay Blanchard
[snip]
I'm working on a project and i need to modify some pdf files before
printing them.

In fact, i got some pdf models, and a database which contains
informations
to print. I want to add this informations in pdf files and then start
printing. My problem at this time is that i don't find any free class or
module that allow that. I know that it's possible to do it with pdflib
or
clibpdf but you must pay to use them commercially.

Can you please tell me if you know something that could be used in php
to
do it freely.
[/snip]

http://us2.php.net/pdf 

Is everyone familiar with the search function on php.net?

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



RE: [PHP] php and bugport problem

2004-05-13 Thread Jay Blanchard
[snip]
Hello,  I have installed bugport (it is a bug tracking tool (web based
interface), for developers , testers , QA  to report bugs and track them
through out the whole development life cycle, it uses php as its
language , the link is
http://www.incogen.com/index.php?type=Generalparam=bugport ) exactly
the same way as instructed in the installation notes Yet when I try :
http://localhost/bugport/index.html it redirects me to
http://localhost/bugport/php/index.php and this what should happen , yet
I get this .. here is index.php (I didn't change
anything)
[/snip]

And your question is? http://catb.org/~esr/faqs/smart-questions.html

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



RE: [PHP] Saving and mailing remote file

2004-05-13 Thread Jay Blanchard
[snip]
Could one of you help me in saving the remote file to the local
webserver? 
[/snip]

Can you be more clear here? There is a file on a remote server that you
want to save locally? 

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



RE: [PHP] updating pdf

2004-05-13 Thread Chris Hayes
At 14:48 13-5-04, you wrote:
[snip]
Can you please tell me if you know something that could be used in php
to
do it freely.
[/snip]
http://us2.php.net/pdf

Is everyone familiar with the search function on php.net?
#Jay: ain't that the one that you have to pay for for commercial use?

#Marc:
www.fpdf.org and www.ros.co.nz are free pdf classes. I did not understand 
your problem well enough to know whether or not they could be of use to you.

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


Re: [PHP] updating pdf

2004-05-13 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote:
hi,

I'm working on a project and i need to modify some pdf files before
printing them.
In fact, i got some pdf models, and a database which contains informations
to print. I want to add this informations in pdf files and then start
printing. My problem at this time is that i don't find any free class or
module that allow that. I know that it's possible to do it with pdflib or
clibpdf but you must pay to use them commercially.
Can you please tell me if you know something that could be used in php to
do it freely.
Thanks,

Marc.

I think if you put some markup (e.g. [[TITLE]]) in a pdf file and save 
the file without compression you can simple replace the markup with the 
content from database

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


[PHP] Trouble with using isset and form posting

2004-05-13 Thread Tom Chubb
I think I'm missing something here really obvious!
I am using a script where you get a variable from one page and post to
another.
I've just realised that some people are jumping straight to the second page
(it rates higher in search engines) so the variable (yourname) remains
unset.
I want to use isset so that if there is no variable the field is pre-filled
to prompt for Your Name?

A simplified version of the code is shown below and is posting to itself.
Any idea what I'm doing wrong?

Thanks in advance,

Tom


?PHP
if(!isset($_GET['realname'])) {
$realname = 'Your Name';
}
?
html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body
form name=form1 method=post action=testform.php
  Please Enter
  input name=guest1 type=text  value=?php print $realname; ?
  input type=submit name=Submit value=Submit
/form
/body
/html

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



RE: [PHP] Trouble with using isset and form posting

2004-05-13 Thread Jay Blanchard
[snip]
A simplified version of the code is shown below and is posting to
itself.
Any idea what I'm doing wrong?
?PHP
if(!isset($_GET['realname'])) {
$realname = 'Your Name';
}
?
html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body
form name=form1 method=post action=testform.php
  Please Enter
  input name=guest1 type=text  value=?php print $realname; ?
  input type=submit name=Submit value=Submit
/form
/body
/html
[/snip]


I tried this (navigated directly to the page) and it worked. You
probably want to set the GET array thingie though...like this

?php
if(!isset($_GET['realname'])) {
$_GET['realname'] = 'Your Name';
}
?

And use 
  input name=guest1 type=text  value=?php print
$_GET['realname']; ?

so that the realname value gets outputted no matter what

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



Re: [PHP] HTTP_RAW_POST_DATA

2004-05-13 Thread Marek Kilimajer
Michal Migurski wrote:
Isn't this potentially a DoS attack vector anyway? I don't need a server
to accept or read my obscenely long POST requests to clog the pipes with
them. Would the proper way to handle this risk be to disallow POST at the
webserver level, or does turning always_populate_raw_post_data off cause
the connection to be automatically dropped after Connection: close?
By default php streams the STDIN to a file so your just dealing with
buffer sized ~2K-4K.  enabling this option makes php put the contents
into memory, thus leaving open the possiblity of someone using up all
your memory and bringing the machine to a standstill till, then when
swap space runs out.. watch out! :)


This makes sense, thanks.

Does not make sense to me.

PHP must read the whole post stream to create $_POST and $HTTP_POST_VARS 
arrays, and to save file uploads into a temporary files. This happens 
before the script is executed.

$HTTP_RAW_POST_DATA is just another variable occupying memory, and is 
not needed in 99.% of cases. It would make it more likely to hit php 
memory limit. Thus the option.

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


[PHP] Antwort: RE: [PHP] Saving and mailing remote file

2004-05-13 Thread Sascha Meyer
Hi again,

I need to download a remote file (e.g. some linked pdf document on another 
server) and send this file to a defined user.
I don't know if there is a way to attach a remote file to an email (I 
don't want to send a link to the above mentioned file, but the file 
itself...)

Sascha

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



[PHP] RE: Antwort: RE: [PHP] Saving and mailing remote file

2004-05-13 Thread Jay Blanchard
[snip]
I need to download a remote file (e.g. some linked pdf document on
another 
server) and send this file to a defined user.
I don't know if there is a way to attach a remote file to an email (I 
don't want to send a link to the above mentioned file, but the file 
itself...)
[/snip]

You cannot attach a linked file to an e-mail. You would have to download
the file to a machine local to you and then attach it to the e-mail

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



Re: [PHP] Antwort: RE: [PHP] Saving and mailing remote file

2004-05-13 Thread Burhan Khalid
Sascha Meyer wrote:
Hi again,

I need to download a remote file (e.g. some linked pdf document on another 
server) and send this file to a defined user.
I don't know if there is a way to attach a remote file to an email (I 
don't want to send a link to the above mentioned file, but the file 
itself...)
No, there is no way that I know of to attach the remote file.  You'd 
have to download it first then attach it.

wget the file, its a lot easier than opening sockets.

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


[PHP] Re: Antwort: RE: [PHP] Saving and mailing remote file

2004-05-13 Thread AcZ
Sascha Meyer wrote:
Hi again,

I need to download a remote file (e.g. some linked pdf document on another 
server) and send this file to a defined user.
I don't know if there is a way to attach a remote file to an email (I 
don't want to send a link to the above mentioned file, but the file 
itself...)

Sascha
Hi,

I think you can use fopen and save the file on the server and than send 
this file attached..

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


[PHP] Antwort: RE: Antwort: RE: [PHP] Saving and mailing remote file

2004-05-13 Thread Sascha Meyer
Hi Jay,

that's exactly what I need to accomplish (as I mentioned: I wanted to 
download the file to the webserver - which means saving the file locally, 
cause that's where the script resides - and then send it to the email 
recipient).

I need to find a way to download the file itself, the rest is - as I said 
before - fairly simple (attaching the file to a mail will be handled by 
the Mail class).

Anyway, thanks for your time!

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



[PHP] Re: PHP5 - instanceof

2004-05-13 Thread Greg Beaver
Martin Towell wrote:
I have been playing with PHP5 and am liking it more and more. But I have one
question about instanceof
If you have something like this:

?
class A { }
class B extends A { }
$x = new B;
if ($x instanceof B)  echo B;
if ($x instanceof A)  echo A;
?
This would echo BA. That's good, I understand that.

Now the question: Is it possible to determine if B is an instance of A
without instantiating it?
Thanks
Martin
Hi Martin,

Reflection is your friend.

?php
class A { }
class B extends A { }
$x = new Reflection_Class('B');
print_r($x);
?
Greg
--
phpDocumentor
http://www.phpdoc.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ADS authentication

2004-05-13 Thread Kuldeep Singh Tomar
Hi Ray,

Finally I am able to authenticate my user to ADS using php. Thanks for 
your suggestions. My bind_dn was not  correct. After that I have 
searched and found that using anonymous user we can not search in 
subtree of directory server. So first I used my credential to bind to 
directory server and then doing search in subtree.

If anybody need my help, I can provide him the code(offlist).

Cheers,

Kuldeep

Ray Hunter wrote:

On Tue, 2004-05-11 at 09:16, Kuldeep Singh Tomar wrote:
 

Hi,

Sorry for it. Can I get some help on this?
   

Here is what i used to query Exchange...now i am no windowz guru, but
from what i understand about exchange and ads exchange will send user
information to ads to be authenticated. So my work around was to all
user to authenticate against exchange ldap, which in turn sends it to
ads.
Just a note if the ldap can bind with the supplied username and password
then they were authenticated for their information.
--
Ray
Example:

?php
// LDAP variables
$ldap[user] = uname;
$ldap[pass] = password;
$ldap[host] = ldap.example.com;
$ldap[port] = 389;
$ldap[dn]   = cn.$ldap[user].,ou=Department,o=Company Name;
$ldap[base] = ;
// connecting to ldap
$ldap[conn] = ldap_connect( $ldap[host], $ldap[port] )
   or die( Could not connect to server {$ldap[host]} );
// binding to ldap
$ldap[bind] = ldap_bind( $ldap[conn], $ldap[dn], $ldap[pass] );
if( !$ldap[bind] )
{
   echo ldap_error( $ldap[conn] );
   exit;
}
// search for the user on the ldap server and return all
// the user information
$ldap[result] = ldap_search( $ldap[conn], $ldap[base], uid=.$ldap[user] );


if( $ldap[result] )
{
   // retrieve all the entries from the search result
   $ldap[info] = ldap_get_entries( $ldap[conn], $ldap[result] );
}
else
{
   echo ldap_error( $ldap[conn] );
   exit;
}

if( $ldap[info] )
{
   // Add the users department name and email address
   // to the session
   $_SESSION[userdept] = $ldap[info][0][department][0];
   $_SESSION[usermail] = $ldap[info][0][mail][0];
}
else
{
   echo ldap_error( $ldap[conn] );
   exit;
}
// close connection to ldap server
$ldap_close( $ldap[conn] );
?

 



--
Kuldeep Singh Tomar
Open Source Specialist
VCLABS
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ADS authentication

2004-05-13 Thread Ray Hunter
On Thu, 2004-05-13 at 08:36, Kuldeep Singh Tomar wrote:
 Finally I am able to authenticate my user to ADS using php. Thanks for 
 your suggestions. My bind_dn was not  correct. After that I have 
 searched and found that using anonymous user we can not search in 
 subtree of directory server. So first I used my credential to bind to 
 directory server and then doing search in subtree.

Good to hear...glad you got it working!

--
Ray

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



RE: [PHP] Saving and mailing remote file

2004-05-13 Thread Oliver Hankeln
Sascha Meyer wrote:

 Hi Jay,

 that's exactly what I need to accomplish (as I mentioned: I wanted to 
download the file to the webserver - which means saving the file 
locally, cause that's where the script resides - and then send it to the 
email recipient).

 I need to find a way to download the file itself, the rest is - as I 
said before - fairly simple (attaching the file to a mail will be 
handled by the Mail class).

 Anyway, thanks for your time!

If the remote file has a URL eg. http://foo.com/bar.pdf you can simply 
open it using fopen()

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


[PHP] MySQL backup

2004-05-13 Thread Matthew Oatham
Hi,

I am using MySQL database accessed via myphp admin - there is an export option which 
allows me to export the structure and data to an sql file but this is a manual 
procedure is there anyway to automate this via myphp admin i.e. using a cron job?

Thanks

Re: [PHP] Variables Help

2004-05-13 Thread John W. Holmes
From: Steve Douville [EMAIL PROTECTED]

 ?
 $a = yes;
 $b = no;
 ?

 Is there a variable that I can call that will return an array with any
 variables I have set? I'd want to call it and then parse and display
current
 values of, in this case, a and b. Hope that makes sense.

Like something that Returns an array of all defined variables??

http://us2.php.net/get_defined_vars

---John Holmes...

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



Re: [PHP] MySQL backup

2004-05-13 Thread John W. Holmes
From: Matthew Oatham [EMAIL PROTECTED]

 I am using MySQL database accessed via myphp admin -
 there is an export option which allows me to export the structure
 and data to an sql file but this is a manual procedure is there
 anyway to automate this via myphp admin i.e. using a cron job?

The mysqldump program in the mysql/bin folder is used for this. Make a call
to it through cron or a PHP script.

---John Holmes...

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



[PHP] Re: [PHP-DB] php-mysql problem

2004-05-13 Thread Jianping Zhu
Hi, thank you for your respinse.

It the /etc/php.ini i have something like:

;
;   extension=modulename.extension
;
; For example:
;
   extension=mysql.so

if you go to 
http://coopunit.forestry.uga.edu:8080/test.php
you will find mysql is not installed as an extension.

but i do not know how to fix this problem.

Do i have to recomplie the phd from source code?

Thanks
JP

On Thu, May 13, 2004 at 07:24:28PM +0200, Stefan Dengscherz wrote:
 hello,
 
 did you load the mysql module in your php.ini configuration file?
 i.e. is the following line there:
 extension=mysql.so
 
 regards
 
 On Thu, 13 May 2004 11:47:41 -0400
 Jianping Zhu [EMAIL PROTECTED] wrote:
 
   have redhat 9.0 and Server version: Apache/2.0.40.
i have installed rpms php-4.2.2-17.2.i386.rpm
 php-mysql-4.2.2-17.2.i386.rpm
  
  
 After i create a database called mydb and serveral tables in mysql,
 I tried to run following testdb.php script
  
  
 --
 html
 body
 ?php
 $db = mysql_connect(localhost, root,xx);
 mysql_select_db(mydb,$db);
 $result = mysql_query(SELECT * FROM employees,$db);
 printf(First Name: %sbr\n, mysql_result($result,0,first));
 printf(Last Name: %sbr\n, mysql_result($result,0,last));
 printf(Address: %sbr\n, mysql_result($result,0,address));
 printf(Position: %sbr\n, mysql_result($result,0,position));
 ?
 /body
 /html
 ---
  
 but i got error message with:
 http://coopunit.forestry.uga.edu:8080/testdb.php
 the error is:
 Fatal error: Call to undefined function:
 mysql_connect() in /var/www/html/testdb.php on line 13
  
 How can Fix this problem? Thanks
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 -- 
 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] php-mysql problem

2004-05-13 Thread Jianping Zhu
Thank you for your response.
I get the php rpm distributed with redhat 9.0. 
Do I have to recompile phd instead from source code with mysql support?

Thanks



On Thu, May 13, 2004 at 06:15:23PM +0200, Oliver Hankeln wrote:
 Hello,
 
 [snip]
 
but i got error message with:
http://coopunit.forestry.uga.edu:8080/testdb.php
the error is:
Fatal error: Call to undefined function:
mysql_connect() in /var/www/html/testdb.php on line 13
 
How can Fix this problem? Thanks
 
 [/snip]
 
 
 Your PHP is compiled without mysql support (see 
 http://coopunit.forestry.uga.edu:8080/test.php) You do however have dbx 
 support. You might want to look at http://de.php.net/manual/de/ref.dbx.php
 Your mysql_connect has to be replaced by dbx_connect and so on...
 Alternativly you could recompile php with mysql support.
 
 HTH,
 Oliver Hankeln
 
 -- 
 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] Variables Help

2004-05-13 Thread Steve Douville
?
$a = yes;
$b = no;
?

Is there a variable that I can call that will return an array with any
variables I have set? I'd want to call it and then parse and display current
values of, in this case, a and b. Hope that makes sense.

TIA


Re: [PHP] Variables Help

2004-05-13 Thread Adrian
$GLOBALS

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



Re: [PHP] Variables Help

2004-05-13 Thread Richard Davey
Hello Steve,

Thursday, May 13, 2004, 6:19:07 PM, you wrote:

SD Is there a variable that I can call that will return an array with any
SD variables I have set? I'd want to call it and then parse and display current
SD values of, in this case, a and b. Hope that makes sense.

get_defined_vars();

-- 
Best regards,
 Richard Davey
 http://www.launchcode.co.uk / PHP Development Services
 http://www.phpcommunity.org/wiki/296.html / PHP Community

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



RE: [PHP] site search engine.. not dynamic

2004-05-13 Thread James Tusini
you could try php dig as well as htdig

-Original Message-
From: Aaron Wolski [mailto:[EMAIL PROTECTED]
Sent: 13 May 2004 01:25
To: 'PHP-General'
Subject: [PHP] site search engine.. not dynamic


Hi all,
 
Can anyone point me in the direction of a site search engine that reads
files in a directory find relevant results for an search term that a
person might enter on a site?
 
I need to build a site search engine but the problem is. the site isn't
dynamic (yet) so I need to read actual files to pull things together.
 
Anything out there?
 
Thanks!
 
Aaron
 

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



Re: [PHP] MySQL backup

2004-05-13 Thread Matthew Oatham
Mmmm my provider doesn't give me access to this area !

- Original Message - 
From: John W. Holmes [EMAIL PROTECTED]
To: Matthew Oatham [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 6:40 PM
Subject: Re: [PHP] MySQL backup


 From: Matthew Oatham [EMAIL PROTECTED]

  I am using MySQL database accessed via myphp admin -
  there is an export option which allows me to export the structure
  and data to an sql file but this is a manual procedure is there
  anyway to automate this via myphp admin i.e. using a cron job?

 The mysqldump program in the mysql/bin folder is used for this. Make a
call
 to it through cron or a PHP script.

 ---John Holmes...

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



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



Re: [PHP] Variables Help

2004-05-13 Thread John Nichel
John W. Holmes wrote:
From: Steve Douville [EMAIL PROTECTED]

?
$a = yes;
$b = no;
?
Is there a variable that I can call that will return an array with any
variables I have set? I'd want to call it and then parse and display
current

values of, in this case, a and b. Hope that makes sense.


Like something that Returns an array of all defined variables??

http://us2.php.net/get_defined_vars

---John Holmes...

Imagine that. ;)

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MySQL backup

2004-05-13 Thread John Nichel
Matthew Oatham wrote:
Hi,

I am using MySQL database accessed via myphp admin - there is an export option which allows me to export the structure and data to an sql file but this is a manual procedure is there anyway to automate this via myphp admin i.e. using a cron job?

Thanks
Use a cron and call the mysqldump command...

http://dev.mysql.com/doc/mysql/en/mysqldump.html

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php-mysql problem

2004-05-13 Thread John Nichel
Jianping Zhu wrote:
Thank you for your response.
I get the php rpm distributed with redhat 9.0. 
Do I have to recompile phd instead from source code with mysql support?

Thanks
You need to install the php-mysql rpm.  It will be on one of your Red 
Hat Discs.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MySQL backup

2004-05-13 Thread John Nichel
Matthew Oatham wrote:
Mmmm my provider doesn't give me access to this area !
To what area?  mysqldump, or cron?

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MySQL backup

2004-05-13 Thread John W. Holmes
From: Matthew Oatham [EMAIL PROTECTED]
   I am using MySQL database accessed via myphp admin -
   there is an export option which allows me to export the structure
   and data to an sql file but this is a manual procedure is there
   anyway to automate this via myphp admin i.e. using a cron job?
 
  The mysqldump program in the mysql/bin folder is used for this. Make a
  call to it through cron or a PHP script.

 Mmmm my provider doesn't give me access to this area !

I would double check and ask them about that, but if that's really the
situation, then look on phpclasses.org or hotscripts.com for a script that
emulates mysqldump.

Or, not sure on this one, see if you can just get a copy of the program and
place it in one of your own directories to run. It comes with MySQL.

---John Holmes...

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



Re: [PHP] Webcapture to PDF

2004-05-13 Thread James E Hicks III
On Thursday 13 May 2004 11:59 am, Ashley M. Kirchner wrote:
 Looking for a (open source) solution here: is there some way that I
 can convert an already existing HTML page to a PDF file, by means of a
 script (on a unix box)?  What I'd like to do is have a button on all of
 our pages that, when clicked on, will perform a capture of that page,
 including all images, convert to PDF, and serve it back to the user's
 browser.  I don't just want what the user's viewing (I doubt that's
 possible anyway from a server-side point.)  I want a full page capture,
 and then converted.

This is how I do it. (Warning this is psuedo-code!)

http://user.it.uu.se/~jan/html2ps.html
http://www.ps2pdf.com/convert/index.htm

?php
system (html2ps http://taget.system.com/target.html;);
system (ps2pdf target.ps);
echo (META HTTP-EQUIV=\refresh\ content=\1; URL=target.pdf\);
?

James Hicks

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



[PHP] PHPSESSID Being Stubbornly Persistent

2004-05-13 Thread Monty
I have the following lines in a PHP script:

ini_set('session.save handler','user');
ini_set('session.use_cookies', '1');
ini_set('session.use_only_cookies', '1');
ini_set('session.cookie_lifetime', '0');
ini_set('session.use_trans_sid', '0');

I do not want the Session ID to be passed via the URL, however, even with
the above lines in my script, PHP is still appending the Session ID and code
to the end of all URLs on the first page visited in the site. All pages
after that, however, do not have the Session ID appended to all URLs, just
the first page visited.

I have PHP 4.3.2 installed on a RedHat Linux ES 3.0 server. Is there
anything I can do to prevent this from happening?

Monty

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



Re: [PHP] Variables Help

2004-05-13 Thread Monty

 Is there a variable that I can call that will return an array with any
 variables I have set? I'd want to call it and then parse and display
 current
 values of, in this case, a and b. Hope that makes sense.
 
 Like something that Returns an array of all defined variables??
 
 http://us2.php.net/get_defined_vars
 
 ---John Holmes...

Is there any way to get JUST the user-defined variables in PHP? Problem with
get_defined_vars() is that it contains everything, including server and
environment vars, and there's no easy way to keep just the user-defined vars
part of the array created by get_defined_vars.

Monty

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



[PHP] Error Passing Command in URL

2004-05-13 Thread Dragon
Hi,

I have a Calendar Script for my Clan,
but I didn't getting it to work.

You can See my Script under
www.knallepuff.de/calendar

If I/You try to open the Admin-Sektion ?open=admin
Nothing happens, you will only reload the main view.

This Script ist working on many other Server, but not on mine.
I use a Apache2 under FedoraCore1.

I've tried to disable the Safe Mode unter the Directory Options in Apache,
but no Effect (nor Positive or Negative).


Thanks for all Input.

Jan

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



Re: [PHP] PHPSESSID Being Stubbornly Persistent

2004-05-13 Thread Matt Matijevich
[snip]
ini_set('session.use_trans_sid', '0');
[/snip]


I think, at least according to the manual

session.use_trans_sid can only be set in php.ini, .htaccess or
httpd.conf

http://www.php.net/ini_set look at  session.use_trans_sid

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



[PHP] Re: Error Passing Command in URL

2004-05-13 Thread Jason Barnett
We'll probably need source code to help you out with this.

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


Re: [PHP] Variables Help

2004-05-13 Thread John Nichel
Monty wrote:
Is there any way to get JUST the user-defined variables in PHP? Problem with
get_defined_vars() is that it contains everything, including server and
environment vars, and there's no easy way to keep just the user-defined vars
part of the array created by get_defined_vars.
Monty

foreach ( get_defined_vars() as $key = $val ) {
	if ( ! preg_match ( 
/_POST|_GET|_COOKIE|_SERVER|_ENV|_FILES|_REQUEST|_SESSION/, $key ) ) {
		$user_defined[$key] = $val;
	}
}

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Variables Help

2004-05-13 Thread Jason Barnett
Is there any way to get JUST the user-defined variables in PHP? Problem with
get_defined_vars() is that it contains everything, including server and
environment vars, and there's no easy way to keep just the user-defined vars
part of the array created by get_defined_vars.
Monty
Why not just unset the variables you don't want in the list?

?php

$uservars = get_defined_vars();
unset ($uservars['_SERVER']);
unset ($uservars['_ENV']);
// etc.
?

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


Re: [PHP] Variables Help

2004-05-13 Thread John W. Holmes
From: Monty [EMAIL PROTECTED]
  Is there a variable that I can call that will return an array with any
  variables I have set? I'd want to call it and then parse and display
  current
  values of, in this case, a and b. Hope that makes sense.
 
  Like something that Returns an array of all defined variables??
 
  http://us2.php.net/get_defined_vars
 
  ---John Holmes...

 Is there any way to get JUST the user-defined variables in PHP? Problem
with
 get_defined_vars() is that it contains everything, including server and
 environment vars, and there's no easy way to keep just the user-defined
vars
 part of the array created by get_defined_vars.

?php
$starting_vars = get_defined_vars();

//bunch of PHP code...

$current_vars = get_defined_vars();

$user_defined_vars = array_diff($current_vars,$starting_vars);

...

---John Holmes...

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



[PHP] Re: PHPSESSID Being Stubbornly Persistent

2004-05-13 Thread Jason Barnett
Out of curiosity, how were you planning on passing session id's? 
Through POST variables?

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


Re: [PHP] Variables Help

2004-05-13 Thread John Nichel
John W. Holmes wrote:
?php
$starting_vars = get_defined_vars();
//bunch of PHP code...

$current_vars = get_defined_vars();

$user_defined_vars = array_diff($current_vars,$starting_vars);

...

---John Holmes...

This cat is skinned. :)

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHPSESSID Being Stubbornly Persistent

2004-05-13 Thread Matt Matijevich
[snip]
Out of curiosity, how were you planning on passing session id's? 
Through POST variables?
[/snip]

I would guess cookie.

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



[PHP] OnClick handler to show PDF

2004-05-13 Thread Todd Cary
Currently, I have a Link to show a PDF file

? print('Click a href=' . $url . $sfyc_race_schd_send . ' Name=Race 
Schedule Target=_blankhere/a to open the Race Schedule'); ?

I want to replace it with a button and an OnClick()

?
  print('input type=button name = View Schedule OnClick=');
?
I cannot get the syntax correct for the OnClick.  Is this the best way 
to use a button for the task?

Todd

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


Re: [PHP] OnClick handler to show PDF

2004-05-13 Thread John Nichel
Todd Cary wrote:
Currently, I have a Link to show a PDF file

? print('Click a href=' . $url . $sfyc_race_schd_send . ' Name=Race 
Schedule Target=_blankhere/a to open the Race Schedule'); ?

I want to replace it with a button and an OnClick()

?
  print('input type=button name = View Schedule OnClick=');
?
I cannot get the syntax correct for the OnClick.  Is this the best way 
to use a button for the task?

Todd

Since this is a PHP mailing list, my JavaScript may be a bit off

input type=button name=View Schedule 
onClick=JavaScript:document.location=?php echo ( $url ); ? /

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] OnClick handler to show PDF

2004-05-13 Thread John Nichel
John Nichel wrote:
Todd Cary wrote:

Currently, I have a Link to show a PDF file

? print('Click a href=' . $url . $sfyc_race_schd_send . ' 
Name=Race Schedule Target=_blankhere/a to open the Race 
Schedule'); ?

I want to replace it with a button and an OnClick()

?
  print('input type=button name = View Schedule OnClick=');
?
I cannot get the syntax correct for the OnClick.  Is this the best way 
to use a button for the task?

Todd

Since this is a PHP mailing list, my JavaScript may be a bit off

input type=button name=View Schedule 
onClick=JavaScript:document.location=?php echo ( $url ); ? /

And it was off

input type=button name=View Schedule 
onClick=JavaScript:document.location=?php echo ( $url ); ? /

Damn adding extra quotes.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] references

2004-05-13 Thread Vladislav Shulgin
Hi!

I found that when I try to call class method addchild from reference of
object - php change not original object. New copy of object will created.

Very strange

Example:
?
class pages {
 var $childs;
 var $absnum;
 function pages($absnum) {
  $this-absnum = $absnum;
 }
 function addchild($node) {
  if (!is_array($this-childs))
   $this-childs = array();
  $this-childs[$node-absnum] = $node;
 }
}

$allpages = new pages(0);
$allrows = array();
$allrows[0] = $allpages;

$allrows[2] = new pages(2);
$allrows[0]-addchild($allrows[2]);

$allrows[3] = new pages(3);
$allrows[0]-addchild($allrows[3]);

$allrows[4] = new pages(4);
$allrows[3]-addchild($allrows[4]);

// This is data of object $allrows[3]
echo 'pre';
print_r($allrows[3]);

echo '/pre';

// But in global array element $allrows[3] have another value
echo 'pre';
print_r($allpages);
echo '/pre';
?

Any ideas?

Thanks

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



[PHP] Socket looping challenge

2004-05-13 Thread René Fournier
Hi all,

Still encountering some challenges with my socket loop. Basically, I  
need this socket client to wait to read incoming data, but if nothing  
happens for more than three seconds, I want it to do something, then  
return to waiting (for another three seconds). I've got some good help  
from Curt and Tom (thanks guys), but there are evidently still issues  
with my code. Here's simplified snippet:

 
-
CODE
 
-
// INFINITE LOOP

$msg_recv = false;
$timeout = array('sec' = 3, 'usec' = 0);
socket_set_block($socket);
socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
do {
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
$data .= $buf;
if(preg_match(/ENX/,$data)) {
$msg_recv = true;
break;
} elseif ($error = socket_last_error($socket)) {
$msg_recv = false;
echo \nTIMEOUT: SOCKET ERROR [$error]: . 
socket_strerror($error);
break;
}
}
	if ($msg_recv == true) {

echo \nMESSAGE RECEIVED\n;
$msg_recv = false;

} else {
echo \nTIMEOUT: MESSAGE NOT RECEIVED\n;
$msg_recv = false;

}
$data = ;

} while ($connection == true);
 
-
OUTPUT
 
-
MESSAGE RECEIVED

MESSAGE RECEIVED
PHP Warning:  socket_read() unable to read from socket [35]: Resource  
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on  
line 61

Warning: socket_read() unable to read from socket [35]: Resource  
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on  
line 61

TIMEOUT: MESSAGE NOT RECEIVED
PHP Warning:  socket_read() unable to read from socket [35]: Resource  
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on  
line 61

Warning: socket_read() unable to read from socket [35]: Resource  
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on  
line 61

TIMEOUT: MESSAGE NOT RECEIVED

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


RE: [PHP] dinamic hashes

2004-05-13 Thread Ford, Mike [LSS]
On 13 May 2004 12:59, Yivi wrote:

 Hello everyone.
 I am having a stupid problem with a couple of arrays, tried a
 couple of
 things but I am feeling disconcerted.
 
 The thing is, I thought it was possible to create arrays in a dynamic
 fashion, as in: $newarray['newkey'] = new_value;
 And the array would be incremented accordingly.
 And afterwards, if I wanted to add a new key to the thing, just doing:
 $newarray['anotherkey'] = anothervalue; would be enough.
 Generally speaking I have been trying that and it was
 working, but right
 now I am having some trouble with this.
 
 I am parsing a kind of referrals log file, and as I get the values I
 want to create  a hash with all the values I get into a hash to use
 later on. 
 
 Each line of the log is processed in a while() loop, and after
 extracting the values for $searchSource, $searchDomain and
 $searchTerm I try to create the hash entries with these lines:
 
 $table[$searchSource][$searchDomain][$searchTerm][total
 ]+=$row['order_total'];
 $table[$searchSource][$searchDomain][$searchTerm][count]++;

Your problem here is that you are using the += and ++ operators, which need
to fetch the existing value of your array element before adding to or
incrementing them.  Of course, the *first* time you attempt to do this the
array element doesn't exist yet, so PHP throws a notice for each of the
subscripts; subsequent additions to or increments of the same elements will
proceed without problem.
 
 total is an amount that I want to aggregate for each $seachTerm, and
 count an obvious counter with total hits per
 $searchTerm/Domain/Source
 combination. $table is an array which I create before
 entering the loop
 with: $table = array();

This is irrelevant and, strictly speaking, unnecessary.
 
 The problem is that I keep getting this warnings and notices:
 Notice: Undefined index: GGAW in
 c:\www\deepswarm.co.uk\script\monthlytable.php on line 60

[...]

 Using the @ operator the scripts works perfectly, but I

That's one of the obvious ways to suppress these notices.  Others are to
turn off E_NOTICE level messages for the duration, or use isset() on each
access to decide whether to do a plain assignment or use an
increment/addition.

BTW, all those quotes are unnecessary and inefficient -- just write your
array accesses like this:

$table[$searchSource][$searchDomain][$searchTerm][count]

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] Variables Help

2004-05-13 Thread Jason Barnett
?php
$starting_vars = get_defined_vars();
//bunch of PHP code...

$current_vars = get_defined_vars();

$user_defined_vars = array_diff($current_vars,$starting_vars);

...

---John Holmes...
Oh I like that... wish I would have suggested that one!

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


Re: [PHP] OnClick handler to show PDF

2004-05-13 Thread Todd Cary
You were close enough...this works:

input type=button value=View Schedule 
onClick=JavaScript:document.location='?php echo ( $url . 
$sfyc_race_schd_send ); ?'

The next challenge is to create a new window and display the file.

Todd

John Nichel wrote:

Todd Cary wrote:

Currently, I have a Link to show a PDF file

? print('Click a href=' . $url . $sfyc_race_schd_send . ' 
Name=Race Schedule Target=_blankhere/a to open the Race 
Schedule'); ?

I want to replace it with a button and an OnClick()

?
  print('input type=button name = View Schedule OnClick=');
?
I cannot get the syntax correct for the OnClick.  Is this the best way 
to use a button for the task?

Todd

Since this is a PHP mailing list, my JavaScript may be a bit off

input type=button name=View Schedule 
onClick=JavaScript:document.location=?php echo ( $url ); ? /

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


[PHP] accessing $_POST from another page.

2004-05-13 Thread Edward Peloke
I have a page class which controls what happens within a given page.  For
example, the code in my index page is this:

$page=new AdminPage();
$page-action($action);
$page-paint($paint);


The paint and action methods simply set include files

Function action($action){
include_once($this-actionRoot.$action..action.php); }

On my test page, my paint method paints an add client form.  The action of
the add client form recalls the page passing in the action:
action=index.php?action=addNewClient.

So, when this form is submitted, the page is reloaded and
$page-action(addNewClient) is called which includes the
addNewClient.action.php page which simply contains the insert into the
database using the $_POST vars.  The problem is, this page doesn't seem to
have access to the $_POST vars.  To help remedy this, I added this to the
end of the form:

? $posted = base64_encode(serialize($_POST));
echo 'input type=hidden name=posted value='.$posted.'';
?

and added this in my addNewClient.action.php form:
$posted = unserialize(base64_decode($_POST['posted']));

However the $_POST variables only come through after I have clicked submit
twice.  What's the best way to handle this?  Do I simply need to pass in the
$_POST array to my action script?

THanks,
Eddie









 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

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



[PHP] Re: PHPSESSID Being Stubbornly Persistent

2004-05-13 Thread Monty
 From: [EMAIL PROTECTED] (Jason Barnett)
 
 Out of curiosity, how were you planning on passing session id's?
 Through POST variables?

In cookies only.

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



RE: [PHP] Variables Help

2004-05-13 Thread Ford, Mike [LSS]
On 13 May 2004 19:52, John Nichel wrote:

 Monty wrote:
  Is there any way to get JUST the user-defined variables in PHP?
  Problem with get_defined_vars() is that it contains everything,
  including server and environment vars, and there's no easy way to
  keep just the user-defined vars part of the array created by
  get_defined_vars. 
  
  Monty
  
 
 foreach ( get_defined_vars() as $key = $val ) {
   if ( ! preg_match (
 /_POST|_GET|_COOKIE|_SERVER|_ENV|_FILES|_REQUEST|_SESSION/, $key )
   ) { $user_defined[$key] = $val;
   }
 }

U, or even, possibly, if no user variable names begin with _

 if ($key{0}!='_')



Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Reversing a string?

2004-05-13 Thread Kristian Rasmussen
Hi all,

I need a script for reversing a string (hello world becomes dlrow
olleh). I have tried the following:

---
$length = strlen($i);
$g = ;

while ($length  0)
{
   $g = $i[$length] . $g;
  $length--;
}
echo $g;
---

With, obviously, no success. Is this the way or could array_reverse()
somehow be used?

Kristian

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



[PHP] Reversing a string?

2004-05-13 Thread Kristian Rasmussen
Hi all,

I need a script for reversing a string (hello world becomes dlrow
olleh). I have tried the following:

---
$length = strlen($i);
$g = ;

while ($length  0)
{
   $g = $i[$length] . $g;
  $length--;
}
echo $g;
---

With, obviously, no success. Is this the way or could array_reverse()
somehow be used?

Kristian

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



[PHP] Re: Zip-code Form Validation Scripts and Zipcode Program

2004-05-13 Thread Torsten Roehr
Ryan Munevar [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hey Guys,

 Question 1:  Does anyone have a really good php form validation script
 for Zip-codes?

 Question 2:  Does anyone know of a great depository of form validation
 scripts for all kinds of form inputs?

Take a look at PEAR's Validate package:
http://pear.php.net/package/Validate

There is zip code validation for the following countries:
AT, CH, DE, ES, FR, NL, PL, ptBR, UK, US

Regards, Torsten


 Question 3:  Does anyone know (yea I know, getting tedious here) of a
 way or program to check the real distance from one zip-code to another
 zip-code like on yahoo maps?

 Thank you.

 Later,
 Ryan

 P.S.  Man only needs 3 things to survive...  Water, food, and 37 lb.
 of fluid resistant pornography.  Everything else is just semantics.


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



[PHP] Load Data infile

2004-05-13 Thread Juan Pablo Herrera
Hi!
I need do load data infile in mysql:
$query_string2 = LOAD DATA INFILE '/var/www/xls/test' REPLACE INTO TABLE
`test` FIELDS TERMINATED BY ',' ENCLOSED BY '\' ESCAPED BY '\\' LINES
TERMINATED BY '\n';$query_db_string2 = mysql_query($query_string2);
But not realize nothing with execution the script.

Thank you!
Regards!

Juan Pablo

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



[PHP] Re: problem install pws and php

2004-05-13 Thread Torsten Roehr
Lee 03 [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 i am  a beginner for php programming, my OS is win98 while my webserver is
PWS, all is in the same machine,when i try to run my internet explorer( type
in http://localhost/phpinfo.php), phpinfo.php cannot be display.

 i try to reinstall pws and php follow the instrustruction but its still
same problem.

 i hope yours can help me to show whats wrong, thanks for your help


Have you defined a local directory as your web root in PWS and started PWS?

Regards, Torsten

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



Re: [PHP] Reversing a string?

2004-05-13 Thread Robert Cummings
On Thu, 2004-05-13 at 17:27, Kristian Rasmussen wrote:
 Hi all,
 
 I need a script for reversing a string (hello world becomes dlrow
 olleh). I have tried the following:
 
 ---
 $length = strlen($i);
 $g = ;
 
 while ($length  0)
 {
$g = $i[$length] . $g;
   $length--;
 }
 echo $g;

The following will work:

$length = strlen( $i );
$g = ;

while( $length  0 )
{
$g .= $i{--$length};
}
echo $g;

But in all honesty the following is superior:

$g = strrev( $i );
echo $g;

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Re: Reversing a string?

2004-05-13 Thread Kim Steinhaug
Hehe, managed to do it on first try. This should do it :

?php
$string = hello world;
$length = strlen($string);

if($length1){
 $reversed = ;
 for($i=0;$i$length;$i++){
$reversed .= substr($string,$length-$i,1);
 echo substr($string,$length-$i,1) . br;
}
$reversed .= substr($string,0,1);
 echo substr($string,0,1) . br;

 echo $reversed;
} else echo $string;
?

I added some errochecking if the string is only 1 character, since there
should be no use in running the for loop then.

-- 
-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

Kristian Rasmussen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 I need a script for reversing a string (hello world becomes dlrow
 olleh). I have tried the following:

 ---
 $length = strlen($i);
 $g = ;

 while ($length  0)
 {
$g = $i[$length] . $g;
   $length--;
 }
 echo $g;
 ---

 With, obviously, no success. Is this the way or could array_reverse()
 somehow be used?

 Kristian

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



Re: [PHP] Load Data infile

2004-05-13 Thread Matt Matijevich
[snip]
I need do load data infile in mysql:
$query_string2 = LOAD DATA INFILE '/var/www/xls/test' REPLACE INTO
TABLE
`test` FIELDS TERMINATED BY ',' ENCLOSED BY '\' ESCAPED BY '\\' LINES
TERMINATED BY '\n';$query_db_string2 = mysql_query($query_string2);
But not realize nothing with execution the script.
[/snip]

have you checked mysql_error() ?

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



Re: [PHP] Load Data infile

2004-05-13 Thread Juan Pablo Herrera
 [snip]
 I need do load data infile in mysql:
 $query_string2 = LOAD DATA INFILE '/var/www/xls/test' REPLACE INTO
 TABLE
 `test` FIELDS TERMINATED BY ',' ENCLOSED BY '\' ESCAPED BY '\\' LINES
 TERMINATED BY '\n';$query_db_string2 = mysql_query($query_string2);
 But not realize nothing with execution the script.
 [/snip]

 have you checked mysql_error() ?

yes,
You have an error in your SQL syntax near ''' at line 2
but i change '\' and not work.

Thank you,

Juan Pablo

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



[PHP] mysql blob and phpmysqladmin

2004-05-13 Thread Jianping Zhu
I have mysql table call com. One colum of table com will store
user's comments. Because user-provided comment might be too big to fit in char(255), i
use blob. but when i try to see it by use phpmysqladmin, i can only see
something like [BLOB 345 byes] i can not read the text of the comment.

Is there a way to let see the user-provide comments from phpmysqladmin?

Thank

JP

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



[PHP] Re: mysql blob and phpmysqladmin

2004-05-13 Thread Torsten Roehr
Jianping Zhu [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have mysql table call com. One colum of table com will store
 user's comments. Because user-provided comment might be too big to fit in
char(255), i
 use blob. but when i try to see it by use phpmysqladmin, i can only see
 something like [BLOB 345 byes] i can not read the text of the comment.

 Is there a way to let see the user-provide comments from phpmysqladmin?

 Thank

 JP

Why don't you use column type text? This does not have the 255 character
limit.

Regards, Torsten

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



[PHP] Making Printer Friendly files

2004-05-13 Thread Todd Cary
I have a news letter produced by PageMaker that is normally put into PDF 
format so the user can download it.  However, I would like to have a 
Printer Friendly version (no graphics).  Is there a PHP program that can 
take an HTML version and remove the graphics or is there a better way 
with pagemaker?

Todd

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


RE: [PHP] Making Printer Friendly files

2004-05-13 Thread Chris W. Parker
Todd Cary mailto:[EMAIL PROTECTED]
on Thursday, May 13, 2004 3:15 PM said:

 I have a news letter produced by PageMaker that is normally put into
 PDF format so the user can download it.  However, I would like to
 have a Printer Friendly version (no graphics).  Is there a PHP
 program that can take an HTML version and remove the graphics or is
 there a better way with pagemaker?

this is not a php solution so it's a bit offtopic (but i don't really
care... :P)

do it with a different stylesheet.

add the following style to a printer friendly stylesheet:

img {
display: none;
}

your html will stay exactly the same, the only difference is that all
the images will not be displayed.



chris.

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



[PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
I get this output:

PHP Warning:  socket_read() unable to read from socket [35]: Resource 
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on 
line 63

From this code:

do {
socket_set_block($socket);
socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
	[...]

And it's failing at while. Any ideas?

...Rene

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


Re: [PHP] Socket looping challenge

2004-05-13 Thread Tom Rogers
Hi,

Friday, May 14, 2004, 5:21:10 AM, you wrote:
RF Hi all,

RF Still encountering some challenges with my socket loop. Basically, I
RF need this socket client to wait to read incoming data, but if nothing
RF happens for more than three seconds, I want it to do something, then
RF return to waiting (for another three seconds). I've got some good help
RF from Curt and Tom (thanks guys), but there are evidently still issues
RF with my code. Here's simplified snippet:


you need to use break 2; to exit the while and the do - while or set
$connection = false;

-- 
regards,
Tom

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



Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread Daniel Clark
I just read something about sock warnings this morning.   It said
sometimes they drop off, and to ignore the warnings, but capture the
errors.

 I get this output:

 PHP Warning:  socket_read() unable to read from socket [35]: Resource
 temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on
 line 63

  From this code:

 do {
   socket_set_block($socket);
   socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
   while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {

   [...]

 And it's failing at while. Any ideas?

 ...Rene

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



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



Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread raditha dissanayake
#1 cause for socket failures happen to be firewalls.

René Fournier wrote:

I get this output:

PHP Warning:  socket_read() unable to read from socket [35]: Resource 
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on 
line 63

From this code:

do {
socket_set_block($socket);
socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
[...]

And it's failing at while. Any ideas?

...Rene



--
Raditha Dissanayake.
-
http://raditha/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] references

2004-05-13 Thread Tom Rogers
Hi,

Friday, May 14, 2004, 5:10:49 AM, you wrote:
VS Hi!

VS I found that when I try to call class method addchild from reference of
VS object - php change not original object. New copy of object will created.

VS Very strange

VS Example:
VS ?
VS class pages {
VS  var $childs;
VS  var $absnum;
VS  function pages($absnum) {
VS   $this-absnum = $absnum;
VS  }
VS  function addchild($node) {
VS   if (!is_array($this-childs))
VS$this-childs = array();
VS   $this-childs[$node-absnum] = $node;
VS  }
VS }

VS $allpages = new pages(0);
VS $allrows = array();
VS $allrows[0] = $allpages;

VS $allrows[2] = new pages(2);
$allrows[0]-addchild($allrows[2]);

VS $allrows[3] = new pages(3);
$allrows[0]-addchild($allrows[3]);

VS $allrows[4] = new pages(4);
$allrows[3]-addchild($allrows[4]);

VS // This is data of object $allrows[3]
VS echo 'pre';
VS print_r($allrows[3]);

VS echo '/pre';

VS // But in global array element $allrows[3] have another value
VS echo 'pre';
VS print_r($allpages);
VS echo '/pre';
?

VS Any ideas?

VS Thanks


You need the = in the addChild function

function addchild($node) {
  if (!is_array($this-childs))
   $this-childs = array();
  $this-childs[$node-absnum] = $node;
 }

-- 
regards,
Tom

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



Re: [PHP] Socket looping challenge

2004-05-13 Thread René Fournier
The script doesn't even get that first while condition line. It loops 
a few times (while receiving messages), then when no more messages are 
coming from the server, and it times-out, it breaks out of the while, 
then returns to the top again, where it that while condition returns 
the error Warning: socket_read() unable to read from socket [35]: 
Resource temporarily unavailable.

This line...
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== 
false) {
...is what returns the error. The whole loop (which needs to keep 
running).

$msg_recv = 3;
do {
	$data = ;
	socket_set_block($socket);
	socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
	while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {   
 // THIS IS WHERE IT CHOKES
		$data .= $buf;
		if(preg_match(/ENX/,$data)) {
			$msg_recv = 1;
			break;
			} elseif ($error = socket_last_error($socket)) {
			$msg_recv = 0;
			echo \nTIMEOUT: SOCKET ERROR [$error]: . socket_strerror($error);
			break;
			}	
		}

if ($msg_recv == 1) {
echo \nMESSAGE RECEIVED\n;
$msg_recv = 3;
} elseif ($msg_recv == 0) {
echo \nTIMEOUT: MESSAGE NOT RECEIVED\n;
$msg_recv = 3;
}
} while ($connection == true);

And the output:

MESSAGE RECEIVED

MESSAGE RECEIVED
PHP Warning:  socket_read() unable to read from socket [35]: Resource 
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on 
line 64

Warning: socket_read() unable to read from socket [35]: Resource 
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on 
line 64





On Thursday, May 13, 2004, at 04:44 PM, Tom Rogers wrote:

Hi,

Friday, May 14, 2004, 5:21:10 AM, you wrote:
RF Hi all,
RF Still encountering some challenges with my socket loop. Basically, 
I
RF need this socket client to wait to read incoming data, but if 
nothing
RF happens for more than three seconds, I want it to do something, 
then
RF return to waiting (for another three seconds). I've got some good 
help
RF from Curt and Tom (thanks guys), but there are evidently still 
issues
RF with my code. Here's simplified snippet:

you need to use break 2; to exit the while and the do - while or set
$connection = false;
--
regards,
Tom
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
There is no firewall. I'm running this locally.

On Thursday, May 13, 2004, at 05:00 PM, raditha dissanayake wrote:

#1 cause for socket failures happen to be firewalls.

René Fournier wrote:

I get this output:

PHP Warning:  socket_read() unable to read from socket [35]: Resource 
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php 
on line 63

From this code:

do {
socket_set_block($socket);
socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== 
false) {

[...]

And it's failing at while. Any ideas?

...Rene



--
Raditha Dissanayake.
-
http://raditha/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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


Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread Daniel Clark
http://www.php.net/manual/en/ref.sockets.ph

 I just read something about sock warnings this morning.   It said
 sometimes they drop off, and to ignore the warnings, but capture the
 errors.

 I get this output:

 PHP Warning:  socket_read() unable to read from socket [35]: Resource
 temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on
 line 63

  From this code:

 do {
  socket_set_block($socket);
  socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
  while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {

  [...]

 And it's failing at while. Any ideas?

 ...Rene

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



Re: [PHP] Why would a socket be unavailable?

2004-05-13 Thread René Fournier
On Thursday, May 13, 2004, at 05:13 PM, Daniel Clark wrote:

http://www.php.net/manual/en/ref.sockets.ph
Yes, I've read that page... many times. It has not helped me. That is 
why I am posting my problem here, in that hopes that someone can help.

(I don't mean to be completely helpless, but I just don't yet 
understand blocking/non-blocking sockets, and the parameters 
associated, since they are not well-documented. Someone said I 
shouldn't complain about thisand I'm notsince the functions are 
marked  Experimental. But this is precisely why I'm posting the 
question here.)

...Rene


I just read something about sock warnings this morning.   It said
sometimes they drop off, and to ignore the warnings, but capture the
errors.
I get this output:

PHP Warning:  socket_read() unable to read from socket [35]: Resource
temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php 
on
line 63

 From this code:

do {
socket_set_block($socket);
socket_set_option($socket,SOL_SOCKET,SO_RCVTIMEO,$timeout);
while(($buf = socket_read($socket,128,PHP_BINARY_READ)) !== false) {
	[...]

And it's failing at while. Any ideas?

...Rene



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


  1   2   >