Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Jason Wong
On Wednesday 26 March 2003 15:28, Steve Jackson wrote:
 Has anyone ever simply tried to pass information direct from the web
 into a secure Intranet mysql DB rather than to a web DB?

Haven't the faintest idea what you mean by direct from the web and a secure 
Intranet mysql db and web DB. 

 I am thinking down one of three lines.
 1) I use PHP to send an email with the data in it and update our
 internal DB manually (the worst case)

Can be done pretty easily.

 2) I use PHP which takes data, sends it as an email, puts it into a form
 which then automatically updates our internal network (interesting idea
 but I have no clue if it can be done ;o)

Not sure what you mean here. How is it different from the above?

 3) I use some sort of synchronisation so every time the web DB is
 updated our internal one is also updated (ideal).

See mysql replication.

 I would welcome any other ideas or solutions. Does mysql have any
 replication or synchronisation functions? I am told Oracle has but
 haven't seen this or heard of this with mysql.

Did you actually do any research? I'm sure if you google for mysql 
replication or mysql synchronisation you would get thousands of hits.

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



[PHP] Installation

2003-03-26 Thread Daniel Perry
Dear Sir
 
I require a complete installation package if possible.  I am operating
XP Pro, but unfortunately not IIS.  The problems that I have experienced
trying to obtain IIS has made me decide to use Apache as my web server
along with PHP and MySQL.  
 
Please would you provide a direct link that will allow a complete
installation of the three so that I can begin working on my Website?  I
have visited the website and installation page, although a good
advertisement for a complete packageis present there is no way to
download the files.
 
A second question I have; I have Studio MX (Dreamweaver MX, Flash MX,
Fireworks etc), within a menu there is an option to select PHP pages
(build a PHP page etc)  does this mean that I can design my page in
Dreamweaver then as I would have the installation (as above) I could
then view my pages?
 
Please advise.  Thankyou for your time.
 
Kind regards
Daniel Perry
 
Innovative Design
[EMAIL PROTECTED]
Tel: 0210 387 852
 


RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Steve Jackson
 Haven't the faintest idea what you mean by direct from the 
 web and a secure 
 Intranet mysql db and web DB. 
 

Sorry. What I mean is that we have an externally hosted website.
Currently all the forms etc update tables in the web hosted mysql DB. I
am in the process of building a small CRM system and want the data to
drop into our non public domain Intranet server. Is this possible?

  I am thinking down one of three lines.
  1) I use PHP to send an email with the data in it and update our 
  internal DB manually (the worst case)
 
 Can be done pretty easily.
 

I know but I don't want to have to manually update data from emails to
our Intranet server.

  2) I use PHP which takes data, sends it as an email, puts it into a 
  form which then automatically updates our internal network 
  (interesting idea but I have no clue if it can be done ;o)
 
 Not sure what you mean here. How is it different from the above?
 

I was thinking that I may be able to *automatically* take the data from
emails and put them through a form (hosted internally) which would then
update our DB here. I just don't know whether it's possible to do or
where to start.

  3) I use some sort of synchronisation so every time the web DB is 
  updated our internal one is also updated (ideal).
 
 See mysql replication.
  I would welcome any other ideas or solutions. Does mysql have any 
  replication or synchronisation functions? I am told Oracle has but 
  haven't seen this or heard of this with mysql.
 
 Did you actually do any research? I'm sure if you google for mysql 
 replication or mysql synchronisation you would get 
 thousands of hits.

Yes I did but am not really understanding it which is why I asked here.
Sorry if that offends you.


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



Re: [PHP] Installation

2003-03-26 Thread Nikunj Virani
 I require a complete installation package if possible.  I am operating
 XP Pro, but unfortunately not IIS.  The problems that I have experienced
 trying to obtain IIS has made me decide to use Apache as my web server
 along with PHP and MySQL.

 Please would you provide a direct link that will allow a complete
 installation of the three so that I can begin working on my Website?  I
 have visited the website and installation page, although a good
 advertisement for a complete packageis present there is no way to
 download the files.

Foxserv is good one:
http://www.foxserv.net/portal.php
http://twtelecom.dl.sourceforge.net/sourceforge/foxserv/FoxServ-3.0.exe

 A second question I have; I have Studio MX (Dreamweaver MX, Flash MX,
 Fireworks etc), within a menu there is an option to select PHP pages
 (build a PHP page etc)  does this mean that I can design my page in
 Dreamweaver then as I would have the installation (as above) I could
 then view my pages?

Yes. You must put the php files inside your DocumentRoot of your apache
installation. Dreamweaver can be used to design PHP Pages.

Regards,
NIkunj Virani



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



Re: [PHP] can i ask?

2003-03-26 Thread Awlad Hussain
These lines already exist in httpd.conf file, you may need to change the
path or uncomment them.

- Original Message -
From: M.N. Ikhwan S. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 12:49 AM
Subject: [PHP] can i ask?



  ScriptAlias /php/ c:/php/
  AddType application/x-httpd-php .php
  Action application/x-httpd-php /php/php.exe

  i'm using apache 2.0 as my web server. and i'm about to ask these
question, where am i going to put these three lines? under what line in
httpd.conf?

  ikhwan




 -
 Do you Yahoo!?
 Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!


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



Re: [PHP] Formatting code.

2003-03-26 Thread Awlad Hussain
Good article on coding standard at www.phpfreaks.net




 Is there any documents on how code should be layed out?
 
 
 --
 Philip J. Newman.
 Head Developer
 [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] Object Aggregation - does anyone have experience with it?

2003-03-26 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

my _guess_ would be you compiled w/ default (v1) zend engine. v2 has lots of 
improvements for oop- perhaps this is one of them. Try compiling with v2 of 
the engine and see what happens.




On Tuesday 25 March 2003 02:44 pm, Christopher E. Welton wrote:
 I am using php 4.2.2 with Apache 2.0 on Red Hat 8.0

 When I attempt to dynamically aggregate two objects using the
 aggregate() call, I get the following message:

 Fatal error: Call to undefined function: aggregate()

 the man page for aggregate() lists  the following info:
 aggregate
 (PHP 4 = 4.2.0)
 void aggregate ( object object, string class_name)

 Though I realize this module is experimental, I'm curious if it has been
 pulled out from PHP, moved to a different name/section or if there is
 just something weird going on here with my installation.

 Any help would be appreciated

- -- 
Whenever I think of how religion started, I picture some frustrated old man 
making out a list of all the ways he could gain power, until he finally came 
up with the great solution of constant fear and guilt, then he leaped up and 
started planning a new wardrobe.

- -Steve Blake
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+gXTT/rncFku1MdIRAo6KAKCawqDo7zo6nt/IZl3ySqVVicLnsgCfUODU
3BAoXnYmZFA/Dc+a9jxtAFc=
=t3Sb
-END PGP SIGNATURE-


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



[PHP] ldap_read() and 'No such object'

2003-03-26 Thread Turbo Fredriksson
I'm using ldap_read() to get the namingContexts from the LDAP
server.

- s n i p -
$sr = ldap_read($this-ldap_linkid, '', '(objectClass=*)', array('namingContexts'));
if(! $sr) die(Can't find base dn - .ldap_error($this-ldap_linkid));
$entry = ldap_get_entries($this-ldap_linkid, $sr);
- s n i p -

Unfortunatly, I get:
- s n i p -
   Warning: LDAP: Unable to perform the search: No such object in
   /afs/bayour.com/public/web/ldap/phpQLAdmin-CVS.latest/include/pql.inc on line 45
   Can't find base dn - No such object
- s n i p -

This only shows up if the namingContexts have a space in it (ie, base DN contains
a space):
- s n i p -
[papadoc.pts/9]$ /usr/bin/ldapsearch -x -LLL -h localhost -s base -b '' 
'(objectclass=*)' namingContexts
dn:
namingContexts: o=Turbo Fredriksson
- s n i p -

On my live server, I have 'namingContexts: dc=com', and the PHP page(s) work
on that...

Any ideas?
-- 
FSF assassination Ft. Bragg Mossad counter-intelligence arrangements
Qaddafi PLO 747 supercomputer Marxist BATF South Africa kibo Serbian
[See http://www.aclu.org/echelonwatch/index.html for more about this]

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



[PHP] Installation Problem

2003-03-26 Thread bob pilly
Hi 

Im trying to install php-4.3.1 as a dynamic module in
apache-2.0.44 but are having problems.  I install and
compile both with no problems using the
--with-apxs=pathto in the ./configure command for php.
I can see that it has created the libphp4.so in
pathtoapache/modules/ and i have added

AddType application/x-httpd-php .php
LoadModule php4_module modules/libphp4.so

Into the httpd.conf file 

and copies php.ini-dist to /usr/local/lib/php.ini as
well.
I have done a apachectl configtest and restart and now
when i try and load a php page i get a pop up box on
my browser saying:
'The URL HTTP://pathtoserver/test.php has mime type
application/x-httpd-php
What do you want to do with it?'

and i can either save or run it from that location.

Does anyone know what i may be missing or where i have
gone wrong?


__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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



[PHP] best way to throw erorrs within a class

2003-03-26 Thread Dan Rossi
hi guys i have been trying to work out the best way to trigger exception
style error handling within a class and return it ,i am currently storing
the error code into a session variable, exiting, and doing a header location
to the previous page where i was submitting from and output the error code
with the message in an array is this the best way to do this , or is trigger
error with a set_error_handler on a function within the lass the best way to
do it ?


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



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Jason Wong
On Wednesday 26 March 2003 16:40, Steve Jackson wrote:

 Sorry. What I mean is that we have an externally hosted website.
 Currently all the forms etc update tables in the web hosted mysql DB. I
 am in the process of building a small CRM system and want the data to
 drop into our non public domain Intranet server. Is this possible?

OK. Yes, some of the possible solutions are as below:

   I am thinking down one of three lines.
   1) I use PHP to send an email with the data in it and update our
   internal DB manually (the worst case)
 
  Can be done pretty easily.

 I know but I don't want to have to manually update data from emails to
 our Intranet server.

Manually? What I meant was that it's pretty easy to send an email to a server 
and have a script process the email. Thus the script will parse the contents 
of the mail and update the db accordingly. Search the archives for process 
mail, I have some old posts which outline how this can be done.

   2) I use PHP which takes data, sends it as an email, puts it into a
   form which then automatically updates our internal network
   (interesting idea but I have no clue if it can be done ;o)
 
  Not sure what you mean here. How is it different from the above?

 I was thinking that I may be able to *automatically* take the data from
 emails and put them through a form (hosted internally) which would then
 update our DB here. I just don't know whether it's possible to do or
 where to start.

See above.

   3) I use some sort of synchronisation so every time the web DB is
   updated our internal one is also updated (ideal).
 
  See mysql replication.
 
   I would welcome any other ideas or solutions. Does mysql have any
   replication or synchronisation functions? I am told Oracle has but
   haven't seen this or heard of this with mysql.
 
  Did you actually do any research? I'm sure if you google for mysql
  replication or mysql synchronisation you would get
  thousands of hits.

 Yes I did but am not really understanding it which is why I asked here.
 Sorry if that offends you.

With all due respect that is not what you asked. In any case for help on 
mysql's replication feature you should ask on the mysql list.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
does your DRESSING ROOM have enough ASPARAGUS?
*/


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



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread skate
as another solution (and not knowing mysql replication myself, so can't
comment on this) you could connect remotely to your MySQL database that is
on your intranet, and dump the data straight into it. it really depends how
open to the world that system is, or can be, and how security concious you
are.

or you could have some kinda XML output or DB dump from the online website
available, and have your local CRM machine access that every 5 minutes or
less...

just 2 other solutions, maybe not the best, but they'd do the job...


- Original Message -
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 10:53 AM
Subject: Re: [PHP] Passing data between the web to an Intranet


 On Wednesday 26 March 2003 16:40, Steve Jackson wrote:

  Sorry. What I mean is that we have an externally hosted website.
  Currently all the forms etc update tables in the web hosted mysql DB. I
  am in the process of building a small CRM system and want the data to
  drop into our non public domain Intranet server. Is this possible?

 OK. Yes, some of the possible solutions are as below:

I am thinking down one of three lines.
1) I use PHP to send an email with the data in it and update our
internal DB manually (the worst case)
  
   Can be done pretty easily.
 
  I know but I don't want to have to manually update data from emails to
  our Intranet server.

 Manually? What I meant was that it's pretty easy to send an email to a
server
 and have a script process the email. Thus the script will parse the
contents
 of the mail and update the db accordingly. Search the archives for
process
 mail, I have some old posts which outline how this can be done.

2) I use PHP which takes data, sends it as an email, puts it into a
form which then automatically updates our internal network
(interesting idea but I have no clue if it can be done ;o)
  
   Not sure what you mean here. How is it different from the above?
 
  I was thinking that I may be able to *automatically* take the data from
  emails and put them through a form (hosted internally) which would then
  update our DB here. I just don't know whether it's possible to do or
  where to start.

 See above.

3) I use some sort of synchronisation so every time the web DB is
updated our internal one is also updated (ideal).
  
   See mysql replication.
  
I would welcome any other ideas or solutions. Does mysql have any
replication or synchronisation functions? I am told Oracle has but
haven't seen this or heard of this with mysql.
  
   Did you actually do any research? I'm sure if you google for mysql
   replication or mysql synchronisation you would get
   thousands of hits.
 
  Yes I did but am not really understanding it which is why I asked here.
  Sorry if that offends you.

 With all due respect that is not what you asked. In any case for help on
 mysql's replication feature you should ask on the mysql list.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 does your DRESSING ROOM have enough ASPARAGUS?
 */


 --
 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] mysql_fetch_* and stripslashes

2003-03-26 Thread Aaron Dalton
Why is it that PHP does not automatically unescape data retrieved from a
mySQL query?  It seems to me that this should be the default behaviour as
the bulk of what PHP web scripts do is display said data.  I'm just
wondering if I'm missing some command or optional argument to make this
happen.  As it is, I had to write an array_stripslashes routine and run
every single db query I do through it.  Just seems odd to me.

Cheers!

-- 
Aaron Dalton
[EMAIL PROTECTED]
PGPKeyID# 0x65AB5571



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



Re: [PHP] mysql_fetch_* and stripslashes

2003-03-26 Thread Tom Rogers
Hi,

Wednesday, March 26, 2003, 9:10:26 PM, you wrote:
AD Why is it that PHP does not automatically unescape data retrieved from a
AD mySQL query?  It seems to me that this should be the default behaviour as
AD the bulk of what PHP web scripts do is display said data.  I'm just
AD wondering if I'm missing some command or optional argument to make this
AD happen.  As it is, I had to write an array_stripslashes routine and run
AD every single db query I do through it.  Just seems odd to me.

AD Cheers!

AD -- 
AD Aaron Dalton
AD [EMAIL PROTECTED]
AD PGPKeyID# 0x65AB5571


Sounds like your doing addslashes twice before storing the data.
or magic_quotes_runtime is set on in your php.ini

-- 
regards,
Tom


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



Re: [PHP] mysql_fetch_* and stripslashes

2003-03-26 Thread Aaron Dalton
*blushes deeply*

It turns out my old php3.ini was still being loaded which had magic_quotes
turned ON!  Turning magic_quotes off of course fixed the problem.  My
thanks for your patience.

Cheers!

On Wed, 26 Mar 2003, Tom Rogers wrote:

 Hi,

 Wednesday, March 26, 2003, 9:10:26 PM, you wrote:
 AD Why is it that PHP does not automatically unescape data retrieved from a
 AD mySQL query?  It seems to me that this should be the default behaviour as
 AD the bulk of what PHP web scripts do is display said data.  I'm just
 AD wondering if I'm missing some command or optional argument to make this
 AD happen.  As it is, I had to write an array_stripslashes routine and run
 AD every single db query I do through it.  Just seems odd to me.

 AD Cheers!

 AD --
 AD Aaron Dalton
 AD [EMAIL PROTECTED]
 AD PGPKeyID# 0x65AB5571


 Sounds like your doing addslashes twice before storing the data.
 or magic_quotes_runtime is set on in your php.ini



-- 
Aaron Dalton
[EMAIL PROTECTED]
PGPKeyID# 0x65AB5571




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



Re: [PHP] help with preg_replace please

2003-03-26 Thread CPT John W. Holmes
 I get the following error:

 Parse error: parse error, expecting `T_VARIABLE' or `'$'' in
 /usr/local/apache/htdocs/lib/lib_string.inc on line 218

 Using this code:
 $str =
 preg_replace(!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/=])!ei, a
 href=\{$1}://{$2}{$3}\{$2}{$3}/a, $str);

Since you're using the 'e' modifier, the replacement string needs to be
valid PHP code. So, it should start with a variable or a function. A
replacement such as:

'print(a href={$1} .. )'

should work.

I didn't get a chance to answer you original question. I couldn't even get
that regular expression to match links in any tests that I did, but if it's
working for you, that's good. Couldn't you modify the expression to look for
0-60 characters that are not a space, followed by any amount of characters
that are not a space, and only actually match the first 0-60 to use in your
replacement string? Something like:

([^[:space:]]{0,60})[^[:space:]]*

Which will match up to 60 characters in $2 for example, and also allow form
more characters than that, but just not match them. This is assuming what
everyone else said is right and you fix the entire regex to match the preg
syntax...

---John Holmes...


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



[PHP] Freetds + php 4.3.1

2003-03-26 Thread Damien Croarken

Can someone please give me an idea as to why php returns dates in m-d-y
format when using freetds under 4.3.1, when tsql (freetds client) returns
them in unix datestamp format?

Damien


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



Re: [PHP] PHP grep

2003-03-26 Thread Chris Blake
Ok...I checked php.ini and I`m not running safe mode..

I`ll take your advice and use fopen

Thanks for the help.

On Wed, 2003-03-26 at 14:31, David T-G wrote:
 Chris --
 
 Don't reply just to me; you're much more likely to get useful answers, or
 even answers at all, if you keep it on the mailing list!
 
 ...and then Chris Blake said...
 % 
 % Howdy David,
 
 Hiya!
 
 
 % 
 % Thanks for the reply
 
 Sure thing :-)
 
 
 % 
 % I`m totally new to this PHP stuffdefine running in safe mode.
 
 I don't know much about it, since my server runs without it.  It's not a
 bad idea, though.  It just tells php to be more cautious, which in turns
 sometimes prevents you from doing what you think you want to do.
 
 Check the manual; it's where I saw the comment that safe mode disables
 backticks (and, therefore, shell_exec).  You can still make a system()
 call, though.
 
 Meanwhile, why bother to use a call to grep at all?  Just fopen the file
 and match on its contents...
 
 
 % 
 % The only safe mode I knew of was under WindowsI`ve since converted
 
 Heh :-)
 
 
 % to Linuxis this a setting I need to change in php.ini ?
 
 Yep.  Look for
 
   safe_mode = ...
 
 to see how you're set.
 
 
 % 
 % Thanks for the help...
 
 Sure thing!
 
 
 HTH  HAND
 
 :-D
 -- 
 David T-G  * There is too much animal courage in 
 (play) [EMAIL PROTECTED] * society and not sufficient moral courage.
 (work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
 http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
 
-- 
Chris Blake
Office : (011) 782-0840
Cell : 083 985 0379
A chicken is the eggs way of producing more eggs.


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



[PHP] Re: Installation

2003-03-26 Thread Joel Colombo
Here is the whole setup simple step-by-step even for PERL if you want !

http://www.ricocheting.com/server/apache.html

Joel


Daniel Perry [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Dear Sir

 I require a complete installation package if possible.  I am operating
 XP Pro, but unfortunately not IIS.  The problems that I have experienced
 trying to obtain IIS has made me decide to use Apache as my web server
 along with PHP and MySQL.

 Please would you provide a direct link that will allow a complete
 installation of the three so that I can begin working on my Website?  I
 have visited the website and installation page, although a good
 advertisement for a complete packageis present there is no way to
 download the files.

 A second question I have; I have Studio MX (Dreamweaver MX, Flash MX,
 Fireworks etc), within a menu there is an option to select PHP pages
 (build a PHP page etc)  does this mean that I can design my page in
 Dreamweaver then as I would have the installation (as above) I could
 then view my pages?

 Please advise.  Thankyou for your time.

 Kind regards
 Daniel Perry

 Innovative Design
 [EMAIL PROTECTED]
 Tel: 0210 387 852





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



[PHP] Checkbox

2003-03-26 Thread shaun
Hi,

is it possible to have a checkbox that if it is specified to be checked when
the page is being formulated then it cannot be unchecked?



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



Re: [PHP] Zip Way of life.

2003-03-26 Thread Marek Kilimajer
So use PclZip class, it is pure php without the need to have nay special 
extension installed

Vincent M. wrote:

Daevid Vincent wrote:

You could use the exec() or shell_exec() and just do it via command line
method...
Yes but gunzip does not work when there are more than one file in the 
zip file and unzip is not installed by default on Unix servers. :-(







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


Re: [PHP] substr() on part an ereg() capture

2003-03-26 Thread Marek Kilimajer
Forgot to mention this is to be run after
eregi_replace(([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/=]), a
href=\\\1://\\2\\3\ {$t}\\\1://\\2\\3/a, $str);
as it only replaces long strings within a tags
Marek Kilimajer wrote:

$str = preg_replace('|(a[^]*[^]{55})[^]+(/a)|','$1...$2', $str);

Justin French wrote:

Hi, I have this ereg to turn URLs into links:

eregi_replace(([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/=]), a
href=\\\1://\\2\\3\ {$t}\\\1://\\2\\3/a, $str);
... found it in the manual i think, or maybe on weberdev.com examples

Anyhoo, it places the whole link in between the a... and /a, 
which is
fine for short links, but on longer links (in my case, around 60+ 
chars), it
messes with my table or CSS layout.

So, I'd like to subtr() the 2nd capture part down to 55 chars or 
something
IF it's longer than 60, and append a ... to it.

ANY ideas on how this is done?  Or is this beyond regexp??

TIA

Justin

 





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


php-general Digest 26 Mar 2003 17:27:57 -0000 Issue 1961

2003-03-26 Thread php-general-digest-help

php-general Digest 26 Mar 2003 17:27:57 - Issue 1961

Topics (messages 141052 through 141084):

imap_open Error
141052 by: Brian Mitchell

Re: NewB Q on Arrays.
141053 by: chris
141057 by: Frappy John

Re: session id
141054 by: Uttam

Re: ho to remove an empty space
141055 by: chris

Re: connecting to mysql db
141056 by: Uttam

help with preg_replace please
141058 by: Justin French
141059 by: Jason Wong
141060 by: Jason Paschal
141078 by: CPT John W. Holmes

Passing data between the web to an Intranet
141061 by: Steve Jackson
141062 by: Nikunj Virani
141063 by: Jason Wong
141065 by: Steve Jackson
141073 by: Jason Wong
141074 by: skate

Installation
141064 by: Daniel Perry
141066 by: Nikunj Virani
141081 by: Joel Colombo

Re: can i ask?
141067 by: Awlad Hussain

Re: Formatting code.
141068 by: Awlad Hussain

Re: Object Aggregation - does anyone have experience with it?
141069 by: Evan Nemerson

ldap_read() and 'No such object'
141070 by: Turbo Fredriksson

Installation Problem
141071 by: bob pilly

best way to throw erorrs within a class
141072 by: Dan Rossi

mysql_fetch_* and stripslashes
141075 by: Aaron Dalton
141076 by: Tom Rogers
141077 by: Aaron Dalton

Freetds + php 4.3.1
141079 by: Damien Croarken

Re: PHP  grep
141080 by: Chris Blake

Checkbox
141082 by: shaun

Re: Zip Way of life.
141083 by: Marek Kilimajer

Re: substr() on part an ereg() capture
141084 by: Marek Kilimajer

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---
I'm using the following code to try to open a stream to access my email: 
  
$user_id = userid; 
$password = password; 
$inbox = @imap_open({mail.host.com:143}INBOX, $user_id, $password); 
  
I've verified the correct username, password, hostname combination by setting up an 
IMAP account through Outlook Express. 
  
However, whenever I try and open the page that this code sits on I get a The Page 
Cannot Be Displayed error.  Specifically, it says that it cannot find the server or 
DNS error.  I can comment out the imap_open line and the page will load fine.  Also, 
I've asked my host and verified that the imap functions are available as part of PHP.  
I can't figure out why this is happening.  Any help would be greatly appreciated. 
  
Thanks, 
Brian ---End Message---
---BeginMessage---
On Tue, 25 Mar 2003 21:18:48 +1000, Inpho [EMAIL PROTECTED] wrote:

Hey All,

I'm still a newB in php and mysql so I'm asking for your patience up 
front.

i want to get a list of results from an array, which I can do with:

$result=mysql_query(select * from mvlogtbl,$db);
while ($row=mysql_fetch_array($result)){
echo $row[uid] $row[mvid];
}
basically what I have is a database of movies linked to .avi files that 
are
setup for streaming, the table mvlogtbl keeps a log of who has watched 
what.

What i want to be able to do is determine if a certain user has watched a
movie. But there are multiple entries for each user, a user may have 
watched
the movie more than once, I don't really care, I just want to be able to
tell if they have watched it or not...

any help?

Thanls

- paul -

// pseudo code starts here...
// use php to read the contents of the avi and set the header of the php 
doc
// to match headers necessary for an avi (check the fread/fwrite 
documentation)
// when it downloads, set the member_has_watched field for that member to
// true or 1 or whatever...

select count(*) from table where member_has_watched = TRUE and member_id = 
the_member's_id

if ($count  0) {
// the member has watched it
} else {
// the member has not watched it
}
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
---End Message---
---BeginMessage---
 What i want to be able to do is determine if a certain
 user has watched a movie. 

If you want to check the log to see if a single user has 
viewed a particular movie, then include the user and movie 
in the select statement:

select uid, mvid from mvlogtbl where uid = $userID and mvid 
= $movieID

If mysql_num_rows  zero, then user has watched this movie.

Better still:

select count(uid) from mvlogtbl where uid = $userID and 
mvid = $movieID

Here one row will be returned containing the number of 
times the user has viewed the movie. 

--Frappy



On Tuesday 25 March 2003 06:18 am, inpho wrote:
 Hey All,

 I'm still a newB in php and mysql so I'm asking for your
 patience up front.

 i want to get a list of results from an array, which I
 can do with:

 $result=mysql_query(select * from mvlogtbl,$db);
 while 

[PHP] Selecting date range from database

2003-03-26 Thread Jeff Lewis
I am trying to select a date range in this format from a database 1-Mar-03
to 26-Mar-03. The date is stored in a mySQL database in that format and when
doing a normal select it just selects the dates as if they are numbers.

How can I make this select work the way I want it to work? I am using the
following query:

SELECT * FROM members WHERE member_date = '01-Mar-03' AND member_date =
'26-Mar-03'  ORDER BY member_date;

Jeff


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



[PHP] Web server request redirection

2003-03-26 Thread Jan Walter
Hi,

I have written a small webservice in M$ VS.NET (for some political 
reasons), which needs IIS to run.

I would like not to open M$ IIS server for outer requests, but enable 
access just through linux/apache(/php) webserver instead.

Is there any simple way, how to resend (at least POST/GET) requests in 
their original form to another webserver behind firewall a send its 
answer back?

I tried fsockopen which gets the result OK. However this approach would, 
as I suppose, demand to parse answers from the server for Content-Type, 
etc. Is there anything more simple?

Thanx for any hint
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Steve Jackson
 Manually? What I meant was that it's pretty easy to send an 
 email to a server 
 and have a script process the email. Thus the script will 
 parse the contents 
 of the mail and update the db accordingly. Search the 
 archives for process 
 mail, I have some old posts which outline how this can be done.

Hi,

After much searching I found this
http://marc.theaimsgroup.com/?l=php-generalm=104210703824057w=2
This
http://marc.theaimsgroup.com/?l=php-generalm=104219587732145w=2

And others with process in the body and subject line but not any of the
thread you refer to.
Don't suppose you could regurgitate it could you?
I must have trawled through about 1 messages. I was back to Nov
2001!
The above two links don't really help me that much, I just need the
process explained so I know I'm on the right track.
Cheers, 

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



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



[PHP] Getting Results for a month from a date field

2003-03-26 Thread Hunter, Jess
I have a field named hiredate and it is in the typical MySQL format
(-MM-DD) what I am trying to do it be able to create a query that when I
put in a particular month it will give me the results regardless of the year
the person was hired.  This is so I can generate a anniversary report to
include the names of all the people who were hired in a particular month.

Any snippet of code would be helpful.

Thanks in advance

Jess

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



[PHP] MySQL's connection information.

2003-03-26 Thread Edmond Baroud
Hi all,

I've been using php in a local Unix environement where I never had to worry about read 
permissions of users/groups on my db connection's config file which contains the user 
and password. I'm trying to think of a possible solution for my connection properties 
in a shared/hosting environement where users/groups *might* have read access to my 
files.

Any suggestions would be appreciated.

Ed.

-- 
Edmond Baroud 
Senior UNIX sysadmin mailto:[EMAIL PROTECTED]
Fingerprint  140F 5FD5 3FDD 45D9 226D  9602 8C3D EAFB 4E19 BEF9
UNIX is very user friendly, it's just picky about who its friends are.



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



Re: [PHP] Default setting garbage

2003-03-26 Thread Liam Gibbs
 I'll guess that you're trying to access $frequency outside of the
 function, after you've called it, right? If so, read up on variable
 scope in the manual.

No, I'm trying to access it inside the function. This is what I have (or an
example, since I don't have it right in front of me right now):

function func($a = 1, $b = 2) {
print([$a]);
}

From the above example, I get [] as output.


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



[PHP] php.ini question

2003-03-26 Thread Joe Kupiszewski
I didn't do the installation, but the phpinfo() shows the following:

version - 4.2.3

./configure' '--with-apxs=/usr/local/sbin/apxs'
'--with-config-file-path=/usr/local/etc' '--enable-versioning'
'--with-regex=system' '--without-gd' '--without-mysql' '--with-zlib'
'--with-mysql=/usr/local' '--prefix=/usr/local' 'i386-portbld-freebsd4.7'

and the php path info is listed as
/usr/local/etc

I do have root access as this is not a production machine, but for the life
of me cannot seem to get it to read the php.ini file.  I believe php and
apache are interacting properly, or I wouldn't get the phpinfo() to work.

The root of my real problem is that in trying to pass variable values from
php scripts to reinvocations of the same script using
http://pathtofile.php?action=3

I realize that this is a register_globals thing and that I can access it by
one of two ways:

1)  Turning register_globals on (which many tell me is a security risk)
2)  Using $_REQUEST[action]
3)  $HTTP_POST_VARS and $HTTP_GET_VARS - with [action]

However, using the second (haven't tried the 3rd) method and trying to
incorporate this variable value into an sql statement it bombs.  This may be
more appropriate for an sql post, but thought I would throw it up here and
see if anyone can shed some light as to how php is interpreting 2) and 3)

One workaround I have started with was just assigning the
$_REQUEST[action] value to a new local variable and just using that, but
it seems like there would be an easier way and that this method is just a
lot of wasted work.

Thanks for any thoughts and I am happy to post add'l script details.

Joe...



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



[PHP] getimagesize

2003-03-26 Thread Diana Castillo
anyway to not get an error when doing getimagesize if you get this response?
HTTP request failed! HTTP/1.1 404 Not Found



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



[PHP] RE: Mac IE File download problem - any solutions?

2003-03-26 Thread Philip Hallstrom
You might try...

header(Content-Disposition: attachment; filename=$filename);

maybe?

On Tue, 25 Mar 2003, Daniel Leighton wrote:

 Actually, I think you may have misunderstood.  On Mozilla (Mac), Netscape (Mac) and 
 Safari the script works exactly as I have intended: sending the Content-Type: 
 application/octet-stream header causes the file to download; sending the 
 Content-Type: video/quicktime causes the file to be played within the browser.  On 
 IE (Mac OS X), some files with the .mov extension download when the Content-Type: 
 application/octet-stream header is sent, while others play in-browser, while all 
 play in-browser, as they should.

 From what I understand, Content-Type: application/octet-stream header should 
 ALWAYS cause a download.  This is not an issue of post-processing (the settings in 
 the browser which tell it to open a file in a certain application AFTER the file has 
 been downloaded - that is not a problem).  BTW, even if I change my preferences in 
 IE to save .mov files to disk, they still play in-browser.

 After re-compiling PHP with mime-magic enabled, the mime_content_type() function is 
 returning video/quicktime for the file which does not download and text/plain 
 for the one which does (even though the text/plain file plays fine both in-browser 
 and once it is downloaded).  In any case, that will be my next area of investigation.

 At 12:03 PM -0800 on 3/25/03, Jennifer Goodie wrote:


 This is not a MAC IE problem, it is the way browsers work.  If the MIME type
 is mapped to an application, the browser will launch the application.  IE
 does it inline, while Netscape tends to launch it separately.
 
 You can send false headers with a made up type and a missing file extension,
 but then the browser will not know what type of file it is and the save as
 is harder for the user as they have to put the right extension on.  It is a
 work around, but a really poor one.
 
 header(Content-disposition: filename=$filenamewithoutextension);
 header(Content-type:reallyreallyreallybigcsv);
 
 
 
 
 -Original Message-
 From: Step Schwarz [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, March 25, 2003 11:49 AM
 To: Daniel Leighton; [EMAIL PROTECTED]
 Subject: Re:  Mac IE File download problem - any solutions?
 
 
 [...]
  The problem:  When downloading certain files on a Mac using IE 5.x, files
 are
  displayed within a browser window instead of downloading.  This seems to
 occur
  mostly with quicktime files (.mov, .mp3).  Some quicktime files work,
 while
  others with the same extension do not.
 [...]
 
 Hi Daniel,
 
 I believe this is a browser setting, is it not?  Using the default setup of
 Explorer 5.2 for Mac, a clicked .mov file will play in IE.
 
 To change this behavior, go to Explorer  Preferences...  File Helpers,
 select QuickTime Movie and click Change... then switch Handling from View
 with Browser to Save to File.
 
 I would be surprised if a file header could override this.. but if you find
 a way, please let us know!
 
 -Step
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 --

 Daniel Leighton
 Chief Technology Officer
 Webolution
 http://www.webolution.com

  This email may contain material that is confidential and privileged for the
 sole use of the intended recipient.  Any review, reliance or distribution
 by others or forwarding without express permission is strictly prohibited.
 If you are not the intended recipient, please contact the sender and delete
 all copies.

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

2003-03-26 Thread bob pilly
Hi all 

I have installed php 4.3.2 RC1 with the
--with-sybase=/pathtomysysbase dir configure switch. I
have had no installation problems but now when i go to
load a page with the sybase_connect() function call in
it i get the following error:

Fatal error: Call to undefined function:
sybase_connect()

I take it this means that the sybase_connect function
is not available but am wondering why this would be if
i have used the --with-sybase configure option? I have
also tried --with-sybase-ct and get the same problem.

Thanks for any help in advance!

__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

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



[PHP] Re: Checkbox

2003-03-26 Thread Towel Boy
Try the readonly flag

input type=checkbox name=checkboxes1 value=choice1 checked readonly

Haven't tried it, no guarantees...

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

 is it possible to have a checkbox that if it is specified to be checked
when
 the page is being formulated then it cannot be unchecked?





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



RE: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Ray Hunter
your best bet might be to use xml (soap) or to do mysql replication.

http://www.mysql.com/doc/en/Replication_HOWTO.html

Now if you have a web db saying that the db is used for web access only
and then you have an internal (intranet) db, i am supposing that it is
behind some firewall.  If not then I suggest that one is set up! You can
create an ssh tunnel and have all replicated data go from the web db to
the intranet db.  This would be the fastest way to populate the data.

If you do not want to use the network for transmitting data and if the 2
machines are physically close by you can use a serial connect to
transmit the database.

HTH

--
Ray


On Wed, 2003-03-26 at 01:40, Steve Jackson wrote:
  Haven't the faintest idea what you mean by direct from the 
  web and a secure 
  Intranet mysql db and web DB. 
  
 
 Sorry. What I mean is that we have an externally hosted website.
 Currently all the forms etc update tables in the web hosted mysql DB. I
 am in the process of building a small CRM system and want the data to
 drop into our non public domain Intranet server. Is this possible?
 
   I am thinking down one of three lines.
   1) I use PHP to send an email with the data in it and update our 
   internal DB manually (the worst case)
  
  Can be done pretty easily.
  
 
 I know but I don't want to have to manually update data from emails to
 our Intranet server.
 
   2) I use PHP which takes data, sends it as an email, puts it into a 
   form which then automatically updates our internal network 
   (interesting idea but I have no clue if it can be done ;o)
  
  Not sure what you mean here. How is it different from the above?
  
 
 I was thinking that I may be able to *automatically* take the data from
 emails and put them through a form (hosted internally) which would then
 update our DB here. I just don't know whether it's possible to do or
 where to start.
 
   3) I use some sort of synchronisation so every time the web DB is 
   updated our internal one is also updated (ideal).
  
  See mysql replication.
   I would welcome any other ideas or solutions. Does mysql have any 
   replication or synchronisation functions? I am told Oracle has but 
   haven't seen this or heard of this with mysql.
  
  Did you actually do any research? I'm sure if you google for mysql 
  replication or mysql synchronisation you would get 
  thousands of hits.
 
 Yes I did but am not really understanding it which is why I asked here.
 Sorry if that offends you.
 


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



Re: [PHP] Installation Problem

2003-03-26 Thread Ray Hunter
Maybe have this:

LoadModule php4_module modules/libphp4.so

AddType application/x-httpd-php .php

I would load the module first and then add the type...might not make a
bit of difference.

--
Ray

On Wed, 2003-03-26 at 03:24, bob pilly wrote:
 Hi 
 
 Im trying to install php-4.3.1 as a dynamic module in
 apache-2.0.44 but are having problems.  I install and
 compile both with no problems using the
 --with-apxs=pathto in the ./configure command for php.
 I can see that it has created the libphp4.so in
 pathtoapache/modules/ and i have added
 
 AddType application/x-httpd-php .php
 LoadModule php4_module modules/libphp4.so
 
 Into the httpd.conf file 
 
 and copies php.ini-dist to /usr/local/lib/php.ini as
 well.
 I have done a apachectl configtest and restart and now
 when i try and load a php page i get a pop up box on
 my browser saying:
 'The URL HTTP://pathtoserver/test.php has mime type
 application/x-httpd-php
 What do you want to do with it?'
 
 and i can either save or run it from that location.
 
 Does anyone know what i may be missing or where i have
 gone wrong?
 
 
 __
 Do You Yahoo!?
 Everything you'll ever need on one web page
 from News and Sport to Email and Music Charts
 http://uk.my.yahoo.com


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



Re: [PHP] php.ini question

2003-03-26 Thread Philip Olson

Regarding the location of php.ini, read this:

  http://www.php.net/faq.installation.php#faq.installation.findphpini

Next, learn about using external variables in PHP:

  http://www.php.net/variables.external

Now, regarding your example of: file.php?action=3 You'll notice 
that you can use either:

  a) $_GET['action']
  b) $HTTP_GET_VARS['action']
  c) $_REQUEST['action'];
  d) import_request_variables()...
  e) $action if register_globals = on
  f) Note: it's NOT POST, it's GET.

Regarding using in a sql query, this is a simple string
related question and has nothing to do with register_globals
or SQL.  You can do this:

  // GOOD
  $str = An array: {$_GET['action']} inside a string;

While the following results in an error and will NOT work:

  // BAD!!!
  $str = An array: $_GET['action'] inside a string;

This is further explained here:

  http://www.php.net/types.string

Regards,
Philip


On Wed, 26 Mar 2003, Joe Kupiszewski wrote:

 I didn't do the installation, but the phpinfo() shows the following:
 
 version - 4.2.3
 
 ./configure' '--with-apxs=/usr/local/sbin/apxs'
 '--with-config-file-path=/usr/local/etc' '--enable-versioning'
 '--with-regex=system' '--without-gd' '--without-mysql' '--with-zlib'
 '--with-mysql=/usr/local' '--prefix=/usr/local' 'i386-portbld-freebsd4.7'
 
 and the php path info is listed as
 /usr/local/etc
 
 I do have root access as this is not a production machine, but for the life
 of me cannot seem to get it to read the php.ini file.  I believe php and
 apache are interacting properly, or I wouldn't get the phpinfo() to work.
 
 The root of my real problem is that in trying to pass variable values from
 php scripts to reinvocations of the same script using
 http://pathtofile.php?action=3
 
 I realize that this is a register_globals thing and that I can access it by
 one of two ways:
 
 1)  Turning register_globals on (which many tell me is a security risk)
 2)  Using $_REQUEST[action]
 3)  $HTTP_POST_VARS and $HTTP_GET_VARS - with [action]
 
 However, using the second (haven't tried the 3rd) method and trying to
 incorporate this variable value into an sql statement it bombs.  This may be
 more appropriate for an sql post, but thought I would throw it up here and
 see if anyone can shed some light as to how php is interpreting 2) and 3)
 
 One workaround I have started with was just assigning the
 $_REQUEST[action] value to a new local variable and just using that, but
 it seems like there would be an easier way and that this method is just a
 lot of wasted work.
 
 Thanks for any thoughts and I am happy to post add'l script details.
 
 Joe...
 
 
 
 -- 
 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] Getting Results for a month from a date field

2003-03-26 Thread Marek Kilimajer
|MONTH(date)|
   Returns the month for |date|, in the range |1| to |12|:
SELECT * FROM employees WHERE MONTH(hiredate)='$month'



Hunter, Jess wrote:

I have a field named hiredate and it is in the typical MySQL format
(-MM-DD) what I am trying to do it be able to create a query that when I
put in a particular month it will give me the results regardless of the year
the person was hired.  This is so I can generate a anniversary report to
include the names of all the people who were hired in a particular month.
Any snippet of code would be helpful.

Thanks in advance

Jess

 



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


[PHP] Starting/Reviving a Workshop

2003-03-26 Thread David Duong
Hello, I'm thinking about reviving a 'workshop' I had a while back because
of a recent post I found at a forum. The foundation is already set up, and I
would like to see how many people are interested. This workshop is for CGI
scripts mainly PHP and Perl, but PHP takes precedence over Perl. Everything
is Open Source (under GPL) and on CVS.  If you are unfamiliar with CVS, I'll
have a tutorial set up shortly.

David Duong



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



[PHP] Re: php.ini question

2003-03-26 Thread Towel Boy
does phpinfo(32) show the $action variable anywhere? If so just use the
global array variable it shows up under. Personally I'd just use the
$_GET['action'] alias.

You can safely turn register_globals on if you're the only guy that runs
scripts on that server and your scripts will never have to run on a server
where it is off. If not you should do it for yourself in .htaccess or with
ini_set(). Just be sure you are careful to initialize all internal variables
that don't come directly from user input.

Joe Kupiszewski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I didn't do the installation, but the phpinfo() shows the following:

 version - 4.2.3

 ./configure' '--with-apxs=/usr/local/sbin/apxs'
 '--with-config-file-path=/usr/local/etc' '--enable-versioning'
 '--with-regex=system' '--without-gd' '--without-mysql' '--with-zlib'
 '--with-mysql=/usr/local' '--prefix=/usr/local' 'i386-portbld-freebsd4.7'

 and the php path info is listed as
 /usr/local/etc

 I do have root access as this is not a production machine, but for the
life
 of me cannot seem to get it to read the php.ini file.  I believe php and
 apache are interacting properly, or I wouldn't get the phpinfo() to work.

 The root of my real problem is that in trying to pass variable values from
 php scripts to reinvocations of the same script using
 http://pathtofile.php?action=3

 I realize that this is a register_globals thing and that I can access it
by
 one of two ways:

 1)  Turning register_globals on (which many tell me is a security risk)
 2)  Using $_REQUEST[action]
 3)  $HTTP_POST_VARS and $HTTP_GET_VARS - with [action]

 However, using the second (haven't tried the 3rd) method and trying to
 incorporate this variable value into an sql statement it bombs.  This may
be
 more appropriate for an sql post, but thought I would throw it up here and
 see if anyone can shed some light as to how php is interpreting 2) and 3)

 One workaround I have started with was just assigning the
 $_REQUEST[action] value to a new local variable and just using that, but
 it seems like there would be an easier way and that this method is just a
 lot of wasted work.

 Thanks for any thoughts and I am happy to post add'l script details.

 Joe...





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



Re: [PHP] Installation

2003-03-26 Thread John Nichel
RTFM

http://www.php.net/manual/en/install.windows.php

Download

http://www.php.net/downloads.php

For Apache

http://httpd.apache.org

For MySQL

http://www.mysql.com

Daniel Perry wrote:
Dear Sir
 
I require a complete installation package if possible.  I am operating
XP Pro, but unfortunately not IIS.  The problems that I have experienced
trying to obtain IIS has made me decide to use Apache as my web server
along with PHP and MySQL.  
 
Please would you provide a direct link that will allow a complete
installation of the three so that I can begin working on my Website?  I
have visited the website and installation page, although a good
advertisement for a complete packageis present there is no way to
download the files.
 
A second question I have; I have Studio MX (Dreamweaver MX, Flash MX,
Fireworks etc), within a menu there is an option to select PHP pages
(build a PHP page etc)  does this mean that I can design my page in
Dreamweaver then as I would have the installation (as above) I could
then view my pages?
 
Please advise.  Thankyou for your time.
 
Kind regards
Daniel Perry
 
Innovative Design
[EMAIL PROTECTED]
Tel: 0210 387 852
 



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


Re: [PHP] Default setting garbage

2003-03-26 Thread CPT John W. Holmes
  I'll guess that you're trying to access $frequency outside of the
  function, after you've called it, right? If so, read up on variable
  scope in the manual.

 No, I'm trying to access it inside the function. This is what I have (or
an
 example, since I don't have it right in front of me right now):

 function func($a = 1, $b = 2) {
 print([$a]);
 }

 From the above example, I get [] as output.

Well, my guess was wrong. I guess it has to happen eventually. :)

So how are you calling the function? If you have:

function func($a=1,$b=2)
{ print([$a]); }
func();

all by itself, does it work? No reason it shouldn't. Maybe you think you're
passing a value to func(), but you're really not. In order to get what you
say, you _have_ to be passing an empty string as the first parameter.

Wait... you realize that if you call

func('');

That $a in the function will be an empty string, right? $b would get the
default value of 2. They would only get that default value if you do not
include that parameter in the function call at all.

---John Holmes...


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



Re: [PHP] Checkbox

2003-03-26 Thread Reuben D. Budiardja
On Wednesday 26 March 2003 09:16 am, shaun wrote:
 Hi,

 is it possible to have a checkbox that if it is specified to be checked
 when the page is being formulated then it cannot be unchecked?

When you write the page, if the checkbox is checked initially, write also a 
javascript to prevent it from being uncheck. Something like this:

INPUT TYPE=CHECKBOX onClick=this.checked=true; CHECKED

So everytime it's clicked, the javascript will make sure that it's checked 
again.

HTH
-RDB


-- 
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-


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



Re: [PHP] Default setting garbage

2003-03-26 Thread Jason Wong
On Thursday 27 March 2003 02:04, Liam Gibbs wrote:
  I'll guess that you're trying to access $frequency outside of the
  function, after you've called it, right? If so, read up on variable
  scope in the manual.

 No, I'm trying to access it inside the function. This is what I have (or an
 example, since I don't have it right in front of me right now):

 function func($a = 1, $b = 2) {
 print([$a]);
 }

 From the above example, I get [] as output.

This works as expected:

  function func($a = 1, $b = 2) {
print([$a]);
  } 
  func(); // prints: [1]

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Insufficient facts always invite danger.
-- Spock, Space Seed, stardate 3141.9
*/


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



Re: [PHP] Selecting date range from database

2003-03-26 Thread CPT John W. Holmes
 I am trying to select a date range in this format from a database 1-Mar-03
 to 26-Mar-03. The date is stored in a mySQL database in that format and
when
 doing a normal select it just selects the dates as if they are numbers.

 How can I make this select work the way I want it to work? I am using the
 following query:

 SELECT * FROM members WHERE member_date = '01-Mar-03' AND member_date =
 '26-Mar-03'  ORDER BY member_date;

Your dates are just strings. You can't say whether one string is greater or
less than another. How do you expect MySQL to know they are dates.

Use a DATE column like you're supposed to, and you can do the query just
like you have it above. The MySQL format for dates is -MM-DD. You can
use the DATE_FORMAT() function to re-format it back into DD-MMM-YY if that's
what you really need to show. Or, you could do the whole thing with Unix
timestamps and and INT column.

The way you have it now, you're kind of screwed.

---John Holmes...


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



Re: [PHP] MySQL's connection information.

2003-03-26 Thread Ray Hunter
Ed

A good practice is to have your configuration files out of the webserver
document directory.  You should set the include_path in the php.ini file
to include the directory where your configuration file is located at.
You can also change the permission to 600 and change the owner to
whatever user/group apache is running under.

--
Ray


On Wed, 2003-03-26 at 09:46, Edmond Baroud wrote:
 Hi all,
 
 I've been using php in a local Unix environement where I never had to worry about 
 read permissions of users/groups on my db connection's config file which contains 
 the user and password. I'm trying to think of a possible solution for my connection 
 properties in a shared/hosting environement where users/groups *might* have read 
 access to my files.
 
 Any suggestions would be appreciated.
 
 Ed.
 
 -- 
 Edmond Baroud 
 Senior UNIX sysadmin mailto:[EMAIL PROTECTED]
 Fingerprint  140F 5FD5 3FDD 45D9 226D  9602 8C3D EAFB 4E19 BEF9
 UNIX is very user friendly, it's just picky about who its friends are.
 
 


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



Re: [PHP] Checkbox

2003-03-26 Thread CPT John W. Holmes
 is it possible to have a checkbox that if it is specified to be checked
 when the page is being formulated then it cannot be unchecked?

No. No... No.

If you already know you don't want it to be unchecked, then don't show a
checkbox. That's why we have PHP, so you can create your page DYNAMICALLY
and not show bits and pieces when you don't need to.

There are plenty of JavaScript or other workarounds you can do, but you
still need to verify _everything_ on the server side and don't accept any
changed value.

---John Holmes...


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



Re: [PHP] again: IIS vs Apache

2003-03-26 Thread Daniel Guerrier
The the LAMP platform is supposed to more stable but 
If it ain't broke why fix it?

--- [EMAIL PROTECTED] wrote:
 Hi, I'm new here. I imagine that this question was
 made a lot of times in this 
 list, but reading the archive i couldnt find a
 recently answer to this 
 question: 
 
I want to convince my new lab partners (and
 director) to migrate our PHP 
 site (over 1000 hits a day) to Apache/Linux. Could
 you give me some actual 
 arguments or site to tell them? Is the Apache PHP
 module really better  than 
 the isapi module for IIS. 
 
 thanks in advance. Matts
 
 
 
 -
 This mail sent through IMP:
 http://mail.info.unlp.edu.ar/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread Jason Wong
On Wednesday 26 March 2003 22:31, Steve Jackson wrote:

 After much searching I found this
 http://marc.theaimsgroup.com/?l=php-generalm=104210703824057w=2
 This
 http://marc.theaimsgroup.com/?l=php-generalm=104219587732145w=2

 And others with process in the body and subject line but not any of the
 thread you refer to.

OK, the latter thread explains pretty much what you need to do if you're using 
sendmail as your MTA. But no matter what MTA you're using, the PHP script is 
going to be more or less the same:


1) read in the email through STDIN
2) parse it
3) do whatever you need with the data


How you invoke this script depends on what MTA you use. For example with qmail 
you just create a dot-qmail file with the following line:

| /path/to/your/script.php

Similar mechanisms exists for courier-mta and postfix.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The revolution will not be televised.
*/


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



Re: [PHP] Checkbox

2003-03-26 Thread Reuben D. Budiardja
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
  is it possible to have a checkbox that if it is specified to be checked
  when the page is being formulated then it cannot be unchecked?

 No. No... No.

 If you already know you don't want it to be unchecked, then don't show a
 checkbox. That's why we have PHP, so you can create your page DYNAMICALLY
 and not show bits and pieces when you don't need to.

Although that is theoretically correct, there can be some reason why one would 
want to display a checkbox anyway. Sometimes it can be clearer for the user 
to see the GUI, asthetic reason, etc, etc. 

 There are plenty of JavaScript or other workarounds you can do, but you
 still need to verify _everything_ on the server side and don't accept any
 changed value.

Of course, that's obvious. I see the question from the user interface point of 
view. Functionally, the javascript doesn't do anything, except give the 
original poster what he wants.

RDB

-- 
-
/\  ASCII Ribbon Campaign against HTML
\ /  email and proprietary format
 X   attachments.
/ \
-
Have you been used by Microsoft today?
Choose your life. Choose freedom.
Choose LINUX.
-


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



Re: [PHP] Checkbox

2003-03-26 Thread CPT John W. Holmes
On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
   is it possible to have a checkbox that if it is specified to be
checked
   when the page is being formulated then it cannot be unchecked?
 
  No. No... No.
 
  If you already know you don't want it to be unchecked, then don't show a
  checkbox. That's why we have PHP, so you can create your page
DYNAMICALLY
  and not show bits and pieces when you don't need to.

 Although that is theoretically correct, there can be some reason why one
would
 want to display a checkbox anyway. Sometimes it can be clearer for the
user
 to see the GUI, asthetic reason, etc, etc.

True. In that case, though, I would just show an image of a checked check
box. The end result will be the same to the user, they will just think it's
a checkbox they cannot uncheck.

---John Holmes...


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



Re: [PHP] Checkbox

2003-03-26 Thread Reuben D. Budiardja
On Wednesday 26 March 2003 02:11 pm, CPT John W. Holmes wrote:
 On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
 checked
when the page is being formulated then it cannot be unchecked?
  
   No. No... No.
  
   If you already know you don't want it to be unchecked, then don't show
   a checkbox. That's why we have PHP, so you can create your page
 DYNAMICALLY
   and not show bits and pieces when you don't need to.
 
  Although that is theoretically correct, there can be some reason why one
 would
  want to display a checkbox anyway. Sometimes it can be clearer for the
 user  to see the GUI, asthetic reason, etc, etc.

 True. In that case, though, I would just show an image of a checked check
 box. The end result will be the same to the user, they will just think it's
 a checkbox they cannot uncheck.

But isn't it so much easier to type in that one line HTML + javascript than 
trying to get an image of a checked check box.. unless you have that 
handy, you'd have to eg. take a snapshot, or draw something, then save the 
file as an image file...hmm...

and as you said, the effect will be the same to the user anyway

RDB


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



Re: [PHP] Checkbox

2003-03-26 Thread Tim Burden
Just using the readonly flag in the input tag is the easiest method, I
think.

- Original Message -
From: Reuben D. Budiardja [EMAIL PROTECTED]
Newsgroups: php.general
To: CPT John W. Holmes [EMAIL PROTECTED]; shaun
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 2:26 PM
Subject: Re: [PHP] Checkbox


On Wednesday 26 March 2003 02:11 pm, CPT John W. Holmes wrote:
 On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
 checked
when the page is being formulated then it cannot be unchecked?
  
   No. No... No.
  
   If you already know you don't want it to be unchecked, then don't show
   a checkbox. That's why we have PHP, so you can create your page
 DYNAMICALLY
   and not show bits and pieces when you don't need to.
 
  Although that is theoretically correct, there can be some reason why one
 would
  want to display a checkbox anyway. Sometimes it can be clearer for the
 user  to see the GUI, asthetic reason, etc, etc.

 True. In that case, though, I would just show an image of a checked check
 box. The end result will be the same to the user, they will just think
it's
 a checkbox they cannot uncheck.

But isn't it so much easier to type in that one line HTML + javascript than
trying to get an image of a checked check box.. unless you have that
handy, you'd have to eg. take a snapshot, or draw something, then save the
file as an image file...hmm...

and as you said, the effect will be the same to the user anyway

RDB


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



[PHP] Re: php.ini question

2003-03-26 Thread Tim Burden
does phpinfo(32) show the $action variable anywhere? If so just use the
global array variable it shows up under. Personally I'd just use the
$_GET['action'] alias.

You can safely turn register_globals on if you're the only guy that runs
scripts on that server and your scripts will never have to run on a server
where it is off. If not you should do it for yourself in .htaccess or with
ini_set(). Just be sure you are careful to initialize all internal variables
that don't come directly from user input.


- Original Message -
From: Joe Kupiszewski [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 12:56 PM
Subject: php.ini question


 I didn't do the installation, but the phpinfo() shows the following:

 version - 4.2.3

 ./configure' '--with-apxs=/usr/local/sbin/apxs'
 '--with-config-file-path=/usr/local/etc' '--enable-versioning'
 '--with-regex=system' '--without-gd' '--without-mysql' '--with-zlib'
 '--with-mysql=/usr/local' '--prefix=/usr/local' 'i386-portbld-freebsd4.7'

 and the php path info is listed as
 /usr/local/etc

 I do have root access as this is not a production machine, but for the
life
 of me cannot seem to get it to read the php.ini file.  I believe php and
 apache are interacting properly, or I wouldn't get the phpinfo() to work.

 The root of my real problem is that in trying to pass variable values from
 php scripts to reinvocations of the same script using
 http://pathtofile.php?action=3

 I realize that this is a register_globals thing and that I can access it
by
 one of two ways:

 1)  Turning register_globals on (which many tell me is a security risk)
 2)  Using $_REQUEST[action]
 3)  $HTTP_POST_VARS and $HTTP_GET_VARS - with [action]

 However, using the second (haven't tried the 3rd) method and trying to
 incorporate this variable value into an sql statement it bombs.  This may
be
 more appropriate for an sql post, but thought I would throw it up here and
 see if anyone can shed some light as to how php is interpreting 2) and 3)

 One workaround I have started with was just assigning the
 $_REQUEST[action] value to a new local variable and just using that, but
 it seems like there would be an easier way and that this method is just a
 lot of wasted work.

 Thanks for any thoughts and I am happy to post add'l script details.

 Joe...




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



Re: [PHP] Default setting garbage

2003-03-26 Thread Tim Burden
Obviously PHP got confused with your data types. I'll bet that $basedate had
been set to 5. Try this instead:

GetNextDate(4, 2003-03, 5);

Now I bet $frequency is 5 and $basedate is 



- Original Message -
From: Liam Gibbs [EMAIL PROTECTED]
Newsgroups: php.general
To: php list [EMAIL PROTECTED]
Sent: Tuesday, March 25, 2003 4:43 PM
Subject: Re: [PHP] Default setting garbage


 Good question.  Are you certain your not misspelling frequency when
you
 check it or try to look at it?  Sorry if that sounds insulting.. just
trying
 to search for the simplest explaination.  :  

 No, no. Not insulting at all. That's often my problem. But not in this
case.
 I even went to the 'trouble' of copying and pasting $frequency wherever I
 needed.


 Original problem:
  Why is it that when I send call this function:
  function GetNextDate($whichfriday, $month = , $frequency = 1,
$basedate
 =
  )
 
  with this line:
  GetNextDate(4, 2003-03, 5);
 
  that $frequency ends up ? Whether I set it myself when I call the
  function, or I leave it blank and let the function set it itself, it
ends
 up
  with nothing in it. empty() returns 1, while isset() returns nothing on
  this.



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



RE: [PHP] Checkbox

2003-03-26 Thread Sysadmin
I agree...and like John said, as long as you don't accept any changes 
when you process the form you should be good to go...

-Original Message-
From: Tim Burden [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 2:25 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Checkbox


Just using the readonly flag in the input tag is the easiest method, I
think.

- Original Message -
From: Reuben D. Budiardja [EMAIL PROTECTED]
Newsgroups: php.general
To: CPT John W. Holmes [EMAIL PROTECTED]; shaun
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 2:26 PM
Subject: Re: [PHP] Checkbox


On Wednesday 26 March 2003 02:11 pm, CPT John W. Holmes wrote:
 On Wednesday 26 March 2003 01:43 pm, CPT John W. Holmes wrote:
is it possible to have a checkbox that if it is specified to be
 checked
when the page is being formulated then it cannot be unchecked?
  
   No. No... No.
  
   If you already know you don't want it to be unchecked, then don't 
show
   a checkbox. That's why we have PHP, so you can create your page
 DYNAMICALLY
   and not show bits and pieces when you don't need to.
 
  Although that is theoretically correct, there can be some reason 
why one
 would
  want to display a checkbox anyway. Sometimes it can be clearer for 
the
 user  to see the GUI, asthetic reason, etc, etc.

 True. In that case, though, I would just show an image of a checked 
check
 box. The end result will be the same to the user, they will just think
it's
 a checkbox they cannot uncheck.

But isn't it so much easier to type in that one line HTML + javascript 
than
trying to get an image of a checked check box.. unless you have that
handy, you'd have to eg. take a snapshot, or draw something, then save 
the
file as an image file...hmm...

and as you said, the effect will be the same to the user anyway

RDB


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

2003-03-26 Thread CPT John W. Holmes
 But isn't it so much easier to type in that one line HTML + javascript
than
 trying to get an image of a checked check box.. unless you have that
 handy, you'd have to eg. take a snapshot, or draw something, then save the
 file as an image file...hmm...

 and as you said, the effect will be the same to the user anyway

Yeah, really doesn't matter how you do it, I guess. Just so long as you
check the data after it's submitted again and determine whether the value
should have been allowed to change or not. If it wasn't allowed to change,
then don't accept the value that was passed (because it may of changed
regardless of what measures you take).

Like you said, hopefully that part is obvious, though. :)

---John Holmes...


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



RE: [PHP] getimagesize

2003-03-26 Thread Dan Rossi
@getimagesize ?

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 5:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] getimagesize


anyway to not get an error when doing getimagesize if you get this response?
HTTP request failed! HTTP/1.1 404 Not Found



--
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] What am I not understanding about $GLOBALS['myvar'] vs global $myvar?

2003-03-26 Thread Daevid Vincent
How come this function works, but the one below does not?? 

function clearContactVars()
{
  global $contact_id;   $contact_id = ;
  global $contact_timestamp;$contact_timestamp = ;
  global $contact_incept;   $contact_incept = ;
  global $contact_dept_table_id;$contact_dept_table_id = ;
  global $contact_fname;$contact_fname = ;
  global $contact_lname;$contact_lname = ;
  global $contact_title;$contact_title = ;
  global $contact_phone;$contact_phone = ;
  global $contact_email;$contact_email = ;
  global $contact_address1; $contact_address1 = ;
  global $contact_address2; $contact_address2 = ;
  global $contact_city; $contact_city = ;
  global $contact_state;$contact_state = ;
  global $contact_zip;  $contact_zip = ;
  global $contact_country;  $contact_country = ;
  global $contact_notes;$contact_notes = ;
}

This one does NOT work the way I would expect it to?

function clearContactVars()
{
foreach ($GLOBALS as $key = $value) {
if ( substr($key,0,8) == contact_ ) {
  //echo GLOBALS['$key'] = $valuebr\n;
  $GLOBALS['$key'] = ;
}
}
clearPostVars();
}

(this is located in an require() file and do I even need to do this?):
function clearPostVars()
{   
foreach ($_POST as $key = $value) {
//echo _POST['$key'] = Value: $valuebr\n;
$_POST['$key'] = ;
}
}

I use these variables on a web page like so:

TR
TD ALIGN=RIGHTBPhone:/B/TD
TDINPUT Name=contact_phone Value=?=$contact_phone?/TD
/TR

So after a successful insert/update/whatever, I need to clear the fields.

The only other relevant part is that at the top of each page in a require()
file, I have this:

reset ($_POST);
while (list ($key, $val) = each ($_POST)) {
//echo $key = $valbr\n;
$$key = $val;
}

But it doesn't make sence to me that the first function does in fact clear
the variables, when the second one does not. I thought that would be even
more direct, since global $contact_id from what I read is only a reference
to the global variable named $contact_id. Which in effect should be exactly
$GLOBALS['contact_id'] right?
http://www.php.net/manual/tw/migration4.variables.php


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



Re: [PHP] openssl php 4.3.1

2003-03-26 Thread Kalin Mintchev

how are we doing on this?!?...
this'd be my last try to seek help here... i did on a few other mailing
lists and forums but nobody has anything to say...  i guess i'd never get
ssl connection with php regardless of what it's in the documentation on
the php.net site...


On Tue, 25 Mar 2003, Kalin Mintchev wrote:


 part 2:
 ---

 got curl 7.10.3 (latest version)...
 recompiled php 4.3.1 with curl. no errors. shows up fine on phpinfo...
 testing with:

 $ch = curl_init (http://moo.org;);
 $fp = fopen(http://moo.org/index.html;, r);

 curl_setopt ($ch, CURLOPT_FILE, $fp);

 curl_setopt ($ch, CURLOPT_HEADER, 0);

 curl_exec ($ch);
 curl_close ($ch);

  while (!feof($fp)) {
 echo fgets ($fp,128);
 }

 fclose ($fp);

 the file i get back is not the whole file. it comes from the middle or so
 down. i need this to retrieve xml files through https. tried one of those
 files without https - just http - got the last part of the file back. it
 cuts off somewhere..

 i was really happy with fopen() and fsockopen() until the https came up...

 i've been stuck on this for the last 2 days and i really need some kind of
 solution... it's very frustrating that neither of those 3 options in php
 work as expected or documented with the openssl options.

 i tested curl on the command line and it works fine. no cut offs of
 documents anywhere

 please help...

 is there any bugs known anywhere between curl 7.10.3 + php 4.3.1 on
 freeBSD 4.6?


 
  hi all,
 
  i have problems getting fopen() and fsockopen() to work over https..
 
  here is the problem..
 
  from the phpinfo:
 
  OpenSSL support enabled
  OpenSSL Version OpenSSL 0.9.6h 5 Dec 2002
 
  from php -m
 
  # php -m
  [PHP Modules]
  ctype
  mysql
  openssl
  overload
  pcre
  posix
  session
  standard
  tokenizer
  xml
 
  [Zend Modules]
 
 
  from the Appendix I regarding fopen() on php.net:
 
  Note: HTTPS is supported starting from PHP 4.3, if you have compiled in
  support for OpenSSL.
 
  and from the documentation on fsockopen() on php.net:
  As of PHP 4.3.0, if you have compiled in OpenSSL support, you may prefix
  the hostname with either 'ssl://' or 'tls://' to use an SSL or TLS client
  connection over TCP/IP to connect to the remote host.
 
  in a test file i have two lines of code like this:
 
  $file = https://someurl.com;;
  if (!($fp = fopen($file, r)))
 
  this produces an error but it doesn't point to any problem - like this:
  Warning: fopen(https://someurl.com..  in /path/to/file.php on line
  45
 
  if i change $file to http://someurl.com; it works fine...
 
  with fsockopen() the situation is kinda the same. code:
  $fp=fsockopen(ssl://www.foo.com, 443);
 
  error:
  Warning: fsockopen() [function.fsockopen]: no SSL support in this build in
  /path/to/file/...
 
  if i pul out the ssl:// part it works fine...
 
  now, i did read the posts on this list about curl. why curl isn't
  mentioned anywhere in the documentation for fopen() and fsockopen() if
  it's needed for those functions?
  why would i need curl compiled in php if i already have openssl compiled with
  it?
 
  the machine i'm using is a freeBSD 4.6 box with apache 1.3.27 and OpenSSL
  0.9.6h, php is 4.3.1...
 
  i did similar posts on other php lists but everybody's quite..
 
  thanks
 
 
 
 
 




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



[PHP] ISP Blues

2003-03-26 Thread Anthony Ritter
The following script works fine when I test it at home using localhost on:

MS Win 98
Apache Server
PHP 4.1.1
php_gd.dll

I then publish the script to my web at my ISP's MS IIS server which is the
host and get an undefined function call of:

ImageCreate()

The ISP has said that they have installed php_gd.dll on their server but I
get that error.

I have run php scripts on this site _without_ the gd libraries.

Could somebody please advise how they should be installing the .dll file so
I can utlize the gd_libraries with php?

Many thanks,
Tony Ritter
..

The script...
?
$new_w=50;
$new_h=50;

header(Content-type: image/png);
header(Content-type: text/html);
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromPng(./square.png);

ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),I
mageSY($src_img));

ImagePng($dst_img);

echo This is a square.;
?




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



Re: [PHP] What am I not understanding about $GLOBALS['myvar'] vsglobal $myvar?

2003-03-26 Thread Marek Kilimajer


Daevid Vincent wrote:

This one does NOT work the way I would expect it to?

function clearContactVars()
{
foreach ($GLOBALS as $key = $value) {
if ( substr($key,0,8) == contact_ ) {
  //echo GLOBALS['$key'] = $valuebr\n;
  $GLOBALS['$key'] = ;
I did not read your whole message, but you very likely mean

$GLOBALS[$key] = ;
(no single quotes)
}
}
clearPostVars();
}
 



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


Re: [PHP] ISP Blues

2003-03-26 Thread Marek Kilimajer
Try executing
dl('php_gd.dll');
first (before calling any gd functions),
also check the output of phpinfo() if they have gd enabled
Anthony Ritter wrote:

The following script works fine when I test it at home using localhost on:

MS Win 98
Apache Server
PHP 4.1.1
php_gd.dll
I then publish the script to my web at my ISP's MS IIS server which is the
host and get an undefined function call of:
ImageCreate()

The ISP has said that they have installed php_gd.dll on their server but I
get that error.
I have run php scripts on this site _without_ the gd libraries.

Could somebody please advise how they should be installing the .dll file so
I can utlize the gd_libraries with php?
Many thanks,
Tony Ritter
..
The script...
?
$new_w=50;
$new_h=50;
header(Content-type: image/png);
header(Content-type: text/html);
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromPng(./square.png);
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),I
mageSY($src_img));
ImagePng($dst_img);

echo This is a square.;
?


 



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


Re: [PHP] ISP Blues

2003-03-26 Thread Anthony Ritter
Marek,
For testing purposes, on my home computer with php 4.1.1 and Apache Server,
the script works fine.

Now, I'd like the script to work on my ISP's server which hosts my site.

They use MS IIS.

What are the correct steps for them to install the php_gd.dll file on their
server since that same script is causing an error when published to the web.

Many thanks,
Tony Ritter


1.


2.


3.

etc...

---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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



RE: [PHP] What am I not understanding about $GLOBALS['myvar'] vs global $myvar?

2003-03-26 Thread Daevid Vincent
Actually I didn't.  ;-)

$GLOBALS[$key] is incorrect and depricated AFAIK.
$GLOBALS['$key'] (with the single quotes) is the proper way to write these
types of associative arrays/hashs.

For shits and giggles however I tried your way and it made no difference to
the code. Still didn't work right.

 -Original Message-
 From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, March 26, 2003 1:16 PM
 To: Daevid Vincent
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP] What am I not understanding about 
 $GLOBALS['myvar'] vs global $myvar?
 
 
 
 
 Daevid Vincent wrote:
 
 This one does NOT work the way I would expect it to?
 
  function clearContactVars()
  {
  foreach ($GLOBALS as $key = $value) {
  if ( substr($key,0,8) == contact_ ) {
//echo GLOBALS['$key'] = $valuebr\n;
$GLOBALS['$key'] = ;
 
 I did not read your whole message, but you very likely mean
 
 $GLOBALS[$key] = ;
 (no single quotes)
 
  }
  }
  clearPostVars();
  }
 
   
 
 
 
 -- 
 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] What am I not understanding about $GLOBALS['myvar'] vs global $myvar?

2003-03-26 Thread Johnson, Kirk
I think you either want to use no quotes or double quotes, but not single
quotes. Double quotes will interpolate the variable, single quotes will not,
i.e. $key becomes a string literal rather than a variable. No quotes will
work, although the docs seem to indicate it is deprecated syntax. Not
everyone agrees that it is deprecated, though ;)

Kirk

 $GLOBALS[$key] is incorrect and depricated AFAIK.
 $GLOBALS['$key'] (with the single quotes) is the proper way 
 to write these
 types of associative arrays/hashs.

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



RE: [PHP] What am I not understanding about $GLOBALS['myvar'] vs global $myvar?

2003-03-26 Thread Jennifer Goodie
Actually I didn't.  ;-)

$GLOBALS[$key] is incorrect and depricated AFAIK.
$GLOBALS['$key'] (with the single quotes) is the proper way to write these

Wouldn't it need to be $GLOBALS[$key] because single quotes tell the
parser not to expand variables? I think you are misinterpreting the part of
the manual that says You should always use quotes around an associative
array index.  Even though a variable may contain a string it is not a
string and therefore does not need quoting because there is not danger of it
being interpreted as a constant.  Look at the manual page on arrays, it
shows arrays with variable indices without quotes.
http://www.php.net/manual/en/language.types.array.php






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



[PHP] HELP ME NEW FRIENDS....

2003-03-26 Thread Hector Huaranga Segales
HI

my English is no too god ...but

i need information about forms with PHP, data base query,  i need examples
plz...

thanks in advanced

Re: [PHP] What am I not understanding about $GLOBALS['myvar'] vs global $myvar?

2003-03-26 Thread Leif K-Brooks
No, you misunderstand.  The key is simply a string.  Just as print 
foo; is wrong, $array[foo] is wrong (unless foo is a constant, of 
course).  If you do print '$variable';, it will print the literal 
string $variable.  It will not print the value of $variable.  You 
should either use double quotes or no quotes.

Johnson, Kirk wrote:

I think you either want to use no quotes or double quotes, but not single
quotes. Double quotes will interpolate the variable, single quotes will not,
i.e. $key becomes a string literal rather than a variable. No quotes will
work, although the docs seem to indicate it is deprecated syntax. Not
everyone agrees that it is deprecated, though ;)
Kirk

 

$GLOBALS[$key] is incorrect and depricated AFAIK.
$GLOBALS['$key'] (with the single quotes) is the proper way 
to write these
types of associative arrays/hashs.
   

 

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



[PHP] RE: Mac IE File download problem - any solutions?

2003-03-26 Thread Daniel Leighton
Hi Phillip,

If you see the original message it's already in there (it was snipped out in the 
replies).  Here is the code:

header('Content-Type: application/octet-stream');
header('Content-Length: '. filesize($file_info['full_file_path']));
header('Content-Disposition: attachment; filename=' .
   $file_info['filename'] . '');
header('Connection: close');

readfile($file_info['full_file_path']);

Any other ideas?  Thanks for your help.

Daniel


At 10:09 AM -0800 on 3/26/03, Philip Hallstrom wrote:


You might try...

header(Content-Disposition: attachment; filename=$filename);

maybe?

On Tue, 25 Mar 2003, Daniel Leighton wrote:

 Actually, I think you may have misunderstood.  On Mozilla (Mac), Netscape (Mac) and 
 Safari the script works exactly as I have intended: sending the Content-Type: 
 application/octet-stream header causes the file to download; sending the 
 Content-Type: video/quicktime causes the file to be played within the browser.  
 On IE (Mac OS X), some files with the .mov extension download when the 
 Content-Type: application/octet-stream header is sent, while others play 
 in-browser, while all play in-browser, as they should.

 From what I understand, Content-Type: application/octet-stream header should 
 ALWAYS cause a download.  This is not an issue of post-processing (the settings in 
 the browser which tell it to open a file in a certain application AFTER the file 
 has been downloaded - that is not a problem).  BTW, even if I change my preferences 
 in IE to save .mov files to disk, they still play in-browser.

 After re-compiling PHP with mime-magic enabled, the mime_content_type() function is 
 returning video/quicktime for the file which does not download and text/plain 
 for the one which does (even though the text/plain file plays fine both 
 in-browser and once it is downloaded).  In any case, that will be my next area of 
 investigation.

 At 12:03 PM -0800 on 3/25/03, Jennifer Goodie wrote:


 This is not a MAC IE problem, it is the way browsers work.  If the MIME type
 is mapped to an application, the browser will launch the application.  IE
 does it inline, while Netscape tends to launch it separately.
 
 You can send false headers with a made up type and a missing file extension,
 but then the browser will not know what type of file it is and the save as
 is harder for the user as they have to put the right extension on.  It is a
 work around, but a really poor one.
 
 header(Content-disposition: filename=$filenamewithoutextension);
 header(Content-type:reallyreallyreallybigcsv);
  
  
  
  
  -Original Message-
  From: Step Schwarz [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, March 25, 2003 11:49 AM
  To: Daniel Leighton; [EMAIL PROTECTED]
 Subject: Re:  Mac IE File download problem - any solutions?
 
 
 [...]
  The problem:  When downloading certain files on a Mac using IE 5.x, files
 are
  displayed within a browser window instead of downloading.  This seems to
 occur
  mostly with quicktime files (.mov, .mp3).  Some quicktime files work,
 while
  others with the same extension do not.
 [...]
 
 Hi Daniel,
 
 I believe this is a browser setting, is it not?  Using the default setup of
 Explorer 5.2 for Mac, a clicked .mov file will play in IE.
 
 To change this behavior, go to Explorer  Preferences...  File Helpers,
 select QuickTime Movie and click Change... then switch Handling from View
 with Browser to Save to File.
 
 I would be surprised if a file header could override this.. but if you find
 a way, please let us know!
 
 -Step
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 --

 Daniel Leighton
 Chief Technology Officer
 Webolution
 http://www.webolution.com

  This email may contain material that is confidential and privileged for the
  sole use of the intended recipient.  Any review, reliance or distribution
 by others or forwarding without express permission is strictly prohibited.
 If you are not the intended recipient, please contact the sender and delete
 all copies.

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


-- 

Daniel Leighton
Chief Technology Officer
Webolution
http://www.webolution.com

 This email may contain material that is confidential and privileged for the
sole use of the intended recipient.  Any review, reliance or distribution
by others or forwarding without express permission is strictly prohibited.
If you are not the intended recipient, please contact the sender and delete
all copies.

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



[PHP] register globals :|

2003-03-26 Thread Sebastian
Is there any work-around to get a scipt that requires globals to be ON work
when globals is OFF?

Its a small script so it shouldn't be too hard... I just don't know what to
look for or what has to be changed so it works again... (since i moved
servers...)

Thanks for any help.

cheers,
- Sebastian


Re: [PHP] register globals :|

2003-03-26 Thread Sebastian
Hmm .. might be easier to use an .htaccess. Is it possible to enable
Register Global just for the script and not the site? I heard it's possible
to enable it on just one directory (where the script resides).

cheers,
- Sebastian

- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]


| http://www.php.net/manual/en/function.import-request-variables.php at
| the top of the script, or use .htaccess to change RG to on.
|
| Sebastian wrote:
|
| Is there any work-around to get a scipt that requires globals to be ON
work
| when globals is OFF?
| 
| Its a small script so it shouldn't be too hard... I just don't know what
to
| look for or what has to be changed so it works again... (since i moved
| servers...)
| 
| Thanks for any help.
| 
| cheers,
| - Sebastian
| 
| 
| 
|
| --
| The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
|
|
|


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



Re: [PHP] register globals :|

2003-03-26 Thread Kevin Stone

- Original Message -
From: Sebastian [EMAIL PROTECTED]
To: php list [EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 3:45 PM
Subject: [PHP] register globals :|


 Is there any work-around to get a scipt that requires globals to be ON
work
 when globals is OFF?

 Its a small script so it shouldn't be too hard... I just don't know what
to
 look for or what has to be changed so it works again... (since i moved
 servers...)

 Thanks for any help.

 cheers,
 - Sebastian


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

You'll find examples at the bottom of the page of some code that you can add
to the script.  Or if you know where the input for the script is coming from
then you can use extract($_POST) or extract($_SERVER), or whatever, at the
top of the script.

HTH,
Kevin



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



[PHP] Problem with setcookie function

2003-03-26 Thread Tomás Liendo
Hi people I'm a beginner...
I'm trying to pass variables between pages, I need use a variable that I get
in the first page, 3 or 4 pages later on. For this I'm using the setcookie
function:

setcookie(name, Jhon Malbeck);

The problem is that I receipt only the value Jhon

Why I don't receipt all the string

Well, from already thank you very much,

Tom.



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



Re: [PHP] Web server request redirection

2003-03-26 Thread Jan Walter
Ray Hunter wrote:
 Are both servers running on the same computer? If so you can send data
 via the port number they are on.
They are two:
1/ php+apache/linux webserver (reachable from outside)
2/ iis/w2k running web service (behind firewall)
 You can also create scripts that receive post data and then submit that
 data to another server via php or other scripting language.
Yeah, that's what I was asking for: how?
I can simply catch the outer request via $HTTP_RAW_POST_DATA but don't 
know, how most effeciently process the result coming from windows machine.

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


RE: [PHP] Problem with setcookie function

2003-03-26 Thread Jennifer Goodie
TRy URL Encoding the string.

-Original Message-
From: Tomás Liendo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with setcookie function


Hi people I'm a beginner...
I'm trying to pass variables between pages, I need use a variable that I get
in the first page, 3 or 4 pages later on. For this I'm using the setcookie
function:

setcookie(name, Jhon Malbeck);

The problem is that I receipt only the value Jhon

Why I don't receipt all the string

Well, from already thank you very much,

Tom.


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



[PHP] Possible to check quality / compression of a JPEG ?

2003-03-26 Thread Juan Antonio Ruiz Zwollo
Hello:

Is it possible with PHP to check at what quality/compression a JPEG file has
been saved? I.e. I have dummy.jpg that I got from somewhere else and I
want to know with what quality it was saved.

The second Note of the User Contributed Notes on the PHP manual regarding
the function imagejpeg (http://www.php.net/manual/en/function.imagejpeg.php)
mentions such a code, and the user hints that he/she is able to read the
quality of a jpeg, but there is no code given (I have tried contacting the
user but the comment is quite old):
==
If you call imagecreatefromjpeg and load a jpeg with 75% quality and output
it with imagejpeg u can specify the new quality for e.g. 90% and u can
increase quality, but output will look like 75% quality picture with the
only difference that the new pic is bigger.

So u should check the source quality before u alter output quality. In most
cases a quality of 75% is sufficient. For previews i use 50%.

But i make a check if source quality is lower than my personal output
quality, i will not chance source quality !

Hope that helps your Webserver and keeps the traffic low :-)
==

Regards,


Juan Antonio



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



Re: [PHP] substr() on part an ereg() capture

2003-03-26 Thread Justin French
A that makes more sense!!  Am trying everyone's suggestions now...

Justin French


on 27/03/03 3:32 AM, Marek Kilimajer ([EMAIL PROTECTED]) wrote:

 Forgot to mention this is to be run after
 eregi_replace(([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/=]), a
 href=\\\1://\\2\\3\ {$t}\\\1://\\2\\3/a, $str);
 as it only replaces long strings within a tags
 
 
 Marek Kilimajer wrote:
 
 $str = preg_replace('|(a[^]*[^]{55})[^]+(/a)|','$1...$2', $str);
 
 Justin French wrote:
 
 Hi, I have this ereg to turn URLs into links:
 
 eregi_replace(([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/=]), a
 href=\\\1://\\2\\3\ {$t}\\\1://\\2\\3/a, $str);
 
 ... found it in the manual i think, or maybe on weberdev.com examples
 
 
 Anyhoo, it places the whole link in between the a... and /a,
 which is
 fine for short links, but on longer links (in my case, around 60+
 chars), it
 messes with my table or CSS layout.
 
 So, I'd like to subtr() the 2nd capture part down to 55 chars or
 something
 IF it's longer than 60, and append a ... to it.
 
 ANY ideas on how this is done?  Or is this beyond regexp??
 
 
 TIA
 
 Justin
 
 
 
 
 
 
 


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



RE: [PHP] Possible to check quality / compression of a JPEG ?

2003-03-26 Thread daniel
would exif work ? or maybe the binary jhead would work, it gets information 
out fo jpeg files , but they maybe have to be generated only from digital 
cameras i dont know.

= Original Message From Juan Antonio Ruiz Zwollo [EMAIL PROTECTED] 
=
Hello:

Is it possible with PHP to check at what quality/compression a JPEG file has
been saved? I.e. I have dummy.jpg that I got from somewhere else and I
want to know with what quality it was saved.

The second Note of the User Contributed Notes on the PHP manual regarding
the function imagejpeg (http://www.php.net/manual/en/function.imagejpeg.php)
mentions such a code, and the user hints that he/she is able to read the
quality of a jpeg, but there is no code given (I have tried contacting the
user but the comment is quite old):
==
If you call imagecreatefromjpeg and load a jpeg with 75% quality and output
it with imagejpeg u can specify the new quality for e.g. 90% and u can
increase quality, but output will look like 75% quality picture with the
only difference that the new pic is bigger.

So u should check the source quality before u alter output quality. In most
cases a quality of 75% is sufficient. For previews i use 50%.

But i make a check if source quality is lower than my personal output
quality, i will not chance source quality !

Hope that helps your Webserver and keeps the traffic low :-)
==

Regards,


Juan Antonio



--
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] Using includes with page locations

2003-03-26 Thread Vernon
Please forgive the ignorance of this question but I am trying to use an
include for a site navigation menu and am having a hard time figuring out
how to point at the route of the site.

For instance I may have home set as index.php, but if my users are in
messages/index.php that will always bring that back to the same page. I know
in ASP there is a way to set the root directory, how do I do that in PHP.

Thanks



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



[PHP] Uploading Files Via PHP

2003-03-26 Thread Vernon
Is there some thing that needs to be turned on in the php.ini in order to be
able to upload photos VIA php? I have the same script on one machine with
the right permissions on the upload dirs on one machine and am moving to
another machine which is not being uploaded. Funny thing is I'm not getting
any errors in the Apache logs.

Thanks



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



RE: [PHP] Using includes with page locations

2003-03-26 Thread Jennifer Goodie
You could just make all of your links relative to the webroot.  /index.php
instead of index.php and /messages/index.php and messages/index.php  I
don't know why you would want to use PHP to do this for you, it is a pretty
basic HTML concept.

-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 7:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Using includes with page locations


Please forgive the ignorance of this question but I am trying to use an
include for a site navigation menu and am having a hard time figuring out
how to point at the route of the site.

For instance I may have home set as index.php, but if my users are in
messages/index.php that will always bring that back to the same page. I know
in ASP there is a way to set the root directory, how do I do that in PHP.

Thanks


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



RE: [PHP] Using includes with page locations

2003-03-26 Thread Jennifer Goodie
oops, it should read: /messages/index.php instead of (not and)
messages/index.php

That make make what I said really confusing

-Original Message-
From: Jennifer Goodie [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 4:45 PM
To: Vernon; [EMAIL PROTECTED]
Subject: RE: [PHP] Using includes with page locations


You could just make all of your links relative to the webroot.  /index.php
instead of index.php and /messages/index.php and messages/index.php  I
don't know why you would want to use PHP to do this for you, it is a pretty
basic HTML concept.


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



Re: [PHP] register globals :|

2003-03-26 Thread Leif K-Brooks
Only per-directory, by putting a .htaccess file in that directory which 
turns RG on.

Sebastian wrote:

Hmm .. might be easier to use an .htaccess. Is it possible to enable
Register Global just for the script and not the site? I heard it's possible
to enable it on just one directory (where the script resides).
cheers,
- Sebastian
- Original Message -
From: Leif K-Brooks [EMAIL PROTECTED]
| http://www.php.net/manual/en/function.import-request-variables.php at
| the top of the script, or use .htaccess to change RG to on.
|
| Sebastian wrote:
|
| Is there any work-around to get a scipt that requires globals to be ON
work
| when globals is OFF?
| 
| Its a small script so it shouldn't be too hard... I just don't know what
to
| look for or what has to be changed so it works again... (since i moved
| servers...)
| 
| Thanks for any help.
| 
| cheers,
| - Sebastian
| 
| 
| 
|
| --
| The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent of
the law.
|
|
|
 

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


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


[PHP] Re: HELP ME NEW FRIENDS....

2003-03-26 Thread Mike Mannakee
Simple example here.

You have a page that submits to your php script.  The form on the page is
coded like this:

form action=script.php method=get
input type=text name=variable1
input type=Submit
/form

This, when used, submits to your script, which will have code something like
this:

?
$var = $HTTP_GET_VARS['variable1'];
if(!$link = (code to connect to your database, typically mysql))
{ die(Cannot connect to database); }
$sql = INSERT INTO table values('$var');
if(!$result = mysql_query($sql))
{ die(Cannot insert data); }

etc.

HTH

Mike

Hector Huaranga Segales [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 HI

 my English is no too god ...but

 i need information about forms with PHP, data base query,  i need examples
 plz...

 thanks in advanced



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



[PHP] auto_prepend_file

2003-03-26 Thread Kevin Heflin
Trying to use
php_value auto_prepend_file /path/to/file/checkauth.php
in an .htaccess file.
I've used this before without problems, however with this instance, I 
keep getting a message in my browser which says:
Redirection limit for this URL exceeded.  Unable to load the requested 
page.

my checkauth.php page looks like this

?
session_start();
if (!session_is_registered(SESSION)){
header(Location: /error.php?e=2);
exit;
}
?
Any suggestions would be appreciated.

Kevin

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


Re: [PHP] auto_prepend_file

2003-03-26 Thread Kevin Heflin
On Wednesday, March 26, 2003, at 07:15  PM, Kevin Heflin wrote:

Trying to use
php_value auto_prepend_file /path/to/file/checkauth.php
in an .htaccess file.
I've used this before without problems, however with this instance, I 
keep getting a message in my browser which says:
Redirection limit for this URL exceeded.  Unable to load the requested 
page.

Sorry to answer my own question here.. but it looks like I had a little 
loop going on. :-)
that's what caused the problem. Should have looked in the mailing list 
archive before I posted.
Apologies.

Kevin

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


RE: [PHP] auto_prepend_file

2003-03-26 Thread Jennifer Goodie
You're looping endlessly because SESSION is not getting registered anywhere.

-Original Message-
From: Kevin Heflin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 5:16 PM
To: php-general
Subject: [PHP] auto_prepend_file


Trying to use
php_value auto_prepend_file /path/to/file/checkauth.php
in an .htaccess file.

I've used this before without problems, however with this instance, I 
keep getting a message in my browser which says:
Redirection limit for this URL exceeded.  Unable to load the requested 
page.

my checkauth.php page looks like this

?
session_start();
if (!session_is_registered(SESSION)){
header(Location: /error.php?e=2);
exit;
}
?

Any suggestions would be appreciated.

Kevin



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



Re: [PHP] Uploading Files Via PHP

2003-03-26 Thread Evan Nemerson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Are you getting any errors through PHP? Set error reporting to E_ALL then try.

?php error_reporting(E_ALL); ?




On Wednesday 26 March 2003 04:41 pm, Vernon wrote:
 Is there some thing that needs to be turned on in the php.ini in order to
 be able to upload photos VIA php? I have the same script on one machine
 with the right permissions on the upload dirs on one machine and am moving
 to another machine which is not being uploaded. Funny thing is I'm not
 getting any errors in the Apache logs.

 Thanks

- -- 
All religions are founded on the fear of the many and the cleverness of the 
few.

- -Stendhal
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+glMF/rncFku1MdIRAlN5AJ9n6jN4N8dLQg8OVLZZClgSEJ+qEwCffq6f
XRmpe/CK1i1ecaHRh7t+eLQ=
=snmO
-END PGP SIGNATURE-


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



RE: [PHP] Uploading Files Via PHP

2003-03-26 Thread Jennifer Goodie
http://www.php.net/manual/en/features.file-upload.php

From the page listed above: Related Configurations Note: See also the
file_uploads, upload_max_filesize, upload_tmp_dir, and post_max_size
directives in php.ini

I would read that manual page as it deals with file uploading support.

-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 4:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Uploading Files Via PHP


Is there some thing that needs to be turned on in the php.ini in order to be
able to upload photos VIA php? I have the same script on one machine with
the right permissions on the upload dirs on one machine and am moving to
another machine which is not being uploaded. Funny thing is I'm not getting
any errors in the Apache logs.

Thanks



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



[PHP] html_quickform - array question

2003-03-26 Thread Charles Kline
hi all,

using html_quickform (pear) and it has a date type that passes the date 
info like this:

array(24) {
  [lr_pub_date]=
  array(3) {
[m]=
string(1) 3
[d]=
string(2) 12
[Y]=
string(4) 2003
  }
I am used to getting this data like:

$form-getSubmitValue(field_name);

But doing that with this array just returns: Array

Anyone know how to get to the data?

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


RE: [PHP] auto_prepend_file

2003-03-26 Thread John W. Holmes
 Trying to use
 php_value auto_prepend_file /path/to/file/checkauth.php
 in an .htaccess file.
 
 I've used this before without problems, however with this instance, I
 keep getting a message in my browser which says:
 Redirection limit for this URL exceeded.  Unable to load the requested
 page.
 
 my checkauth.php page looks like this
 
 ?
   session_start();
   if (!session_is_registered(SESSION)){
   header(Location: /error.php?e=2);
   exit;
   }
 ?
 
 Any suggestions would be appreciated.

error.php is probably being prepended with this file, which will fail
your check and try to redirect to error.php, which will fail your check
and try to redirect to error.php, which will fail your check and try to
redirect to error.php, which will fail your check and try to redirect to
error.php, which will fail your check and try to redirect to error.php,
which will fail your check and try to redirect to error.php, which will
fail your check and try to redirect to error.php, which will fail your
check and try to redirect to error.php, which will fail your check and
try to redirect to error.php, which will fail your check and try to
redirect to error.php, which will fail your check and try to redirect to
error.php, which will fail your check and try to redirect to error.php,
which will fail your check and try to redirect to error.php, which will
fail your check and try to redirect to error.php, which will fail your
check and try to redirect to error.php and you'll eventually hit a
limit where your web server or browser will stop. :)

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP] Mail Header - id this PHP

2003-03-26 Thread John W. Holmes
 I am trying to format the mail header that will be send by mail().
 
 One thing that I noticed was it only accept for the first no. of lines
or
 charracters (???) See sample 1  2.
 
 Is this a php problem (4.2.2) or has something to do the mailer ???
 
 This script is working on (4.2.1) but is in different type of server.
 
 FYI, on header sent it has some other default header included
 
 
 
 
 Example. (1)
 
  $mail_headers .= MIME-Version: 1.0\r\n;
  $mail_headers .= From: WEB\n;
  $mail_headers .= Reply-to: $Email\n;
  $mail_headers .= Bcc: [EMAIL PROTECTED];
  $mail_headers .= Content-Type: text/html;
charset=ISO-8859-1\r\n;
  $mail_headers .= Content-Transfer-Encoding:
quoted-printable\r\n;
 
 To: [EMAIL PROTECTED]
 Subject: Test
 From: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Reply-to: [EMAIL PROTECTED]
 MIME-Version: 1.0
 
 Rejected
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 
 Example (2)
 
 
  $mail_headers .= Content-Type: text/html;
charset=ISO-8859-1\r\n;
  $mail_headers .= Content-Transfer-Encoding:
quoted-printable\r\n;
  $mail_headers .= MIME-Version: 1.0\r\n;
  $mail_headers .= From: WEB\n;
  $mail_headers .= Reply-to: $Email\n;
  $mail_headers .= Bcc: [EMAIL PROTECTED];
 
 To: [EMAIL PROTECTED]
 Subject: Test
 Content-Type: text/html; charset=ISO-8859-1
 
 Rejected:
 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0
 From: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Reply-to: [EMAIL PROTECTED]

Use \r\n between all of your headers (at the end of your strings,
above). Just using \n will not work. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP] html_quickform - array question

2003-03-26 Thread Leif K-Brooks
Are you trying to print/echo it? That converts it to a string first. 
Either print_r it, var_dump it, or do something else with it.

Charles Kline wrote:

hi all,

using html_quickform (pear) and it has a date type that passes the 
date info like this:

array(24) {
  [lr_pub_date]=
  array(3) {
[m]=
string(1) 3
[d]=
string(2) 12
[Y]=
string(4) 2003
  }
I am used to getting this data like:

$form-getSubmitValue(field_name);

But doing that with this array just returns: Array

Anyone know how to get to the data?

Thanks
charles

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


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


Re: [PHP] html_quickform - array question

2003-03-26 Thread Charles Kline
Okay. I think I understand. So I do something like this:

$thedate = $lr_form-getSubmitValue('lr_pub_date');

echo The month: $thedate['m'];

Is that what you meant?

- Charles

On Wednesday, March 26, 2003, at 09:31 PM, Leif K-Brooks wrote:

Are you trying to print/echo it? That converts it to a string first. 
Either print_r it, var_dump it, or do something else with it.

Charles Kline wrote:

hi all,

using html_quickform (pear) and it has a date type that passes the 
date info like this:

array(24) {
  [lr_pub_date]=
  array(3) {
[m]=
string(1) 3
[d]=
string(2) 12
[Y]=
string(4) 2003
  }
I am used to getting this data like:

$form-getSubmitValue(field_name);

But doing that with this array just returns: Array

Anyone know how to get to the data?

Thanks
charles

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



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


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


Re: [PHP] html_quickform - array question

2003-03-26 Thread Leif K-Brooks
Yes, but you can't put put the single quoted array key directly in the 
double-quotes string, try:

$thedate = $lr_form-getSubmitValue('lr_pub_date');

echo The month: {$thedate['m']};

Charles Kline wrote:

Okay. I think I understand. So I do something like this:

$thedate = $lr_form-getSubmitValue('lr_pub_date');

echo The month: $thedate['m'];

Is that what you meant?

- Charles

On Wednesday, March 26, 2003, at 09:31 PM, Leif K-Brooks wrote:

Are you trying to print/echo it? That converts it to a string first. 
Either print_r it, var_dump it, or do something else with it.

Charles Kline wrote:

hi all,

using html_quickform (pear) and it has a date type that passes the 
date info like this:

array(24) {
  [lr_pub_date]=
  array(3) {
[m]=
string(1) 3
[d]=
string(2) 12
[Y]=
string(4) 2003
  }
I am used to getting this data like:

$form-getSubmitValue(field_name);

But doing that with this array just returns: Array

Anyone know how to get to the data?

Thanks
charles

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



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


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


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


RE: [PHP] Uploading Files Via PHP

2003-03-26 Thread daniel
possibly a permissions problem , dir needs to be 777 and owned by httpd
= Original Message From Jennifer Goodie [EMAIL PROTECTED] 
=
http://www.php.net/manual/en/features.file-upload.php

From the page listed above: Related Configurations Note: See also the
file_uploads, upload_max_filesize, upload_tmp_dir, and post_max_size
directives in php.ini

I would read that manual page as it deals with file uploading support.

-Original Message-
From: Vernon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 26, 2003 4:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Uploading Files Via PHP


Is there some thing that needs to be turned on in the php.ini in order to be
able to upload photos VIA php? I have the same script on one machine with
the right permissions on the upload dirs on one machine and am moving to
another machine which is not being uploaded. Funny thing is I'm not getting
any errors in the Apache logs.

Thanks



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



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



Re: [PHP] html_quickform - array question

2003-03-26 Thread Charles Kline
Great. Thanks.

- Charles

On Wednesday, March 26, 2003, at 09:48 PM, Leif K-Brooks wrote:

Yes, but you can't put put the single quoted array key directly in the 
double-quotes string, try:

$thedate = $lr_form-getSubmitValue('lr_pub_date');

echo The month: {$thedate['m']};

Charles Kline wrote:

Okay. I think I understand. So I do something like this:

$thedate = $lr_form-getSubmitValue('lr_pub_date');

echo The month: $thedate['m'];

Is that what you meant?

- Charles

On Wednesday, March 26, 2003, at 09:31 PM, Leif K-Brooks wrote:

Are you trying to print/echo it? That converts it to a string first. 
Either print_r it, var_dump it, or do something else with it.

Charles Kline wrote:

hi all,

using html_quickform (pear) and it has a date type that passes the 
date info like this:

array(24) {
  [lr_pub_date]=
  array(3) {
[m]=
string(1) 3
[d]=
string(2) 12
[Y]=
string(4) 2003
  }
I am used to getting this data like:

$form-getSubmitValue(field_name);

But doing that with this array just returns: Array

Anyone know how to get to the data?

Thanks
charles

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



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


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



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


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


[PHP] help please was: openssl php 4.3.1

2003-03-26 Thread Kalin Mintchev

here is a real example:

$fp = fopen (http://store.el.net/index.html;, r);
while (!feof($fp)) {
   echo fgets ($fp,4096);
  }

this works fine...

if you try it with https you'll get an error - file not found from php

if you try the same url with https in the any browser you wont have any
problems

can somebody explain where to look at - i do have open ssl compiled within
php and everything else works fine -

php 4.3.1 *  openssl  0.9.6h * apache 1.3.27 on FreeBSD 4.6

i got a response earlier from a list member pointing out a security
vulnerability for this version of openssl. how can that influence the
fopen()'s https request, if at all?

how exactly is the https request from fopen() passed to the ssl?
if the ssl works through the broser what can be the reasons that it would
not through php's fopen() or fsockopen()

will going back to php 4.3.0 help? or getting another (newer/older)
openssl?

i am desperate for a solution.

thanks


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



RE: [PHP] html_quickform - array question

2003-03-26 Thread John W. Holmes
 echo The month: $thedate['m'];

echo The month: {$thedate['m']};

or

echo The month: $thedate[m];

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



  1   2   >