[PHP] question about taking post to session

2002-09-21 Thread Randy Johnson

hello,

how could i take all the variables in $_POST[] and move them to
$_SESSION[]?

example

$_POST[name]=$_SESSION[name]


Thanks in advance


Randy



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




[PHP] UDP socket_read() problem

2002-09-21 Thread Martin

Hello,

I created an UDP socket using $sock=socket_create(AF_INET,SOCK_DGRAM,SOL_UDP) 
successfully and then used socket_bind($sock,$address,$port), up to there, no 
problems, but when I try to $buff=socket_read($sock,3) it just stays there doing 
nothing forever.

What could be the problem?

What is the normal behaviour of socket_read() when the socket is empty?

I write to the socket (address/port) like crazy from the other side of the LAN, but 
nothing seems to be happening.

Thanks,

Martin


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




Re: [PHP] about forms with php

2002-09-21 Thread Chris Hewitt

Meltem Demirkus wrote:

?Because  when I tried to use them like this:

form name=sign method=POST action=sign_up_.php
onSubmit=checkemail(email.value);return false 

and when I click submit.. javascript is working but it is not going to the
sign_up_ page ..How can I manage it?..

Or simply leave off the return false and in your JS routine do
document.forms[0].submit()

HTH
Chris


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




[PHP] Commenting out characters?

2002-09-21 Thread Chad Winger

Simple question for the newbie...I hope...

The following line is returning an error, and I can't figure out what and
how to comment out. I assumed I had to \ the parentheses...but it doesnt
work... any suggestion?

echo 'TDA HREF=#IMG SRC=image.gif WIDTH=62 HEIGHT=15 BORDER=0
onClick=MM_showHideLayers('Layer5','','show','Layer4','','hide')/A'.\n
;


Thanks
-Tree



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




[PHP] Re: question about taking post to session

2002-09-21 Thread Leon Mergen


Randy Johnson [EMAIL PROTECTED] wrote in message
000901c2613d$e9223e30$c100a8c0@rjmarket">news:000901c2613d$e9223e30$c100a8c0@rjmarket...
 how could i take all the variables in $_POST[] and move them to
 $_SESSION[]?

If I understand correct, you will want something like this:

?
$var = $_POST[var];
session_start();
session_register(var);
?

And now, in all the scripts on your site, when you execute the
session_start() function, $_SESSION[var] contains the original contents of
$_POST[var] .

Grtz,

Leon



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




[PHP] Re: Commenting out characters?

2002-09-21 Thread Chad Winger

I figured it out...was the single quotes

Disregard





Chad Winger [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Simple question for the newbie...I hope...

 The following line is returning an error, and I can't figure out what and
 how to comment out. I assumed I had to \ the parentheses...but it doesnt
 work... any suggestion?

 echo 'TDA HREF=#IMG SRC=image.gif WIDTH=62 HEIGHT=15
BORDER=0

onClick=MM_showHideLayers('Layer5','','show','Layer4','','hide')/A'.\n
 ;


 Thanks
 -Tree





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




php-general Digest 21 Sep 2002 11:59:56 -0000 Issue 1598

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


php-general Digest 21 Sep 2002 11:59:56 - Issue 1598

Topics (messages 117067 through 117086):

Re: java in php4 on debian testing distribution?
117067 by: Monique Y. Herman
117069 by: Sascha Cunz

Re: HTML 2 TEXT
117068 by: Sascha Cunz

Re: my i ramble for a while?
117070 by: Justin French

Date Time
117071 by: Patrick
117072 by: Tom Rogers
117074 by: Sascha Cunz

Re: Dynamic HTML Email
117073 by: Joseph Szobody

Attack of the ghost double slash??
117075 by: Gerard Samuel
117076 by: Chris Shiflett

Re: session  cookies
117077 by: Jeff Bluemel
117078 by: Chris Shiflett

Uploading problem
117079 by: Ramesh Nagendra Pillai
117080 by: Chris Shiflett

question about taking post to session
117081 by: Randy Johnson
117085 by: Leon Mergen

UDP socket_read() problem
117082 by: Martin

Re: about forms with php
117083 by: Chris Hewitt

Commenting out characters?
117084 by: Chad Winger
117086 by: Chad Winger

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 have java 1.4 installed, and I've put it in /usr/local/sun-j2sdk1.4.1
-- that's why I use the ini_set() method.  I've compiled and run apps
using this java installation, so I'm pretty sure all is kosher there.

I sincerely believe that the problem lies in my php installation, not in
my java installation, which is why I'm asking whether the debian php4
package in the testing distribution, which is more specifically
PHP/4.1.2 according to X-Powered-By in phpinfo(), has java support
compiled in, whether I need a particular extension library file (.so),
etc.

If there's a reason you believe my setting java.home using ini_set()
shouldn't work, please let me know.  From the ini_set docs, I gather I'm
using it appropriately.

Thanks,

monique


Monique, 

By default Debian does not come come with a recent JVM, due
to the non-free-ness of Sun's license.

So first thing is to see if you have any Java installed at 
all...  When you type `java` at a shell it should give you 
an error about missing parameters... if you get the following:
  bash: java: command not found 
then you need to install a Java package for PHP4 to work with.

The most useful Java package for Debian, is blackdown.org's 
non-free port of Java, do the following to get it do the 
following: 

to /etc/apt/sources.list add:
# JDK -- mirrors @ http://www.blackdown.org/java-linux/mirrors.html
deb http://www.mirror.ac.uk/sites/ftp.blackdown.org/ja
va-linux/debian
woody non-free

then run:
apt-get update; apt-get install j2sdk1.3 

Once you've installed Blackdown's port of Java, your java.home
var should be set (you may have to log-in again or reload your
profile to see it).

good luck,

-Garth

-  Monique Y. Herman 
-  19 Sep 2002 19:48:01 -0400

I'd like to play with using java classes from within php, as is
described in http://www.php.net/manual/en/ref.java.php ... I'm using
the
apache and php4 packages from the debian testing distribution.

All of the documentation I've found on the web about installing the
java
extension seems to be oriented toward windows, making me think that
maybe I don't need to specify an extension library on linux?

I tried simply using

ini_set (java.home, /usr/local/sun-j2sdk1.4.1);
$systemInfo = new Java(java.lang.System);

and got the following:

Fatal error: Cannot instantiate non-existent class: java

That seems fairly straightforward: My php doesn't know java from
adam.

So my questions are: Do I need to get an extension library for this
functionality on linux?  If not, does anyone know of a debian
package of
php4 that will give me this capability?  I rather like being able to
use
packages wherever possible.

Thanks in advance for any insight!

-- monique



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

 I sincerely believe that the problem lies in my php installation, not in
 my java installation, which is why I'm asking whether the debian php4
 package in the testing distribution, which is more specifically
 PHP/4.1.2 according to X-Powered-By in phpinfo(), has java support
 compiled in, whether I need a particular extension library file (.so),
 etc.

You need the extension either compiled in _OR_ the library.
?php phpinfo(); ? will tell you also, if the extension is loaded. (There 
must be a 2 column box saying java support and enabled in it's head).

Sascha



[PHP] 256colour PNG?? WHY?!

2002-09-21 Thread -=| Julien Bonastre |=-

Hmm.. Interesting problem I seem to have stumbled upon


I am running apache2.0.36 and php4.2.2 (i am using gd1.6.2)

Now the catch is.. I just want to output a few diff image types directly to browser..

I can do JPEG's fine.. BMP's don't work because of using a older gdlib.. that's no big 
deal though.. i just wanted jpeg and hopefully PNG..

Thing is.. PNG's well.. it loads them fine.. but they end up 256colour palette in the 
browser.. it actually creates the new image from the original true colour (~24KB 
original) and instead spits out a 256colour ~4KB version.. since the palette's been 
reduced involuntarily this is not the desired effect..

I run the img resource through imagecolorstotal($img) to get the colour palette. sure 
enough.. it returns 256.. and yet i open the PNG in Photoshop and its a truecolour PNG 
and without discolouration..


It's definitely freaking me out since I have no idea why it's doing it. I started 
reading the docs' more closely to see if it was a known issue and that the png func's 
are supposed to return 256 colour images.. but to no avail..


Below is the code of the very simple (as can be seen) test php page:
?
header(Content-type: image/png);
//header(Content-Disposition: image; filename=test);
$img=imagecreatefrompng(./news/n1d1.png);
//imageinterlace($img,1);
imagepng($img);
?



As can be seen.. It's very simple.. hehe.. I was just using it to test the principle 
but even at these early stages the plan fell apart due to this wacky problem..



Thanks for any ideas/advice..

:) greatly appreciated..

--oOo---oOo--

 Julien Bonastre [The_RadiX]
 The-Spectrum Network CEO
 [EMAIL PROTECTED]
 www.the-spectrum.org

--oOo---oOo--




Re: [PHP] Attack of the ghost double slash??

2002-09-21 Thread Gerard Samuel

Thanks much, that made all the difference in the world.
The function would be get_magic_quotes_gpc()

Chris Shiflett wrote:

 Gerard,

 The most likely reason is a php.ini configuration called magic_quotes. 
 When enabled, PHP will automatically add slashes to single and double 
 quotes, as well as slashes themselves (to escape them). This is 
 helpful in some environments to help protect against attacks that can 
 be used to execute arbitrary database commands. However, this 
 particular setting is one of the more annoying ones, in my opinion, 
 because it makes it more difficult to write portable code.

 Hopefully this answers your question, and you can just check your 
 php.ini. If you need to dynamically check the configuration, there is 
 a function that will give you the setting of magic_quote. A quick 
 reference in the manual will give it to you.

 Oh, also, you cannot disable this per script, because the slashes are 
 added perior to the data being given to PHP, hence prior to your 
 script's execution.

 Happy hacking.

 Chris

 Gerard Samuel wrote:

 A few months ago, I wrote a bit of code to stripslash() 
 PATH_TRANSLATED on a w2k box, because,
 php was reporting it with double slashes like C:\\winnt\\some_dir

 Today I noticed that the code is broken because PATH_TRANSLATED is 
 now reported with one slash like C:\winnt\some_dir
 Does anyone know when paths contain double slashes on a w2k box, so 
 that I can anticipate for them??

 Thanks for any insight you may provide.







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




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




[PHP] Editor

2002-09-21 Thread Bryan McLemore

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



Re: [PHP] Editor

2002-09-21 Thread Brad Bonkoski

I like textpad, because it will write files in a Unix friendly way, i.e. none of that 
annoying ^M at the
end of lines! :-)

Bryan McLemore wrote:

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


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




Re: [PHP] 256colour PNG?? WHY?!

2002-09-21 Thread Rasmus Lerdorf

gd1 is limited to 256 colours.  Use gd2.

On Sat, 21 Sep 2002, -=| Julien Bonastre |=- wrote:

 Hmm.. Interesting problem I seem to have stumbled upon


 I am running apache2.0.36 and php4.2.2 (i am using gd1.6.2)

 Now the catch is.. I just want to output a few diff image types directly to browser..

 I can do JPEG's fine.. BMP's don't work because of using a older gdlib.. that's no 
big deal though.. i just wanted jpeg and hopefully PNG..

 Thing is.. PNG's well.. it loads them fine.. but they end up 256colour palette in 
the browser.. it actually creates the new image from the original true colour (~24KB 
original) and instead spits out a 256colour ~4KB version.. since the palette's been 
reduced involuntarily this is not the desired effect..

 I run the img resource through imagecolorstotal($img) to get the colour palette. 
sure enough.. it returns 256.. and yet i open the PNG in Photoshop and its a 
truecolour PNG and without discolouration..


 It's definitely freaking me out since I have no idea why it's doing it. I started 
reading the docs' more closely to see if it was a known issue and that the png func's 
are supposed to return 256 colour images.. but to no avail..


 Below is the code of the very simple (as can be seen) test php page:
 ?
 header(Content-type: image/png);
 //header(Content-Disposition: image; filename=test);
 $img=imagecreatefrompng(./news/n1d1.png);
 //imageinterlace($img,1);
 imagepng($img);
 ?



 As can be seen.. It's very simple.. hehe.. I was just using it to test the principle 
but even at these early stages the plan fell apart due to this wacky problem..



 Thanks for any ideas/advice..

 :) greatly appreciated..

 --oOo---oOo--

  Julien Bonastre [The_RadiX]
  The-Spectrum Network CEO
  [EMAIL PROTECTED]
  www.the-spectrum.org

 --oOo---oOo--




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




[PHP] testing post

2002-09-21 Thread Kleshchevnikov Alexander

Hi all!



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




[PHP] Hi all!

2002-09-21 Thread Kleshchevnikov Alexander

Testing post!



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




RE: [PHP] Editor

2002-09-21 Thread Todd Pasley

You can get vi/vim for windows, without a doubt the best editor of all time
if you can be bothered learning the commands.

Todd.

 -Original Message-
 From: Bryan McLemore [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, 21 September 2002 11:16 PM
 To: PHP GEN LIST
 Subject: [PHP] Editor


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



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




RE: [PHP] question about taking post to session

2002-09-21 Thread Todd Pasley

Sure you can, however,

1) u prob. want $_SESSION['name'] = $_POST['name'];
2) remember that if you are calling this within the scope of a function you
will have to use $GLOBALS to declare $name as a global before you utilise
session_register.

Todd.

 -Original Message-
 From: Randy Johnson [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, 21 September 2002 5:10 PM
 To: Chris Shiflett; Ramesh Nagendra Pillai
 Cc: [EMAIL PROTECTED]
 Subject: [PHP] question about taking post to session


 hello,

 how could i take all the variables in $_POST[] and move them to
 $_SESSION[]?

 example

 $_POST[name]=$_SESSION[name]


 Thanks in advance


 Randy



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



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




[PHP] algorythm question

2002-09-21 Thread Barýþ

consider there are categories and these have IDs like
below:
1, 2, 4, 8, 16, 32, 64...

if some data belongs to more than 1 category for
exemple 4 and 32, its category ID will be 36, the sum
of cat. IDs. 
i guess this is used widely in programming. so, how
can i resolve the original IDs. i mean what kind of
script can tell me what+what1+what2...whatN = 79?

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

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




[PHP] accessing session variables

2002-09-21 Thread Murat Ö.

hi,

page1.php creates a session and its variables in it in  successfully. the
variables and values are created like
$_SESSION['x']='abc'

 page1.php sends the SID information to page2.php via GET method. how can i
access the those variables with SID information in page2.php?

thanks



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




[PHP] checking if an array is empty

2002-09-21 Thread electroteque

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



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




[PHP] PHP Cannot redeclare class problem

2002-09-21 Thread Paul Maine

When I call the function batch_delayed_capture(see below), I issue the
$this-delayed_capture($d); statement. Both batch_delayed_capture and
delayed_capture are in the same include file. The statement works fine the
first time through the loop but gives the following error Cannot redeclare
class pfp_class(see below). I added some echo statements to help identify
where the problem was occuring.

Your assistance is greatly appreciated.

Paul
PHP,MySQL

*
Array element 0= 21203749pnref=  Made it to delayed capture Just after
delayed capyure Array element 1= 21203748pnref= 1
Fatal error: Cannot redeclare class pfp_class in
/var/www/html/shop/modules/checkout/lib/_class.pfp.php on line 76

*
function batch_delayed_capture($d) {

   global $auth,
   $ps_vendor_id;

   if ($d) {
 //echo Inside POST\n;
 while (list($lvar, $lvalue) = each($d)) {
   if (ereg (^d_c_arr, $lvar, $throwaway)) {
   $batch_d_c[]=$d[$lvar];
   }
 }
   }

   $dbresponse = new ps_DB;


for($i = 0; $i  sizeof($batch_d_c); $i++){

  echo  Array element $i=  . $batch_d_c[$i];

  $qr = SELECT pnref from transaction_response WHERE result='0' ;
  $qr .= AND order_id=$batch_d_c[$i] AND delay_capture IS NULL;
  $dbresponse-query($qr);
  $dbresponse-next_record();
  $d[pnref]=$dbresponse-f(pnref);
  echo pnref=  . $d[pnref];

  $this-delayed_capture($d);
  echo Just after delayed capyure;
}


return True;

 }

**


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




Re: [PHP] algorythm question

2002-09-21 Thread bob parker

On Sun, 22 Sep 2002 01:10, you wrote:
 consider there are categories and these have IDs like
 below:
 1, 2, 4, 8, 16, 32, 64...

 if some data belongs to more than 1 category for
 exemple 4 and 32, its category ID will be 36, the sum
 of cat. IDs.
 i guess this is used widely in programming. so, how
 can i resolve the original IDs. i mean what kind of
 script can tell me what+what1+what2...whatN = 79?

1. To do that you should 'or' the categories when the ID's are
to be in more than one category, not add them
eg $category = $cat1 | $cat2;

2. To extract the categories within a compounded category
use the 'and' operator ''

eg

for ($mask=1; $mask = 64; /*or whatever*/ $mask *= 2; ) {
if ( $mask  $category ) {
print Yes $mask is in $category\n;
}
} 

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




Re: [PHP] checking if an array is empty

2002-09-21 Thread Sascha Cunz

There are many different states, in which an array would be empty. Can you 
post the output of a var_dump($array); in that special case you want to 
check?

In general:

1. the variable may not have been set:
   if (!isset($myarray)) echo 'error';

2. the variable is set, but ain't an array:
   if (!isarray($myarray) echo 'error';

3. the variable is set and is an array, but contains no data:
   if (array_count($myarray) == 0) echo 'error';

I think the 3rd case could apply to your problem, but only a print_r or 
var_dump of the $_POST['myarray'] can show this.

Sascha

Am Samstag, 21. September 2002 17:13 schrieb electroteque:
 how can i check if an array is currently empty , for instance i have a file
 input field with an array name for multiple images, i need to check if
 there was no file uploaded in that field name and ignore it in the loop


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




Re: [PHP] Editor

2002-09-21 Thread Sascha Cunz

Newest gvim for windows acts in most cases just like any other editor, too. 
You can mark text with the mouse, scroll over with the scrollbars etc. etc. 
It even got a nice menu. This is the best you can get - and it does 
everything.

I even switched from VC++'s IDE to gvim, now ;-)

Am Samstag, 21. September 2002 16:16 schrieb Todd Pasley:
 You can get vi/vim for windows, without a doubt the best editor of all time
 if you can be bothered learning the commands.

 Todd.

  -Original Message-
  From: Bryan McLemore [mailto:[EMAIL PROTECTED]]
  Sent: Saturday, 21 September 2002 11:16 PM
  To: PHP GEN LIST
  Subject: [PHP] Editor
 
 
  Hi guys, just wondering if anyone could recomend a good editor
  that is based on windows.  Thanks, Bryan


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




Re: [PHP] accessing session variables

2002-09-21 Thread Sascha Cunz

Just use the session_start() in the second page and they will be magically 
there where you've put them in the first page.

Sascha

Am Samstag, 21. September 2002 17:01 schrieb Murat Ö.:
 hi,

 page1.php creates a session and its variables in it in  successfully. the
 variables and values are created like
 $_SESSION['x']='abc'

  page1.php sends the SID information to page2.php via GET method. how can i
 access the those variables with SID information in page2.php?

 thanks


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




Re: [PHP] accessing session variables

2002-09-21 Thread Murat Ö.

i tried but it didn't work.
i wrote in page2.php:

?php
session_start();
echo $_SESSION['isim'];
?

and i was noticed: Undefined index: isim in .

but i have written $_SESSION['isim']='murat' in page1.php



Sascha Cunz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Just use the session_start() in the second page and they will be magically
there where you've put them in the first page.

Sascha

Am Samstag, 21. September 2002 17:01 schrieb Murat Ö.:
 hi,

 page1.php creates a session and its variables in it in  successfully. the
 variables and values are created like
 $_SESSION['x']='abc'

  page1.php sends the SID information to page2.php via GET method. how can
i
 access the those variables with SID information in page2.php?

 thanks



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




Re: [PHP] accessing session variables

2002-09-21 Thread Murat Ö.

i have written

ini_set(session.name, SID);

before, in page1.php. and i've added it on page2.php before session_start
and it works.

thanks..



Murat Ö. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i tried but it didn't work.
 i wrote in page2.php:

 ?php
 session_start();
 echo $_SESSION['isim'];
 ?

 and i was noticed: Undefined index: isim in .

 but i have written $_SESSION['isim']='murat' in page1.php



 Sascha Cunz [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Just use the session_start() in the second page and they will be magically
 there where you've put them in the first page.

 Sascha

 Am Samstag, 21. September 2002 17:01 schrieb Murat Ö.:
  hi,
 
  page1.php creates a session and its variables in it in  successfully.
the
  variables and values are created like
  $_SESSION['x']='abc'
 
   page1.php sends the SID information to page2.php via GET method. how
can
 i
  access the those variables with SID information in page2.php?
 
  thanks





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




Re: [PHP] Editor

2002-09-21 Thread Chris Shiflett

http://www.ultraedit.com/

Bryan McLemore wrote:

Hi guys, just wondering if anyone could recomend a good editor that is based on 
windows.



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




[PHP] Re: Editor

2002-09-21 Thread nicos

The best IS EditPlus. Get it at www.download.com.

--

Nicos - CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com - Hébergement de sites Internet

Bryan McLemore [EMAIL PROTECTED] a écrit dans le message de news:
004901c26170$fc6fc510$[EMAIL PROTECTED]
Hi guys, just wondering if anyone could recomend a good editor that is based
on windows.  Thanks, Bryan




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




RE: [PHP] PHP Cannot redeclare class problem

2002-09-21 Thread Paul Maine

I was able to solve the problem by using the require_once  statement.

Thank You

-Original Message-
From: Paul Maine [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 21, 2002 10:23 AM
To: PHP PHP
Subject: [PHP] PHP Cannot redeclare class problem


When I call the function batch_delayed_capture(see below), I issue the
$this-delayed_capture($d); statement. Both batch_delayed_capture and
delayed_capture are in the same include file. The statement works fine the
first time through the loop but gives the following error Cannot redeclare
class pfp_class(see below). I added some echo statements to help identify
where the problem was occuring.

Your assistance is greatly appreciated.

Paul
PHP,MySQL

*
Array element 0= 21203749pnref=  Made it to delayed capture Just after
delayed capyure Array element 1= 21203748pnref= 1
Fatal error: Cannot redeclare class pfp_class in
/var/www/html/shop/modules/checkout/lib/_class.pfp.php on line 76

*
function batch_delayed_capture($d) {

   global $auth,
   $ps_vendor_id;

   if ($d) {
 //echo Inside POST\n;
 while (list($lvar, $lvalue) = each($d)) {
   if (ereg (^d_c_arr, $lvar, $throwaway)) {
   $batch_d_c[]=$d[$lvar];
   }
 }
   }

   $dbresponse = new ps_DB;


for($i = 0; $i  sizeof($batch_d_c); $i++){

  echo  Array element $i=  . $batch_d_c[$i];

  $qr = SELECT pnref from transaction_response WHERE result='0' ;
  $qr .= AND order_id=$batch_d_c[$i] AND delay_capture IS NULL;
  $dbresponse-query($qr);
  $dbresponse-next_record();
  $d[pnref]=$dbresponse-f(pnref);
  echo pnref=  . $d[pnref];

  $this-delayed_capture($d);
  echo Just after delayed capyure;
}


return True;

 }

**


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


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




Re: [PHP] Re: session cookies

2002-09-21 Thread Jeff Bluemel

I responded to this in a private email to you, and not on the forum...  I
did respond.  I will post here again so there is no question;


I want to force it to use a cookie that points to a transparent SID on
my system.

what I mean by this is it was my understanding when reading the sessions
doc's that there was a way to for the system to use a stored system ID
stored in an SID, but the information wouldn't be sent to the browser, but
be stored in a cookie.

With use_trans_sid set, PHP is going to append the session ID to the URL
of links, etc., on:

I tried setting the user_trans_sid = 0, but it still will not use a cookie.
it doesn't appear to change anything when I play with these settings.

Chris Shiflett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You've already posted this, and you never answered the questions that
 were asked. Thus, your question is every bit as unclear as the previous
 time.

 Perhaps if you put forth a little effort, we might also.

 Just a helpful suggestion,

 Chris

 Jeff Bluemel wrote:

 still looking for some solutions on this - anybody else have any
 suggestions?
 




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




Re: [PHP] Re: session cookies

2002-09-21 Thread Chris Shiflett

Jeff,

My apologies then. Somehow your response never arrived. It is still best 
to always reply all for things like this. You get the benefit of 
hearing several people's perspectives, and you also potentially help 
others who have the same question now or who may have it in the future 
(and check the list archives).

Anyway, back to your problem ...

Jeff Bluemel wrote:

what I mean by this is it was my understanding when reading the sessions
doc's that there was a way to for the system to use a stored system ID
stored in an SID, but the information wouldn't be sent to the browser, but
be stored in a cookie.


Cookies are stored on the client, so they are also sent to the browser.

Basically, the unique identifier (e.g., PHPSESSID) must be provided by 
the Web client in order for it to be associated with previous requests. 
The two most common methods of this are for it to send this information 
in a cookie (there is a Cookie header in the HTTP request) or as part of 
the query string in a URL (such as 
http://www.example.org/index.php?PHPSESSID=123456789) that it is requesting.

With use_trans_sid set, PHP is going to append the session ID to the URL
of links, etc., on:


I tried setting the user_trans_sid = 0, but it still will not use a cookie.
it doesn't appear to change anything when I play with these settings.


Right. I was explaining (poorly looking back) what the use_trans_sid 
does. Basically, the idea is that the developer doesn't have to worry 
about how the unique identifier is passed back. This is the easiest 
way to use session management, because it is transparent for the most 
part. PHP will try both cookie and URL methods to maintain the unique 
identifier, and it will use only a cookie once it can determine that the 
client supports them.

You are having a problem, it sounds like, with the Web client *not* 
sending back the cookie in subsequent requests. Thus, use_trans_sid will 
append the unique identifier to the URL every time, as it believes the 
client to not be supporting cookies (which might just be your problem). 
When you combine this with use_only_cookies (sp?), you are basically 
telling PHP to ignore the unique identifier if it is sent on the URL. 
Thus, it is not receiving the cookie, and it is being instructed to not 
use the URL variable. It has no way to identify the client and maintain 
state.

Your problem boils down to one thing: the cookie is not getting passed 
back. Focus on this initially. Make sure your Web browser is accepting 
the cookie (you can configure most browsers to warn you before accepting 
a cookie, so that you can be certain it is being set), and try to make 
sure your PHP script is receiving the cookie like it thinks it should 
be. For example, if the cookie is named PHPSESSID, try this:

?
echo cookie is [ . $_COOKIE[PHPSESSID] . ]br;
?

If ths cookie is blank (e.g., cookie is []), you have identified your 
problem. Hopefully this will help you solve it.

Happy hacking.

Chris


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




[PHP] Best Practice

2002-09-21 Thread Ashley M. Kirchner


I'm working on converting several static (price) pages on our site into dynamic 
pages, with the data stored in an MySQL database and PHP to pull the data out, with 
CSS to build the page and present it.  At the same time, I would also like to have a 
'printer friendly' link on each page that visitors can click on and get the same page 
re-rendered for easy printing.  What's the best way to get the data converted from one 
form to another?  Should I be querying the database again to get the same data to 
reformat?  Should I store the data in sessions and reformat based on the CSS?  I would 
think having to query twice for the same thing would be a degradation in performance, 
right?  So what's the best practice?

--
H | Life is the art of drawing without an eraser. - John Gardner
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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




Re: [PHP] Best Practice

2002-09-21 Thread Chris Shiflett

Ashley,

This is difficult to answer, as you are actually the best person to 
decide. Consider some of the following things:

1. How often do you anticipate people will use the printer-friendly link?
2. How much data do you anticipate, on average, to be contained in the 
results of these queries?
3. How much traffic do you anticipate?
4. How much memory does your Web server have?
5. Are you maintaining sessions anyway, or would this be the only thing 
to require them?

My (uneducated) guess would be that querying again is the best approach. 
You're basically talking about a separate request anyway, and the 
overhead of maintaining state might not be worth it, as you may end up 
with many of these result sets stored in the session, and the client may 
never use them.

Happy hacking.

Chris

Ashley M. Kirchner wrote:

I'm working on converting several static (price) pages on our site into dynamic 
pages, with the data stored in an MySQL database and PHP to pull the data out, with 
CSS to build the page and present it.  At the same time, I would also like to have a 
'printer friendly' link on each page that visitors can click on and get the same page 
re-rendered for easy printing.  What's the best way to get the data converted from 
one form to another?  Should I be querying the database again to get the same data to 
reformat?  Should I store the data in sessions and reformat based on the CSS?  I 
would think having to query twice for the same thing would be a degradation in 
performance, right?  So what's the best practice?



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




[PHP] Users authentication with Apache and PHP on Novell

2002-09-21 Thread Milan Reznicek

Hi Everybody,
I have my Apache 1.3.26 with PHP 4.2.2 running on WinNT 4.0 and need 
to authenticate 
users to have access to some web pages. The computer with apache is a part of 
Novell NetWare Network and I need to that only users which are from this 
network have access to the web pages. Does anybody know how to authenticate 
the users using PHP. Thanks for your advice.


Bye Milan


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




Re: [PHP] Editor

2002-09-21 Thread Paul Nicholson

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hey,
I use PHPCoder on my windoze machines.thats when I have to use windows;)
Search google for r2p3setup.exe to get a copy.
~Pauly

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

- -- 
~Paul Nicholson
Design Specialist @ WebPower Design
The webthe way you want it!
[EMAIL PROTECTED]

It said uses Windows 98 or better, so I loaded Linux!
Registered Linux User #183202 using Register Linux System # 81891
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9jNeaDyXNIUN3+UQRAuLpAKCJyZIYfoy2CcsLrBwct8eARzKt+wCfcign
9nwQhWebxfmPExHhFqcKuHI=
=qL86
-END PGP SIGNATURE-

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




Re: [PHP] Best Practice

2002-09-21 Thread Paul Roberts

just use css to define separate styles for each media
e.g.
style type=text/css media=screen,projection
!--
// screen style
--
/style
style type=text/css media=print
!--
// print style
--
/style

then the print style will be applied when the user clicks print.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]


- Original Message - 
From: Ashley M. Kirchner [EMAIL PROTECTED]
To: PHP-General List [EMAIL PROTECTED]
Sent: Saturday, September 21, 2002 7:51 PM
Subject: [PHP] Best Practice



I'm working on converting several static (price) pages on our site into dynamic 
pages, with the data stored in an MySQL database and PHP to pull the data out, with 
CSS to build the page and present it.  At the same time, I would also like to have a 
'printer friendly' link on each page that visitors can click on and get the same page 
re-rendered for easy printing.  What's the best way to get the data converted from one 
form to another?  Should I be querying the database again to get the same data to 
reformat?  Should I store the data in sessions and reformat based on the CSS?  I would 
think having to query twice for the same thing would be a degradation in performance, 
right?  So what's the best practice?

--
H | Life is the art of drawing without an eraser. - John Gardner
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin. 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave, #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.




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





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




[PHP] debug function - string to variable conversion?

2002-09-21 Thread Marco Siegl

hi there,
i was thinking of a 2 ways to write a new debug function, ...

1. debug all variables in php script, e.g. function debug( all )

which should parse the whole source code of a particular php-script for all
occuring variables and treat them corresponding to their variable type, e.g.

- simple one-dimensional variables like int, float, string,... should be
printed as key = value pairs.
- arrays could be printed with the built-in print_r function
- etc...

= has anybody done this already? do you have any conclusions?


2. debug specified variable(s) only, e.g. function debug( var, var2, var3,
... )

But the problem is to pass the parameters in the right way to get the needed
information and afterwards treat the passed function input to dynamically
print the output.

when i tried to pass, e.g. the variable $_SERVER['SERVER_NAME'] to my debug
function, it was totally confusing, if the variable should be

a) passed as $param, without using any quoting, like:
debug($_SERVER_[SERVER_NAME])
b) passed as string, using single ticks, like:
debug('$_SERVER_[SERVER_NAME]')
c) passed as string, using double quotes, like:
debug($_SERVER_[SERVER_NAME])

and on the other hand, how to retrieve the passed function input, to write
output, like e.g.
$_SERVER['SERVER_NAME'] = www.remslakecity.de

every time i tried, my only output was,
$_SERVER['SERVER_NAME'] = $_SERVER['SERVER_NAME']
or
www.remslakecity.de = www.remslakecity.de

= where can i see the source-code of the phpinfo() function, maybe there is
hint of how to do it?
= is there a conversion from string to variable, if $var was passed as
string?
= after passing $var as variable it is evaluated on-the-fly, so i can' t
get the $key (varname)

afterall, if my explanation was too confusing, 
i only want to write the varname once, like debug (var) and to retrieve the
$var = value pair !!!

thanks a lot for helping me out,... me, myself  i, we completely lost our
nerves...
please mailto:[EMAIL PROTECTED]


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




[PHP] FTP Uploading?

2002-09-21 Thread Stephen Craton

Hello,

I was just wondering, how do you FTP files in PHP? I can't seem to find
it in any of my PHP books so could someone kindly give me a rundown on
how they work? Thanks!

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



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




[PHP] Re: php_xslt.dll

2002-09-21 Thread Marco Siegl

hi larry,
please explain, what in particular is wrong with your php-xslt installation?

maybe you can first of all try http://www.dependencywalker.com to check if all needed 
.dlls are there. if you still need the new libexpat.dll you have to go to 
http://sourceforge.net/projects/expat/ - it's james clarks expat page on sourceforge, 
and there you can get the new libexpat.dll in the latest expat archive.

you can also view php source code of my running xslt processing script, if you go to 
http://www.remslakecity.de/source.php?url=/xslt/xp.php

i wish you all the best,
- marco

mail[EMAIL PROTECTED]/mail
urlhttp://www.remslakecity.de/url
  - Original Message - 
  From: larryv 
  To: [EMAIL PROTECTED] 
  Sent: Saturday, September 21, 2002 10:26 PM
  Subject: php_xslt.dll


  Did you get XSLT to work?

  I'm having the same problem.




   I get this 'module not found'-errors all the time and could not find a
   solution up to now.
   i tried everything this group recommends, but the problem gets weirder and
   weirder.
   I even tried DependencyMaker and it says a libexpat.dll is missing. This
  dll
   is not included to the php-4.2.3-distribution. (somebody suggested
  expat.dll
   will do - NOT on my machine)
  
i found a rersolution to the php_xslt.dll extension installting problem
  
   you're lucky!
  
in your php.ini, you have to write: extension_dir = c:/php/extensions
  
   would be d:/php/extensions on my machine. does NOT solve the problem.
  
copy the 4 following .dll's to your windows/system32 directory
- php/php4ts.dll
- php/extensions/php_xslt.dll
- php/dlls/expat.dll
- php/dlls/sablot.dll
  
   all done. does NOT solve the problem.
  
   I am using IIS 5 on WIN2000/SP3 . But this is definitely not a
   server-related problem i think.
   To me it seems very much as a bug in the php-module-implementation or in
  the
   php_xslt.dll itself.
  
   Btw: is there somehing like an official installation procedure?
  
   any help would be very appreciated.
   [EMAIL PROTECTED]
  
  
  
  
  



--




[PHP] Help sending IMAP mail

2002-09-21 Thread Jeff Schwartz


The IMAP documentation on the php site says that you can create an IMAP message using 
imap_mail_compose but fails to say how to send it.

I've tried using imap_mail but it gives me a parameter count error.

Does anyone know how to send the message?

Thanks,

Jeff

 

 



-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


Re: [PHP] UDP socket_read() problem

2002-09-21 Thread Martin

 Try using SO_TCP.

The problem is that I'm making a server application, and all the clients were made by 
someone else and are much more difficult to modify, and are already using UDP.

 There are issues using TO_UDP with
 internet/LANs. many ppl mention
 them from time to time, however, it
 'should' work over a LAN TCP is
 usually eaiser and a nice alternative
 if you can't resolve issues.

Ok, if I can't get it to work with UDP, I think I'll switch to TCP.

Thanks,

Martin


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




[PHP] ERROR

2002-09-21 Thread Georgie Casey

I'm getting a:
Parse error: parse error, unexpected $ in
/home/virtual/site264/fst/var/www/html/include/paypal.php on line 126

in my script. the script only has 126 lines, and I cant find any $ that
might be causing it. But there's a lot of loops to close in the script so
I'm thinking one of these could be to blame. So my question is, does PHP
return this error when some loops aren;t closed??



--
Regards,
Georgie Casey
[EMAIL PROTECTED]

***
http://www.filmfind.tv
Online Film Production Directory
***



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




Re: [PHP] Editor

2002-09-21 Thread Liam MacKenzie

Editplus, all the way.
www.editplus.com

Small, fast, very configurable, lots of features, project support, direct
FTP upload

Give it a shot, it's the best  :-)


Liam


- Original Message -
From: Bryan McLemore [EMAIL PROTECTED]
To: PHP GEN LIST [EMAIL PROTECTED]
Sent: Saturday, September 21, 2002 11:15 PM
Subject: [PHP] Editor


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





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




Re: [PHP] FTP Uploading?

2002-09-21 Thread Liam MacKenzie

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

You'll need FTP support compiled into PHP.
do a phpinfo() and search for FTP

Cheers,
Liam

- Original Message - 
From: Stephen Craton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 22, 2002 7:27 AM
Subject: [PHP] FTP Uploading?


Hello,

I was just wondering, how do you FTP files in PHP? I can't seem to find
it in any of my PHP books so could someone kindly give me a rundown on
how they work? Thanks!

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



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







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




[PHP] sessions

2002-09-21 Thread Pablo Oliva

I have read that in order to account for browsers/users who do not have
cookies enabled, that you should append the session id to the url (query
string).  Now, if I do do that,
www.site.com?phpsessid=gafklgjr952344afgfa, do I have to do anything so
that I force php to recognize the session id in the query string?  To
clarify my question, does php recognize the session id in the query
string by default if cookies are dissabled?



php-general Digest 22 Sep 2002 00:31:52 -0000 Issue 1599

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


php-general Digest 22 Sep 2002 00:31:52 - Issue 1599

Topics (messages 117087 through 117125):

256colour PNG?? WHY?!
117087 by: -=| Julien Bonastre |=-
117091 by: Rasmus Lerdorf

Re: Attack of the ghost double slash??
117088 by: Gerard Samuel

Editor
117089 by: Bryan McLemore
117090 by: Brad Bonkoski
117094 by: Todd Pasley
117102 by: Sascha Cunz
117106 by: Chris Shiflett
117107 by: nicos.php.net
117114 by: Paul Nicholson
117122 by: Liam MacKenzie

testing post
117092 by: Kleshchevnikov Alexander

Hi all!
117093 by: Kleshchevnikov Alexander

Re: question about taking post to session
117095 by: Todd Pasley

algorythm question
117096 by: Barýþ
117100 by: bob parker

accessing session variables
117097 by: Murat Ö.
117103 by: Sascha Cunz
117104 by: Murat Ö.
117105 by: Murat Ö.

checking if an array is empty
117098 by: electroteque
117101 by: Sascha Cunz

PHP Cannot redeclare class problem
117099 by: Paul Maine
117108 by: Paul Maine

Re: session  cookies
117109 by: Jeff Bluemel
117110 by: Chris Shiflett

Best Practice
117111 by: Ashley M. Kirchner
117112 by: Chris Shiflett
117115 by: Paul Roberts

Users authentication with Apache and PHP on Novell
117113 by: Milan Reznicek

debug function - string to variable conversion?
117116 by: Marco Siegl

FTP Uploading?
117117 by: Stephen Craton
117123 by: Liam MacKenzie

Re: php_xslt.dll
117118 by: Marco Siegl

Help sending IMAP mail
117119 by: Jeff Schwartz

Re: UDP socket_read() problem
117120 by: Martin

ERROR
117121 by: Georgie Casey
117124 by: Liam MacKenzie

sessions
117125 by: Pablo Oliva

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

Hmm.. Interesting problem I seem to have stumbled upon


I am running apache2.0.36 and php4.2.2 (i am using gd1.6.2)

Now the catch is.. I just want to output a few diff image types directly to browser..

I can do JPEG's fine.. BMP's don't work because of using a older gdlib.. that's no big 
deal though.. i just wanted jpeg and hopefully PNG..

Thing is.. PNG's well.. it loads them fine.. but they end up 256colour palette in the 
browser.. it actually creates the new image from the original true colour (~24KB 
original) and instead spits out a 256colour ~4KB version.. since the palette's been 
reduced involuntarily this is not the desired effect..

I run the img resource through imagecolorstotal($img) to get the colour palette. sure 
enough.. it returns 256.. and yet i open the PNG in Photoshop and its a truecolour PNG 
and without discolouration..


It's definitely freaking me out since I have no idea why it's doing it. I started 
reading the docs' more closely to see if it was a known issue and that the png func's 
are supposed to return 256 colour images.. but to no avail..


Below is the code of the very simple (as can be seen) test php page:
?
header(Content-type: image/png);
//header(Content-Disposition: image; filename=test);
$img=imagecreatefrompng(./news/n1d1.png);
//imageinterlace($img,1);
imagepng($img);
?



As can be seen.. It's very simple.. hehe.. I was just using it to test the principle 
but even at these early stages the plan fell apart due to this wacky problem..



Thanks for any ideas/advice..

:) greatly appreciated..

--oOo---oOo--

 Julien Bonastre [The_RadiX]
 The-Spectrum Network CEO
 [EMAIL PROTECTED]
 www.the-spectrum.org

--oOo---oOo--


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

gd1 is limited to 256 colours.  Use gd2.

On Sat, 21 Sep 2002, -=| Julien Bonastre |=- wrote:

 Hmm.. Interesting problem I seem to have stumbled upon


 I am running apache2.0.36 and php4.2.2 (i am using gd1.6.2)

 Now the catch is.. I just want to output a few diff image types directly to browser..

 I can do JPEG's fine.. BMP's don't work because of using a older gdlib.. that's no 
big deal though.. i just wanted jpeg and hopefully PNG..

 Thing is.. PNG's well.. it loads them fine.. but they end up 256colour palette in 
the browser.. it actually creates the new image from the original true colour (~24KB 
original) and instead spits out a 256colour ~4KB version.. since the palette's been 
reduced involuntarily this is not the desired effect..

 I run the img resource through imagecolorstotal($img) to get the colour palette. 
sure enough.. it returns 256.. and yet i open the PNG in Photoshop and its a 
truecolour PNG and without discolouration..


 It's definitely freaking me out since I have no idea why it's doing it. I started 

Re: [PHP] checking if an array is empty

2002-09-21 Thread Michael Sims

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

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

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

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




[PHP] Re: Editor

2002-09-21 Thread B.C. Lance

http://www.phpedit.net



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


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




Re: [PHP] checking if an array is empty

2002-09-21 Thread electroteque

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

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

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

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



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




[PHP] [bob@elitegroup.on.ca: RE: php emails]

2002-09-21 Thread The Doctor

Anyone knows why the below is hapeening?

My PHP info page is on http://www.nk.ca/phpinfo.phtml

- Forwarded message from Bob Federer [EMAIL PROTECTED] -

Return-Path: [EMAIL PROTECTED]
Received: from doctor.nl2k.ab.ca (IDENT:[EMAIL PROTECTED] [127.0.0.1])
by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6) with ESMTP id g8M1FDh7013565
(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO)
for [EMAIL PROTECTED]; Sat, 21 Sep 2002 19:15:13 -0600 (MDT)
Received: (from root@localhost)
by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6/Submit) id g8M1FDkG013564
for [EMAIL PROTECTED]; Sat, 21 Sep 2002 19:15:13 -0600 (MDT)
Resent-Message-Id: [EMAIL PROTECTED]
Received: from ELITE (CPE0050ba761922.cpe.net.cable.rogers.com [24.157.79.145])
by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6) with SMTP id g8LMD1h8000209
for [EMAIL PROTECTED]; Sat, 21 Sep 2002 16:13:04 -0600 (MDT)
Reply-To: [EMAIL PROTECTED]
From: Bob Federer [EMAIL PROTECTED]
To: System Administrator a.k.a. The Root of the Problem [EMAIL PROTECTED]
Subject: RE: php emails
Date: Sat, 21 Sep 2002 18:12:57 -0700
Message-ID: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Importance: Normal
In-Reply-To: [EMAIL PROTECTED]
Resent-From: [EMAIL PROTECTED]
Resent-Date: Sat, 21 Sep 2002 19:15:13 -0600
Resent-To: The Doctor [EMAIL PROTECTED]

Hello Dave,
The php mail function is still not working. I've changed the coding a little
bit to help you debug it. The code on the page is now:

?php
mail('[EMAIL PROTECTED], [EMAIL PROTECTED]', 'An email to two people', 'This is
a test');
?

As you can see, it will send an email to both you and me.

To test the page you can go to community updates or sellwithpictures. The
two URLs are:

http://www.sellwithpictures.com/php/emailtest.html

and

http://www.communityupdates.com/php/emailtest.html

Please email me when you have it working.
Thanks for your effort.

Apart from being a neat thing for a page to be able to do, I'm doing a quote
for a large site where they require emails to be sent out by the site when
someone fills out a form, so we need to have this figured out.

Thanks again,

bob


-Original Message-
From: System Administrator a.k.a. The Root of the Problem
[mailto:[EMAIL PROTECTED]]
Sent: September 21, 2002 12:54 PM
To: Bob Federer
Subject: Re: php emails

On Sat, Sep 21, 2002 at 01:43:03PM -0700, Bob Federer wrote:
 Hello Dave,

 I'm going to want to be able to send emails form the Community Updates and
 Sell With Pictures sites using PHP.

 The code to send a simple email is very straightforward in php (it's one
 line of code) example below:

 ?phpmail('bob_elitegroup.on.ca', 'test email', 'This is just a test');?

 If the system is set up correctly on your end, it should work flawlessly.
 Unfortunately, at this point, it is not working. Apparently, the php.ini
 file needs to be adjusted at your end. The link below has details of how
to
 do it.

 http://www.webmasterbase.com/article/679


 Could you look into this and let me know when you have made this
functional?


Try now.

 Thanks

 bob

--
contact:
Dave Yadallee  NetKnow  The Internet Knowledge Company
[EMAIL PROTECTED]  http://www.nl2k.ab.ca
990-3244



- End forwarded message -

-- 
Member - Liberal International  On 11 Sept 2001 the WORLD was violated.
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
Society MUST be saved! Extremists must dissolve.  
Beware of defining as intelligent only those who share your opinions

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




Re: [PHP] sessions

2002-09-21 Thread Chris Shiflett

Pablo Oliva wrote:

I have read that in order to account for browsers/users who do not have
cookies enabled, that you should append the session id to the url (query
string).


Yes, there are basically three ways that the Web client can pass a 
unique identifier to the server:

1. Cookie
2. URL variable
3. Post variable

Using a Post variable requires that the user always be submitting a form 
with a method of post, so this isn't very flexible, and most people 
don't use it. So, to support users who do not have cookies enabled, the 
URL variable is your best alternative.

Now, if I do do that,
www.site.com?phpsessid=gafklgjr952344afgfa,


I'm not sure if you just made a typo here, but you *must* specify a 
resource in a URL. In your above example, you could specify document 
root (/) as the resource like this:

http://www.site.com/?phpsessid=gafklgjr952344afgfa

Or, you could specify a specific script to use:

http://www.site.com/foo.php?phpsessid=gafklgjr952344afgfa

Either way, it is best to use a proper URL. Even when Web clients handle 
improper URLs (most handle http://www.example.org for example, which 
fails to specify any resource), it is dangerous to depend on that.The 
old saying, be strict in what you send and lenient in what you 
receive, has unfortunately been combined with, use whatever works, so 
that many people are now lenient in what they send. :-)

do I have to do anything so
that I force php to recognize the session id in the query string?


The short answer is yes. However, it must be named whatever PHP is 
expecting it to be named (for example, a variable named foo won't be 
assumed to be the unique identifier), and you must not have php.ini 
configurations that will force PHP to ignore it (such as 
session.use_only_cookies, or whatever that one is called).

I hope that answers your question. :-)

Chris


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




[PHP] ob_end_clean and header redirecting

2002-09-21 Thread electroteque

function return_exit() {
if (EXIT_AFTER_REDIRECT == 1) {
 return exit();
}
  }

// Redirect to another page or site
  function redirect($url) {
header('Location: ' . $url);
return_exit();
  }
ob_start();
echo script/script;
ob_end_flush();
ob_end_clean();
redirect($PHP_SELF);

here is a test i'm trying to be able to send script into the header and then
be able to redirect ones the script output has finished,  it states in the
manual that ob_end_clean : This function discards the contents of the
output buffer and turns off output buffering.  so can it remove the
buffered output somehow onces it has been flushed before i redirect ? its an
issue i'd like to solve sure there is document.location but i'd prefer to
stick with header for redirecting let me know



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




Re: [PHP] checking if an array is empty

2002-09-21 Thread Michael Sims

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

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

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

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

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

Sorry if I'm still misunderstanding...

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




RE: [PHP] checking if an array is empty

2002-09-21 Thread electroteque

yeh wicked thanks

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


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

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

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

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

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

Sorry if I'm still misunderstanding...


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




[PHP] Design question.

2002-09-21 Thread Chuck PUP Payne

Hi,

I have a question. I been working a personal project that I am want to make
a like simpler. I have several pages have in which I have place the
information to connect to my database, whick is getting old.

What I am wanting to do is create file like most do, a config, but I want to
know which is better, config.php or config.inc. I know there not much
different from what I have read but I am wanting to know which gives more
protection. And what recommendation would you give on set it up? I am only
asking because I am at some point wanting to release my project to public.

Chuck Payne
Magi Design and Support


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




[PHP] more stress on server...

2002-09-21 Thread Matt Zur

Here is the site and the file names:
Test Site:
- index.php
- about.php
- services.php

Which example would cause more stress on the server and/or what are the 
advantages, disadvantages to each example?

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

With the index.php using a switch statment for the view var and file 
includes.

OR

Example 2
-index.php with these links:
a href=index.phpHome/a
a href=about.phpHome/a
a href=services.phpHome/a

Any help will be appreciated.

-Matt



-- 
Matt Zur
[EMAIL PROTECTED]
http://www.zurnet.com

Need a Web Site??? - Visit... www.zurnet.com

1997 - 2002 - 5th Anniversary!!!


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




Re: [PHP] Design question.

2002-09-21 Thread Justin French

Hi,

I place name all my included files *.inc... I place them all in a folder
/inc/ and place a .htaccess file in that directory to restrict the files
being served of HTTP:

Files ~ \.inc$
Order Allow,Deny
Deny from all
/Files

Another option would be to place them in a folder ABOVE your web root, so
that Apache can't serve them -- if you have that option.


This does a few things for me:

1. I know that all *.php files are intended to be served direct to the user
through a web browser, and I know that all .inc files are code fragments,
not intended to be run out of context.

2. As long as Apache is configured properly, no one will see any passwords n
stuff.


Cheers,

Justin



on 22/09/02 11:55 AM, Chuck PUP Payne ([EMAIL PROTECTED]) wrote:

 Hi,
 
 I have a question. I been working a personal project that I am want to make
 a like simpler. I have several pages have in which I have place the
 information to connect to my database, whick is getting old.
 
 What I am wanting to do is create file like most do, a config, but I want to
 know which is better, config.php or config.inc. I know there not much
 different from what I have read but I am wanting to know which gives more
 protection. And what recommendation would you give on set it up? I am only
 asking because I am at some point wanting to release my project to public.
 
 Chuck Payne
 Magi Design and Support
 


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




Re: [PHP] Design question.

2002-09-21 Thread Chris Shiflett

This explanation from Justin is worth saving.

I also like to call all of my included modules *.inc, and I prefer to 
store them outside of document root.

However, if you want to keep all of your files together, the .htaccess 
file shown below is the best way to restrict direct access to modules. 
Some people make the mistake of simply making *.inc files considered PHP 
by Apache (claiming it is better to execute them than to have their 
source code displayed), but this gives attackers the opportunity to 
execute your modules out of context - a very dangerous approach.

One extra note worth adding is that you should add this configuration to 
your httpd.conf if you are the Web server administrator. This will keep 
you from having to remember the .htaccess file everywhere. Justin's 
method is best for when you do not have this option.

Chris

Justin French wrote:

I place name all my included files *.inc... I place them all in a folder
/inc/ and place a .htaccess file in that directory to restrict the files
being served of HTTP:

Files ~ \.inc$
Order Allow,Deny
Deny from all
/Files

Another option would be to place them in a folder ABOVE your web root, so
that Apache can't serve them -- if you have that option.



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




Re: [PHP] [bob@elitegroup.on.ca: RE: php emails]

2002-09-21 Thread Michael Geier

I have never used BSD so forgive any of the obvious:
  1.  Sendmail installed on this machine?
  2.  Is the php.ini value for 'sendmail_path' correct?
  3.  Is there any firewall or port.deny for SMTP?
  4.  Can you send mail from the CLI?
-- 
Michael Geier
CDM Sports, Inc. - Systems Administrator
email: [EMAIL PROTECTED]

-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCM d-(---) s+:+ a31 C+++(++) ULVIS$ P---+ L+++ E--- 
W+++ N++ o+(-) K+ w(---) O M-- V--()@ PS+(++) PE Y+ PGP t+ 5+ 
X+ R++* tv+ b(+++) DI+ D++ G e+* h--- r+++ y
--END GEEK CODE BLOCK--


Quoting The Doctor [EMAIL PROTECTED]:

 Anyone knows why the below is hapeening?
 
 My PHP info page is on http://www.nk.ca/phpinfo.phtml
 
 - Forwarded message from Bob Federer [EMAIL PROTECTED]
 -
 
 Return-Path: [EMAIL PROTECTED]
 Received: from doctor.nl2k.ab.ca (IDENT:[EMAIL PROTECTED]
 [127.0.0.1])
   by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6) with ESMTP id
 g8M1FDh7013565
   (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168
 verify=NO)
   for [EMAIL PROTECTED]; Sat, 21 Sep 2002 19:15:13 -
0600
 (MDT)
 Received: (from root@localhost)
   by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6/Submit) id
 g8M1FDkG013564
   for [EMAIL PROTECTED]; Sat, 21 Sep 2002 19:15:13 -0600
 (MDT)
 Resent-Message-Id:
 [EMAIL PROTECTED]
 Received: from ELITE (CPE0050ba761922.cpe.net.cable.rogers.com
 [24.157.79.145])
   by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6) with SMTP id
 g8LMD1h8000209
   for [EMAIL PROTECTED]; Sat, 21 Sep 2002 16:13:04 -0600
 (MDT)
 Reply-To: [EMAIL PROTECTED]
 From: Bob Federer [EMAIL PROTECTED]
 To: System Administrator a.k.a. The Root of the Problem
 [EMAIL PROTECTED]
 Subject: RE: php emails
 Date: Sat, 21 Sep 2002 18:12:57 -0700
 Message-ID: [EMAIL PROTECTED]
 MIME-Version: 1.0
 Content-Type: text/plain;
   charset=iso-8859-1
 Content-Transfer-Encoding: 7bit
 X-Priority: 3 (Normal)
 X-MSMail-Priority: Normal
 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
 Importance: Normal
 In-Reply-To: [EMAIL PROTECTED]
 Resent-From: [EMAIL PROTECTED]
 Resent-Date: Sat, 21 Sep 2002 19:15:13 -0600
 Resent-To: The Doctor [EMAIL PROTECTED]
 
 Hello Dave,
 The php mail function is still not working. I've changed the coding
 a little
 bit to help you debug it. The code on the page is now:
 
 ?php
 mail('[EMAIL PROTECTED], [EMAIL PROTECTED]', 'An email to two people',
 'This is
 a test');
 ?
 
 As you can see, it will send an email to both you and me.
 
 To test the page you can go to community updates or
 sellwithpictures. The
 two URLs are:
 
 http://www.sellwithpictures.com/php/emailtest.html
 
 and
 
 http://www.communityupdates.com/php/emailtest.html
 
 Please email me when you have it working.
 Thanks for your effort.
 
 Apart from being a neat thing for a page to be able to do, I'm
 doing a quote
 for a large site where they require emails to be sent out by the
 site when
 someone fills out a form, so we need to have this figured out.
 
 Thanks again,
 
 bob
 
 
 -Original Message-
 From: System Administrator a.k.a. The Root of the Problem
 [mailto:[EMAIL PROTECTED]]
 Sent: September 21, 2002 12:54 PM
 To: Bob Federer
 Subject: Re: php emails
 
 On Sat, Sep 21, 2002 at 01:43:03PM -0700, Bob Federer wrote:
  Hello Dave,
 
  I'm going to want to be able to send emails form the Community
 Updates and
  Sell With Pictures sites using PHP.
 
  The code to send a simple email is very straightforward in php
 (it's one
  line of code) example below:
 
  ?phpmail('bob_elitegroup.on.ca', 'test email', 'This is just a
 test');?
 
  If the system is set up correctly on your end, it should work
 flawlessly.
  Unfortunately, at this point, it is not working. Apparently, the
 php.ini
  file needs to be adjusted at your end. The link below has details
 of how
 to
  do it.
 
  http://www.webmasterbase.com/article/679
 
 
  Could you look into this and let me know when you have made
 this
 functional?
 
 
 Try now.
 
  Thanks
 
  bob
 
 --
 contact:
 Dave Yadallee  NetKnow  The Internet Knowledge Company
 [EMAIL PROTECTED]  http://www.nl2k.ab.ca
 990-3244
 
 
 
 - End forwarded message -
 
 -- 
 Member - Liberal InternationalOn 11 Sept 2001 the WORLD was
 violated.
 This is [EMAIL PROTECTED] Ici [EMAIL PROTECTED]
 Society MUST be saved! Extremists must dissolve.  
 Beware of defining as intelligent only those who share your
 opinions
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-
 This email sent using CDM Sports Webmail v2
[ http://webmail.cdmsports.com ]


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




Re: [PHP] Design question.

2002-09-21 Thread Chuck PUP Payne

Thanks guys. That really helpful.

Chuck Payne

On 9/21/02 10:16 PM, Chris Shiflett [EMAIL PROTECTED] wrote:

 This explanation from Justin is worth saving.
 
 I also like to call all of my included modules *.inc, and I prefer to
 store them outside of document root.
 
 However, if you want to keep all of your files together, the .htaccess
 file shown below is the best way to restrict direct access to modules.
 Some people make the mistake of simply making *.inc files considered PHP
 by Apache (claiming it is better to execute them than to have their
 source code displayed), but this gives attackers the opportunity to
 execute your modules out of context - a very dangerous approach.
 
 One extra note worth adding is that you should add this configuration to
 your httpd.conf if you are the Web server administrator. This will keep
 you from having to remember the .htaccess file everywhere. Justin's
 method is best for when you do not have this option.
 
 Chris
 
 Justin French wrote:
 
 I place name all my included files *.inc... I place them all in a folder
 /inc/ and place a .htaccess file in that directory to restrict the files
 being served of HTTP:
 
 Files ~ \.inc$
Order Allow,Deny
Deny from all
 /Files
 
 Another option would be to place them in a folder ABOVE your web root, so
 that Apache can't serve them -- if you have that option.
 
 


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




Re: [PHP] Editor

2002-09-21 Thread Chip Wiegand

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

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

--
Chip


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




[PHP] Re: Help sending IMAP mail

2002-09-21 Thread Manuel Lemos

Hello,

On 09/21/2002 07:19 PM, Jeff Schwartz wrote:
 The IMAP documentation on the php site says that you can create an IMAP message 
using imap_mail_compose but fails to say how to send it.
 
 I've tried using imap_mail but it gives me a parameter count error.
 
 Does anyone know how to send the message?

I usually do not use the IMAP extension for composing and sending 
messages because I do not need IMAP and sending messages really has 
nothing to do with IMAP.

You may want to try this PHP class instead which is what I use to send 
messages, even complex ones with attachments, HTML with embedded images, 
text and HTML alternative versions in the same message, messages with 
non-ASCII characters (accents, cedillas, characters of other alphabets).

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos


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




Re: [PHP] Best Practice

2002-09-21 Thread Peter J. Schoenster

On 21 Sep 2002 at 12:51, Ashley M. Kirchner wrote:

 
 I'm working on converting several static (price) pages on our site
 into dynamic pages, with the data stored in an MySQL database and
 PHP to pull the data out, with CSS to build the page and present it.

I don't see how CSS would build anything, I guess it's just 
terminology.

  At the same time, I would also like to have a 'printer friendly'
 link on each page that visitors can click on and get the same page
 re-rendered for easy printing.  What's the best way to get the data
 converted from one form to another?  Should I be querying the
 database again to get the same data to reformat?  Should I store the
 data in sessions and reformat based on the CSS?  I would think
 having to query twice for the same thing would be a degradation in
 performance, right?  So what's the best practice?

I have not idea what the best practice is. If your data changes 
infrequently you could build static pages, nothing faster than static 
pages. Few people work on sites where most of these questions mean 
much. A friend worked on a site that he and I had developed and I left 
the firm and he later said the customer was complaining about response 
time .. I suggested he take the query string and cache the response in 
a db file and check that db file for every incoming request rather than 
going to Oracle (yeah, they were using Oracle when mysql would have 
done fine). They opted to just bolster the hardware, end of complaints 
and it was running plain cgi, not even mod_perl. Oh well.

I do something that few people do. I take a request from the *client* 
and I process it. Just data manipulation. Since I'm doing the web I get 
an html template (from Smarty.php.net in this case) and do a merge. I 
like to use a wrapper, as such:

$data contains an array or arrays of whatever which is all the data 
needed for this page (based on the query string in the request). It is 
the body of the page (I've got smarty in my own class, viewer):

$data['content'] = $g-viewer-Merge($data,$template); 

Now, I merge everything with the WRAPPING page:

print  $g-viewer-Merge($data,'index.html'); 

Here is my index.html page ($content is the body of the page):

{include file=inc/header.html}

{include file=../site_nav.html}
table width=80%
tr
td valign=top width=25%

{include file=./left_nav.html}

/td
td  valign=top width=74%
{$content}
/td
/tr
/table

{include file=inc/footer.html}

__END index.html

So if you want to show a printable page just do something like this:

if($print == 1) {
print  $g-viewer-Merge($data,'print_index.html'); 

where print_index.html would have a different layout, perhaps minimal 
header and footer or none at all. Or you  could do some processing on 
the data or whatever. 


Peter











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




Re: [PHP] [bob@elitegroup.on.ca: RE: php emails]

2002-09-21 Thread The Doctor

On Sat, Sep 21, 2002 at 09:26:56PM -0500, Michael Geier wrote:
 I have never used BSD so forgive any of the obvious:
   1.  Sendmail installed on this machine?

Yes.

   2.  Is the php.ini value for 'sendmail_path' correct?

Yes.

   3.  Is there any firewall or port.deny for SMTP?

NO?

   4.  Can you send mail from the CLI?

Explain.

 -- 
 Michael Geier
 CDM Sports, Inc. - Systems Administrator
 email: [EMAIL PROTECTED]
 
 -BEGIN GEEK CODE BLOCK-
 Version: 3.12
 GCM d-(---) s+:+ a31 C+++(++) ULVIS$ P---+ L+++ E--- 
 W+++ N++ o+(-) K+ w(---) O M-- V--()@ PS+(++) PE Y+ PGP t+ 5+ 
 X+ R++* tv+ b(+++) DI+ D++ G e+* h--- r+++ y
 --END GEEK CODE BLOCK--
 
 
 Quoting The Doctor [EMAIL PROTECTED]:
 
  Anyone knows why the below is hapeening?
  
  My PHP info page is on http://www.nk.ca/phpinfo.phtml
  
  - Forwarded message from Bob Federer [EMAIL PROTECTED]
  -
  
  Return-Path: [EMAIL PROTECTED]
  Received: from doctor.nl2k.ab.ca (IDENT:[EMAIL PROTECTED]
  [127.0.0.1])
  by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6) with ESMTP id
  g8M1FDh7013565
  (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168
  verify=NO)
  for [EMAIL PROTECTED]; Sat, 21 Sep 2002 19:15:13 -
 0600
  (MDT)
  Received: (from root@localhost)
  by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6/Submit) id
  g8M1FDkG013564
  for [EMAIL PROTECTED]; Sat, 21 Sep 2002 19:15:13 -0600
  (MDT)
  Resent-Message-Id:
  [EMAIL PROTECTED]
  Received: from ELITE (CPE0050ba761922.cpe.net.cable.rogers.com
  [24.157.79.145])
  by doctor.nl2k.ab.ca (8.12.6.Beta1/8.12.6) with SMTP id
  g8LMD1h8000209
  for [EMAIL PROTECTED]; Sat, 21 Sep 2002 16:13:04 -0600
  (MDT)
  Reply-To: [EMAIL PROTECTED]
  From: Bob Federer [EMAIL PROTECTED]
  To: System Administrator a.k.a. The Root of the Problem
  [EMAIL PROTECTED]
  Subject: RE: php emails
  Date: Sat, 21 Sep 2002 18:12:57 -0700
  Message-ID: [EMAIL PROTECTED]
  MIME-Version: 1.0
  Content-Type: text/plain;
  charset=iso-8859-1
  Content-Transfer-Encoding: 7bit
  X-Priority: 3 (Normal)
  X-MSMail-Priority: Normal
  X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
  X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
  Importance: Normal
  In-Reply-To: [EMAIL PROTECTED]
  Resent-From: [EMAIL PROTECTED]
  Resent-Date: Sat, 21 Sep 2002 19:15:13 -0600
  Resent-To: The Doctor [EMAIL PROTECTED]
  
  Hello Dave,
  The php mail function is still not working. I've changed the coding
  a little
  bit to help you debug it. The code on the page is now:
  
  ?php
  mail('[EMAIL PROTECTED], [EMAIL PROTECTED]', 'An email to two people',
  'This is
  a test');
  ?
  
  As you can see, it will send an email to both you and me.
  
  To test the page you can go to community updates or
  sellwithpictures. The
  two URLs are:
  
  http://www.sellwithpictures.com/php/emailtest.html
  
  and
  
  http://www.communityupdates.com/php/emailtest.html
  
  Please email me when you have it working.
  Thanks for your effort.
  
  Apart from being a neat thing for a page to be able to do, I'm
  doing a quote
  for a large site where they require emails to be sent out by the
  site when
  someone fills out a form, so we need to have this figured out.
  
  Thanks again,
  
  bob
  
  
  -Original Message-
  From: System Administrator a.k.a. The Root of the Problem
  [mailto:[EMAIL PROTECTED]]
  Sent: September 21, 2002 12:54 PM
  To: Bob Federer
  Subject: Re: php emails
  
  On Sat, Sep 21, 2002 at 01:43:03PM -0700, Bob Federer wrote:
   Hello Dave,
  
   I'm going to want to be able to send emails form the Community
  Updates and
   Sell With Pictures sites using PHP.
  
   The code to send a simple email is very straightforward in php
  (it's one
   line of code) example below:
  
   ?phpmail('bob_elitegroup.on.ca', 'test email', 'This is just a
  test');?
  
   If the system is set up correctly on your end, it should work
  flawlessly.
   Unfortunately, at this point, it is not working. Apparently, the
  php.ini
   file needs to be adjusted at your end. The link below has details
  of how
  to
   do it.
  
   http://www.webmasterbase.com/article/679
  
  
   Could you look into this and let me know when you have made
  this
  functional?
  
  
  Try now.
  
   Thanks
  
   bob
  
  --
  contact:
  Dave Yadallee  NetKnow  The Internet Knowledge Company
  [EMAIL PROTECTED]  http://www.nl2k.ab.ca
  990-3244
  
  
  
  - End forwarded message -
  
  -- 
  Member - Liberal International  On 11 Sept 2001 the WORLD was
  violated.
  This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
  Society MUST be saved! Extremists must dissolve.  
  Beware of defining as intelligent only those who share your
  opinions
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 -
  This email sent using CDM Sports Webmail v2
 [ 

Re: [PHP] Best Practice

2002-09-21 Thread @ Edwin

Hi there,

On Sunday, September 22, 2002 12:20 PM
Subject: Re: [PHP] Best Practice
Peter J. Schoenster wrote:
snip
 On 21 Sep 2002 at 12:51, Ashley M. Kirchner wrote:

 
  I'm working on converting several static (price) pages on our site
  into dynamic pages, with the data stored in an MySQL database and
  PHP to pull the data out, with CSS to build the page and present it.

 I don't see how CSS would build anything, I guess it's just
 terminology.

/snip

Actually, in a sense, CSS can "build" a page--esp. if "build" means how data
are to be presented (formatted) by the browser. Remember, with CSS you can
hide and unhide elements?

For the original question...

   At the same time, I would also like to have a 'printer friendly'
  link on each page that visitors can click on and get the same page
  re-rendered for easy printing.  What's the best way to get the data
  converted from one form to another?  Should I be querying the
  database again to get the same data to reformat?  Should I store the
  data in sessions and reformat based on the CSS?  I would think
  having to query twice for the same thing would be a degradation in
  performance, right?  So what's the best practice?


The best practice, IMHO, is the one implemented here:

  http://www.alistapart.com/

Try the page with your standard-compliant browser (like N7) and with a
(crappy) browser like N4 and see the difference. You can "dissect" the site
and find out how they did it. Or, you can read articles like this:

  http://www.alistapart.com/stories/netscape/

And one for "easy printing":

  http://www.alistapart.com/stories/goingtoprint/

- E

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


Re: [PHP] Design question.

2002-09-21 Thread @ Edwin

(Sorry if I've already sent this.)

I agree. But, I don't really see any problem having *.inc files as *.inc.php
(so that they'll be executed by Apache) esp. IF the config file have only
this: (Even if this is executed nothing shows up...)

?php

  $my_super_user = 'blahblah';
  $my_super_password = 'blahblahblah';

?

I just thought this is worth knowing esp. if there's no way you can use
.htaccess. (Of course, if you can't use .htaccess, you might want to change
ISPs or set up your own server but that is for a different topic :)

- E

 This explanation from Justin is worth saving.

 I also like to call all of my included modules *.inc, and I prefer to
 store them outside of document root.

 However, if you want to keep all of your files together, the .htaccess
 file shown below is the best way to restrict direct access to modules.
 Some people make the mistake of simply making *.inc files considered PHP
 by Apache (claiming it is better to execute them than to have their
 source code displayed), but this gives attackers the opportunity to
 execute your modules out of context - a very dangerous approach.

 One extra note worth adding is that you should add this configuration to
 your httpd.conf if you are the Web server administrator. This will keep
 you from having to remember the .htaccess file everywhere. Justin's
 method is best for when you do not have this option.

 Chris

 Justin French wrote:

 I place name all my included files *.inc... I place them all in a folder
 /inc/ and place a .htaccess file in that directory to restrict the files
 being served of HTTP:
 
 Files ~ \.inc$
 Order Allow,Deny
 Deny from all
 /Files
 
 Another option would be to place them in a folder ABOVE your web root, so
 that Apache can't serve them -- if you have that option.
 


 --
 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] accessing session variables

2002-09-21 Thread Jeff Bluemel

I'm assuming there has got to be a better answer then this, but I found I
had the same problem is I was using headers to go to the next page, but when
I used the html tags then everything was fine (the SID wasn't getting
passed).


Murat Ö. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 i have written

 ini_set(session.name, SID);

 before, in page1.php. and i've added it on page2.php before session_start
 and it works.

 thanks..



 Murat Ö. [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  i tried but it didn't work.
  i wrote in page2.php:
 
  ?php
  session_start();
  echo $_SESSION['isim'];
  ?
 
  and i was noticed: Undefined index: isim in .
 
  but i have written $_SESSION['isim']='murat' in page1.php
 
 
 
  Sascha Cunz [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Just use the session_start() in the second page and they will be
magically
  there where you've put them in the first page.
 
  Sascha
 
  Am Samstag, 21. September 2002 17:01 schrieb Murat Ö.:
   hi,
  
   page1.php creates a session and its variables in it in  successfully.
 the
   variables and values are created like
   $_SESSION['x']='abc'
  
page1.php sends the SID information to page2.php via GET method. how
 can
  i
   access the those variables with SID information in page2.php?
  
   thanks
 
 





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




[PHP] Re: Editor

2002-09-21 Thread Jeff Bluemel

I am using Zend Studio, and I absolutely love it.  this isn't just an
editor, but a project manager, and has debugging options where it loads the
file in your default browser, and then allows you to do step through, add
watches etc.

http://zend.com/store/products/zend-studio.php


Bryan McLemore [EMAIL PROTECTED] wrote in message
004901c26170$fc6fc510$0101a8c0@fwcmain">news:004901c26170$fc6fc510$0101a8c0@fwcmain...
Hi guys, just wondering if anyone could recomend a good editor that is based
on windows.  Thanks, Bryan



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




Re: [PHP] Best Practice

2002-09-21 Thread Peter J. Schoenster

On 22 Sep 2002 at 12:31,  Edwin wrote:

 Actually, in a sense, CSS can build a page--esp. if build means how
 data are to be presented (formatted) by the browser. Remember, with CSS
 you can hide and unhide elements?

Ah .. yes ... forgot about that. That is building. Appreciate the 
reminder.

 The best practice, IMHO, is the one implemented here:
 
   http://www.alistapart.com/
 
 Try the page with your standard-compliant browser (like N7) and with a
 (crappy) browser like N4 and see the difference. You can dissect the
 site and find out how they did it. Or, you can read articles like this:
 
   http://www.alistapart.com/stories/netscape/
 
 And one for easy printing:
 
   http://www.alistapart.com/stories/goingtoprint/

I gotta go back and refresh myself. Thanks for the links. 


Peter

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




[PHP] Running a PHP script automatically?

2002-09-21 Thread Joseph Szobody

Folks, I have a PHP script that needs to be executed automatically every 15 minutes. I 
have the option of doing this on a RedHat linux box, or on Windows 2000 Server.

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

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

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

Any insight? Thanks!

Joseph


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




Re: [PHP] Running a PHP script automatically?

2002-09-21 Thread Chris Shiflett

Joseph,

The easiest way, in my opinion, is to make your PHP script into a shell 
script or to call it with PHP yourself. A Red Hat Linux box is going to 
have a command line PHP located somewhere like /usr/bin/php. So, make 
the first line of your PHP script something like this:

#! /usr/bin/php

Make sure it is executable (chmod 755 script.php, for example), and 
execute it:

./script.php

With cron, just call the script using the full path, and you're all set.

Happy hacking.

Chris

Joseph Szobody wrote:

Folks, I have a PHP script that needs to be executed automatically every 15 minutes. 
I have the option of doing this on a RedHat linux box, or on Windows 2000 Server.

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



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




Re: [PHP] Running a PHP script automatically?

2002-09-21 Thread Keith Vance

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

For example:
#!/usr/local/bin/php -q
?php
print Hello world.\n;
?

The -q suppresses the html crap that gets spit out. I don't know jack
about Redhat (Debian rocks), you might be able to get an RPM that will
install the php executable for you.

To do the crontab:
RUN THIS COMMAND
crontab -e

TYPE THIS
15,30,45,0 * * * * name_of_your_script

THEN
ESC
:wq

Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399

Try my open source PHP authentication system, Rampart by visiting 
http://rampart.sourceforge.net/. Commercial support is available at, 
http://www.vanceconsulting.net/support/.

On Sat, 21 Sep 2002, Joseph Szobody wrote:

 Folks, I have a PHP script that needs to be executed automatically every 15 minutes. 
I have the option of doing this on a RedHat linux box, or on Windows 2000 Server.

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

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

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

 Any insight? Thanks!

 Joseph


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