Re: [PHP] Do PHP boolean operators short circuit?

2003-09-20 Thread Curt Zirzow
* Thus wrote Jason Wong ([EMAIL PROTECTED]):
 On Saturday 20 September 2003 10:57, John W. Holmes wrote:
 
 [snip]
 
   From my experience, it will work that way. I don't know if it's that
  way for every version or not, though.
 
 manual  Migrating from PHP/FI 2 to PHP 3

heh... i havn't seen a PHP/FI reference in a long while, thanks for
reminding us how far php has come along today :)


cheers.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Problem with getting non-blocking data from stdin

2003-09-20 Thread Robert Cummings
On Sat, 2003-09-20 at 02:02, Curt Zirzow wrote:
 hmm.. on second thought...
 
 * Thus wrote Robert Cummings ([EMAIL PROTECTED]):
  [...]
  if( ($char = fread( $stdin, 1 )) !== false )
 
 How are you calling this script?  I'm not sure how cgi will handle
 fread stdin
 
 With a traditional CGI script stdin is what is read on POST data
 from a form, and php takes care of this.
 
 That is where my confusion is now.

I'm calling it as php -qC foo.php. The fread() should work since it
works on input when I don't have stdin in non-blocking mode. Perhaps
it's a bug. I took a look at the doc on streams again, and it uses
php://input as the POST stream. Maybe it's a bug.

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

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



Re: [PHP] Problem with getting non-blocking data from stdin

2003-09-20 Thread Robert Cummings
On Sat, 2003-09-20 at 01:53, Dan Anderson wrote:
 I find your responses to my e-mails quite humorous.  Upon review --
 aside from a single WTF -- I don't think I was condescending in any way
 shape or form.  I was just trying to offer help.

The particular shape of your help was non newbie friendly. I think that,
combined with your incorrect assessments made it all the more annoying.
And yes, WTF and you really need to read the documentation played a
key part also since they were quite condescending, and inappropriate
given your incorrect answers and knowledge of functionality.

 After reading about wrappers, I find it doubly humorous that you didn't
 just disregard my e-mail when I asked you why you were using php://. 
 It's not like I said: php:// isn't a valid protocol.  http://; and
 ftp://; are all PHP supports.  I just said Why are you using php://
 below?
 
 And I also qualified my statements about fsockopen() and
 set_stream_blocking by saying I seem to remember and If I remember
 correctly.  And, yes, in PHP 3.0 or whatever it was that was true. 
 Hence the if I remember.

Yes a lovely weasel statement if ever I saw one.

 
 So, it would seem to me that as soon as you got to the WTF you should
 have said, This guy thinks I am a noob.  And at that point you should
 have just said thanks but you're wrong. 

Actually at that point I thought, this guy thinks I'm an noob and he's
being an arse about it. That's no way to treat noobs that post
appropriate questions.

 And, just for the record, you never explicitly stated that you needed a
 reason to read in only one character at a time.  You just sent a bunch
 of code down the pipe.  So it seems quite natural to assume you're just
 making a noobish mistake -- reading a char at a time when a string will
 do.

I certainly explained quite well what the problem was. And as you
assumed I was making a noobish mistake and sent a scathing response to
my problem, I also assumed you were an ass, and needed some kind of
clarification.

 Anyways, you are running an infinite loop and I don't quite see how this
 is exiting:

YES, this is the original question. Why is it exiting. To which you gave
me a whole set of unrequested answers that weren't even on the topic of
my post.

 while (1) 
 {
 if ()
 else
 }
 
 But, hey, more power to you if you've gotten to the level where you
 don't understand why people who don't understand some esoteric function
 are such muppets.

If you don't understand the function, then why are you posting answers
as though you do? Someone asks me about quantum physics, I don't pretend
to know and confuse the whole issue.

 
 BTW: If you insist on keeping up with the flamethrowers kindly e-mail me
 off list so as not to bother others on the listserv.

Yes, if you reply I'll be sure to take the next one off list, but since
you made this public, I'm sure readers would love to see the backdraft.
The above statement is actually an underhanded attempt to get the last
public word while preventing me from a public response. If you were so
keen to have it off the list, then this email I'm responding to, should
have been off-list itself.

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

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



Re: [PHP] Clear ALL Cookies previously set

2003-09-20 Thread Eugene Lee
On Fri, Sep 19, 2003 at 09:14:57PM -0400, Stevie D Peele wrote:
: 
: How can I clear all cookies that have been previously set?
: 
: I want this in an if statement so something like
: 
: if ($value == $blue){
: clear all cookies;
: setcookie(name,time()+3600);
: }

Walk through your $_COOKIE array and expire each one:

if ($value == $blue)
{
foreach ($_COOKIE as $name = $value)
{
setcookie($_COOKIE[$name], , time()-3600);
}
}

But I don't know what might happen if you use setcookie() to expire a
cookie and then use setcookie() later on to set the same cookie.

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



Re: [PHP] Problem with getting non-blocking data from stdin

2003-09-20 Thread Eugene Lee
On Sat, Sep 20, 2003 at 02:14:54AM -0400, Robert Cummings wrote:
: On Sat, 2003-09-20 at 01:53, Dan Anderson wrote:
: 
:  I find your responses to my e-mails quite humorous.  Upon review --
:  aside from a single WTF -- I don't think I was condescending in any way
:  shape or form.  I was just trying to offer help.
: 
: The particular shape of your help was non newbie friendly. I think that,
: combined with your incorrect assessments made it all the more annoying.
: And yes, WTF and you really need to read the documentation played a
: key part also since they were quite condescending, and inappropriate
: given your incorrect answers and knowledge of functionality.
[...snips snipped...]

Can't we just get along and bash M$ ?  Or VeriSign ?  :-)

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



[PHP] Enterprise PHP market research results

2003-09-20 Thread Alexandru COSTIN
Hello,
We have published the results of the Enterprise PHP research on our website.

See the link to InterAKT and Zend survey, together with lots of insightful
comments, here:
http://developers.slashdot.org/article.pl?sid=03/09/19/2133204

We would like to get a link to our survey from www.php.net - There is a link
to the Zend Survey, and our is a complementary one.

Alexandru

--
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312

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



[PHP] Slashdot:: PHP usage in the Enterprise - results

2003-09-20 Thread Alexandru COSTIN
Hello,



We have published the results of the Enterprise PHP research on our website.



See the link to InterAKT and Zend survey, together with lots of insightful
comments, here:

http://developers.slashdot.org/article.pl?sid=03/09/19/2133204mode=threadtid=126tid=169





We would like to get a link to our survey from www.php.net - There is a link
to the Zend Survey, and our is a complementary one.



Whom should we contact? We've tried before and we've never been successful
:)



Alexandru


-- 
Alexandru COSTIN
Chief Operating Officer
http://www.interakt.ro/
+4021 312 5312

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



Re: [PHP] Best way to approach object construction errors?

2003-09-20 Thread Marco Schuler
Am Don, 2003-09-18 um 20.36 schrieb Mike Zornek:
 I've created a class called university, it has a constructor which can
 accept an id. If the id is sent during construction the constructor will
 connect to a MySQL db to set all of the objects member variables to the
 MySQl counterparts.
 
 I'd like to include some error notification so if I send it an id and let's
 say that record doesn't exist in the db I get some notification and can
 write a message out to log (or screen). But what is the best way to do this?
 Any recommendations? Tutorials? URLs?

Maybe you'd like to have a look at PEAR error-handling.

http://pear.php.net/manual/en/core.pear.php


--
Cheers!
 Marco

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



[PHP] php.net

2003-09-20 Thread Paul Marinas
I've got an error when i try to access www.php.net, are there any
problems?

Paul

GnuPG Key http://sgi.rdscv.ro/~paulm/paulm.PGP

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



[PHP] PhpProblem

2003-09-20 Thread Yonis Rouma
Yonis Rouma wrote:
 Hi I am Daniel H R U
 I am new in PhP and I download Apache2triad 1.1.6 and I install it but when I am 
trying to run apache2triad in my computer it give this Message:  
 PHP Warning:  Unknown(): Unable to load dynamic library 
'c:\apache2\php\extensions\php_fdf.dll' - A device attached to the system is not 
functioning.
 
 please I want any help to solve my problem quickly. 
 
 Thank you



Re: [PHP] Problem with getting non-blocking data from stdin

2003-09-20 Thread Marek Kilimajer
File a bug report. stream_set_blocking() started to work for files only 
since version 4.3, so it is likely full of bugs. Actualy, using cli php 
4.3.2 I got this results some weird results. Your version run infinitely 
but changing echo 'Fooo!'.\n; to echo 'Fooo!'; (removing newline) 
resulted in the same behavior as you experienced. fread did not return 
false even if no key was pressed, only empty string but this might be 
correct, i don't know. Both fgetc and fgets did return false.

Robert Cummings wrote:

On Sat, 2003-09-20 at 02:02, Curt Zirzow wrote:

hmm.. on second thought...

* Thus wrote Robert Cummings ([EMAIL PROTECTED]):

[...]
   if( ($char = fread( $stdin, 1 )) !== false )
How are you calling this script?  I'm not sure how cgi will handle
fread stdin
With a traditional CGI script stdin is what is read on POST data
from a form, and php takes care of this.
That is where my confusion is now.


I'm calling it as php -qC foo.php. The fread() should work since it
works on input when I don't have stdin in non-blocking mode. Perhaps
it's a bug. I took a look at the doc on streams again, and it uses
php://input as the POST stream. Maybe it's a bug.
Cheers,
Rob.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Using PHP to compile uploaded sourcecode with cygwins gcc?

2003-09-20 Thread DvDmanDT
Hello, I have an intresting problem: I want to let users upload sourcecode
and then compile it using my cygwin gcc... But one thing at a time... I
can't get that gcc to execute...

shell_exec(gcc temp.c); # Doesn't work as that will use MinGW
shell_exec(D:\\cygwin\\bin\\gcc.exe temp.c); /* Gives some error about dll
stuff (procedure not found I think)*/

So my next though was to open bash.exe --login -I and fwrite the
commands... But that still tries to use the mingw compiler it seems...Guess
there's some environiment problem... So I figured I could use virtual() to a
cgi script with this as first line:
#!D:/cygwin/bin/perl
and then use the perl open(), with |/cygdrive/d/bin/gcc.exe temp.c as
argument... Seems like it executes the right compiler then, but then I get
millions of errors caused by *.h can't be opened (yes, the source tries to
include them), so I though about passing -B /usr/include to it... But those
errors still appear... Also, it feels somewhat bad to use virtual() to call
perl scripts, so I was wondering if you ppl have some nice idea on how I
would do it?

Paths:
Cygwin: d:\cygwin
PHP: C:\PHP (4.3.3, zip from php.net, installed as Apache 1.3.28 module)
Apache: D:\Apache (installed using .msi package, as service)
Perl: D:\perl\bin\perl.exe (or D:\cygwin\bin\perl.exe)
Script: D:\www2\compile.php, D:\www2\compiling\compile_cyg.cgi
Sourcecode: D:\www2\compiling\temp.c (yes, only one file yet, that's a later
problem)

pwd returns I'm in the 'compiling' folder, in the php script, I chdir() to
get into that folder...

Can anyone help, please? Security is not a concern, it's private, and it's
for learning purposes mostly... I use winXP home... I can install stuff like
I want, that's not a problem... Thanks in advance!


-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]

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



[PHP] Subcategories in php

2003-09-20 Thread phpu
Hi, 

I have been trying to do this for weeks but i just cant figure this out. I have 
categories that have subcategories and i want to insert them into database. My table 
looks like this: cat_id, parent_id and cat_name.
Let's say i wanna insert a subcategory that is associated with its parent category.
For example

ParentCat 1 
ParentCat 1  ItsSubCat 1 
ParentCat 1  ItsSubCat 2
ParentCat 1  ItsSubCat 3
ParentCat 1  ItsSubCat 4
ParentCat 2 
ParentCat 2  ItsSubCat 1 

and so on ... 

I don't know how to create the script that inserts any subcategory(in this case let's 
say ItsSubCat 3) in its parent category.
Please, can someone help me

thanks


RE: [PHP] Subcategories in php

2003-09-20 Thread Greg Donald

 I don't know how to create the script that inserts any 
 subcategory(in this case let's say ItsSubCat 3) in its parent 
 category.
 Please, can someone help me


I'd use the parent category id as a hidden field in the form when adding a
sub category.

Here is a complete script that contains all the code you would need:

http://destiney.com/pub/phplinks_2.1.2.tar.gz



--
Greg Donald
[EMAIL PROTECTED]
615-746-9414 home
615-594-6052 cell

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



Re: [PHP] Subcategories in php

2003-09-20 Thread Larry E . Ullman
I have been trying to do this for weeks but i just cant figure this 
out. I have categories that have subcategories and i want to insert 
them into database. My table looks like this: cat_id, parent_id and 
cat_name.
Let's say i wanna insert a subcategory that is associated with its 
parent category.
If I understand your situatoin, I would create two tables:
categories (category_id, category_name)
subcategories (subcategory_id, category_id, subcategory_name)
Then, in your PHP script, have the user select the category and enter 
the subcategory name. The SQL INSERT would then be
INSERT INTO subcategories (category_id, subcategory_name) VALUES 
($cat_id, '$subcat_name');

Larry

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


[PHP] preg_replace question

2003-09-20 Thread Armand Turpel
I need the following replace function:
Replace all line breaks to br but not if a line break comes after an /h1
or /h2 or   /hx


Currently I use this preg_replace but it's not good enough for all
situations.

$text = preg_replace(/([^\][^\/][^h][^1-9].{1})\r\n/,\\1br  /,$text);




Thanks

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



Re: [PHP] preg_replace question

2003-09-20 Thread Jim Lucas
$arr = array(/([^\][^\/][^h][^1-6].{1}[^\])\r\n/,
 /([^\][^\/][^h][^1-6].{1}[^\])\r/,
 /([^\][^\/][^h][^1-6].{1}[^\])\n/,
 );

$text = preg_replace($arr,\\1br  /,$text);

you might try this and see how well it works.

Jim Lucas


- Original Message - 
From: Armand Turpel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 20, 2003 8:21 AM
Subject: [PHP] preg_replace question


 I need the following replace function:
 Replace all line breaks to br but not if a line break comes after an
/h1
 or /h2 or   /hx


 Currently I use this preg_replace but it's not good enough for all
 situations.

 $text = preg_replace(/([^\][^\/][^h][^1-9].{1})\r\n/,\\1br
/,$text);


 

 Thanks

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



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



[PHP] session_start() || shell access problem......

2003-09-20 Thread CF High
Hey all.

I'm running a script from the command-line php interpreter as follows:
(thanks to D. Souza for lead)

$text = `usr/local/bin/php /path/to/my/php/page.php`;

within the read file I want to enable sessions, so I session_start() at the
top of the page:

?
session_start();
?
?
code to execute here...
?

Regardless of how I mess around with placement of session_start(), I get a
Headers already sent.

Why? Nothing has been output to the browser within the read file!
Furthermore, if I create a test page with just:

?$text = `usr/local/bin/php /path/to/my/php/page.php`;?

Still receive Headers already sent.

My eyes are completely fried -- anyone feel like saving my vision?

--Noah

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



Re: [PHP] preg_replace question

2003-09-20 Thread Armand Turpel
Hi Jim ,
The problem with your proposition is that the preg_replace do not replace
/h1\r\n  to  /h1br / 
thats good,
but also not this:
testh4\r\n

and thats not what I expect from.


atur






- Original Message - 
From: Jim Lucas [EMAIL PROTECTED]
To: Armand Turpel [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, September 20, 2003 5:37 PM
Subject: Re: [PHP] preg_replace question


 $arr = array(/([^\][^\/][^h][^1-6].{1}[^\])\r\n/,
  /([^\][^\/][^h][^1-6].{1}[^\])\r/,
  /([^\][^\/][^h][^1-6].{1}[^\])\n/,
  );
 
 $text = preg_replace($arr,\\1br  /,$text);
 
 you might try this and see how well it works.
 
 Jim Lucas
 
 
 - Original Message - 
 From: Armand Turpel [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, September 20, 2003 8:21 AM
 Subject: [PHP] preg_replace question
 
 
  I need the following replace function:
  Replace all line breaks to br but not if a line break comes after an
 /h1
  or /h2 or   /hx
 
 
  Currently I use this preg_replace but it's not good enough for all
  situations.
 
  $text = preg_replace(/([^\][^\/][^h][^1-9].{1})\r\n/,\\1br
 /,$text);
 
 
  
 
  Thanks
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 


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



php-general Digest 20 Sep 2003 17:34:41 -0000 Issue 2308

2003-09-20 Thread php-general-digest-help

php-general Digest 20 Sep 2003 17:34:41 - Issue 2308

Topics (messages 163271 through 163298):

Re: Problem with getting non-blocking data from stdin
163271 by: Dan Anderson
163272 by: Robert Cummings
163273 by: Robert Cummings
163274 by: Curt Zirzow
163275 by: Robert Cummings
163276 by: Dan Anderson
163278 by: Curt Zirzow
163279 by: Curt Zirzow
163281 by: Robert Cummings
163282 by: Robert Cummings
163284 by: Eugene Lee
163290 by: Marek Kilimajer

Re: Do PHP boolean operators short circuit?
163277 by: Jason Wong
163280 by: Curt Zirzow

Re: Clear ALL Cookies previously set
163283 by: Eugene Lee

Slashdot:: PHP usage in the Enterprise - results
163285 by: Alexandru COSTIN

Enterprise PHP market research results
163286 by: Alexandru COSTIN

Re: Best way to approach object construction errors?
163287 by: Marco Schuler

php.net
163288 by: Paul Marinas

PhpProblem
163289 by: Yonis Rouma

Using PHP to compile uploaded sourcecode with cygwins gcc?
163291 by: DvDmanDT

Subcategories in php
163292 by: phpu
163293 by: Greg Donald
163294 by: Larry E. Ullman

preg_replace question
163295 by: Armand Turpel
163296 by: Jim Lucas
163298 by: Armand Turpel

session_start() || shell access problem..
163297 by: CF High

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---
One more thing:

gdb doesn't do a damned thing for debugging PHP scripts.  Look for the
errors and warnings output to the browser.  (or tty if you're using
/usr/bin/php).  

-Dan

On Sat, 2003-09-20 at 00:33, Robert Cummings wrote:
 I wanted t play around with the CGI (not CLI) version of PHP and get a
 feel for the I/O stuff, specifically STDIN. So I whipped up the
 following script:
 
 ///
 
 #!/usr/bin/php -qC
 ?
   
 if( ($stdin = fopen( 'php://stdin', 'r' )) === false )
 { 
 echo 'Failed to open STDIN'.\n;
 exit();
 }  
  
 stream_set_blocking( $stdin, false );
  
 $count = 0;  
 while( 1 ) 
 { 
 echo 'Foo: '.($count++).\n;
 if( ($char = fread( $stdin, 1 )) !== false )
 {
 echo $char.\n;
 }
 else
 {
 echo 'Fooo!'.\n;
 }
 }
 
 
 
 Simple enough right?! The problem is the program exits seemingly
 randomly. The last value for $foo can be anywhere from 400 to 1500. Even
 more strange is that running it through gdb indicates a successful exit,
 with no problems or core dumps. Anyone had any similar experiences? I'm
 running PHP 4.3.3 (cgi) -- the latest download version.
 
 Cheers,
 Rob.
 -- 
 ..
 | InterJinn Application Framework - http://www.interjinn.com |
 ::
 | An application and templating framework for PHP. Boasting  |
 | a powerful, scalable system for accessing system services  |
 | such as forms, properties, sessions, and caches. InterJinn |
 | also provides an extremely flexible architecture for   |
 | creating re-usable components quickly and easily.  |
 `'
---End Message---
---BeginMessage---
On Sat, 2003-09-20 at 00:59, Dan Anderson wrote:
 Why are you using php:// below?  If stdin is a file './stdin' will

Because it is the correct way to retrieve input from standard input.

http://www.php.net/wrappers.php

 suffice (or the path instead of ./).  If you want to run the PHP script
 in stdin you should use one of the following:
 include()
 include_once()
 require()
 require_once()
 See the manual at php.net for pertinent sections...

I don't want to run a script from stdin, I want to retrieve user input
from the keyboard. What the heck are you smoking?

  if( ($stdin = fopen( 'php://stdin', 'r' )) === false )
  { 
  echo 'Failed to open STDIN'.\n;
  exit();
  }  
 
 I seem to remember stream_set_blocking being either experimental or deprecated.
 If I remember correctly its for use with the function fsock_open().
  stream_set_blocking( $stdin, false );

No stream_set_blocking() is the correct function. The others are
deprecated because they are less generic for streams:

This function was previously called as 

[PHP] I have a problem :: help please?

2003-09-20 Thread Stevie D Peele


I'm making my own style sheet switcher. Here's my problem. My style
switcher will switch the style once or twice, sometimes only once, and
then It will not do It again until the cookie expires, can somebody spot
what I am doing wrong?

---form---action--
?php
$value = $_POST['colors'];
$blue = Royale Blue;
$teal = Teal;
$green = Hunter Green;
$maroon = Maroon;
$grey = Grey;

if ($value == $blue){
setcookie(blue,time()+3600);}

elseif ($value == $teal){
setcookie(teal,time()+3600);}

elseif ($value == $green){
setcookie(green,time()+3600);}

elseif ($value == $maroon){
setcookie(maroon,time()+3600);}

elseif ($value == $grey){
setcookie(grey,time()+3600);}

else
{
echo Nothing isset!;
}

?
centerbh3font face=verdana?php echo $value ? has been
set!/h3brh5a href=categories.php?cat=homeClick Here/a to
return back to the homepage!/h5
/b/font/center
-

and the cookie checker
-
?php
echo link rel=stylesheet href=style.css type=text/css;

if (isset($_COOKIE['blue'])){
echo link rel=stylesheet href=styleblue.css type=text/css;}

elseif (isset($_COOKIE['teal'])){
echo link rel=stylesheet href=styleteal.css type=text/css;}

elseif (isset($_COOKIE['green'])){
echo link rel=stylesheet href=stylegreen.css type=text/css;}

elseif (isset($_COOKIE['maroon'])){
echo link rel=stylesheet href=stylemaroon.css type=text/css;}

elseif (isset($_COOKIE['grey'])){
echo link rel=stylesheet href=stylegrey.css type=text/css;}
?
-

Thanks for everyones help..


Stevie

[PHP] Housing multiple classes under one class

2003-09-20 Thread Gerard Samuel
I got an application that uses Smarty, ADODB, and some other custom classes.
So I have about about 5 objects floating around,
and the Smarty object, and another class contains a reference copy of 
the ADODB object, and I just get that feeling that it can
be better.
By having one class where they all can share each others data.
Is it just a dream?
The only way I know how is by making object/objects like 
$foo-bar-do_something()
But that may lead to passing an object to a class, and Ill end up with 
multiple copies of an object
Any insight or examples would be appreciated.
Thanks

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


[PHP] Re: php.net

2003-09-20 Thread Shadow
None that I am aware of.went there just now.
Shadow

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



Re: [PHP] Whats wrong with my code?

2003-09-20 Thread Burhan Khalid
Stevie D Peele wrote:
Can someone spot what Is wrong with my code?
[ trim ]

It says Line 195 which is the ?

Would it matter I don't have all of these files (i.e.
/includes/world.html) were uploaded yet?
Yes it would matter.

You need to use an editor that supports syntax highlighting.

Whenever the error is on the last line, check the line before it.

Like others have suggested, narrow your post down to a test case, never 
send attachments.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] preg_replace question

2003-09-20 Thread Armand Turpel
Finaly I got the solution.

Replace all line breaks by br / but not after a html headline
(h1../h1)

$text = preg_replace(/(?!h[1-6]\)\r\n/,\\1br /,$text);



- Original Message - 
From: Armand Turpel [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 20, 2003 7:34 PM
Subject: Re: [PHP] preg_replace question


 Hi Jim ,
 The problem with your proposition is that the preg_replace do not replace
 /h1\r\n  to  /h1br /
 thats good,
 but also not this:
 testh4\r\n

 and thats not what I expect from.


 atur






 - Original Message - 
 From: Jim Lucas [EMAIL PROTECTED]
 To: Armand Turpel [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Saturday, September 20, 2003 5:37 PM
 Subject: Re: [PHP] preg_replace question


  $arr = array(/([^\][^\/][^h][^1-6].{1}[^\])\r\n/,
   /([^\][^\/][^h][^1-6].{1}[^\])\r/,
   /([^\][^\/][^h][^1-6].{1}[^\])\n/,
   );
 
  $text = preg_replace($arr,\\1br  /,$text);
 
  you might try this and see how well it works.
 
  Jim Lucas
 
 
  - Original Message - 
  From: Armand Turpel [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, September 20, 2003 8:21 AM
  Subject: [PHP] preg_replace question
 
 
   I need the following replace function:
   Replace all line breaks to br but not if a line break comes after an
  /h1
   or /h2 or   /hx
  
  
   Currently I use this preg_replace but it's not good enough for all
   situations.
  
   $text = preg_replace(/([^\][^\/][^h][^1-9].{1})\r\n/,\\1br
  /,$text);
  
  
   
  
   Thanks
  
   -- 
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
 

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





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



Re: [PHP] session_start() || shell access problem......

2003-09-20 Thread Robert Cummings
On Sat, 2003-09-20 at 15:46, CF High wrote:
 Hey all.
 
 I'm running a script from the command-line php interpreter as follows:
 (thanks to D. Souza for lead)
 
 $text = `usr/local/bin/php /path/to/my/php/page.php`;
 
 within the read file I want to enable sessions, so I session_start() at the
 top of the page:
 
 ?
 session_start();
 ?
 ?
 code to execute here...
 ?
 
 Regardless of how I mess around with placement of session_start(), I get a
 Headers already sent.
 
 Why? Nothing has been output to the browser within the read file!
 Furthermore, if I create a test page with just:
 
 ?$text = `usr/local/bin/php /path/to/my/php/page.php`;?
 
 Still receive Headers already sent.
 
 My eyes are completely fried -- anyone feel like saving my vision?

This often is difficult to detect when there's is implicit output
outside of the ? tag. Check the top of the included file or start php
script and see if there is any whitespace or newlines preceding the tag.

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

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



Re: [PHP] session_start() || shell access problem......

2003-09-20 Thread CF High
Hey Robert.

Indeed, hard to find the problem.

I don't believe it's a whitespace issue, or even a Headers sent issue,
despite the fact that I'm receiving that error.

Check it out:

test.php contains just one line: ?$text = `usr/local/bin/php
/path/to/my/php/test1.php`;?

test1.php, the file to be executed, contains just one line:
?session_start();?

There are no line breaks, spaces, etc.

Still get Headers already sent.

Pretty strange, right?

Correct me if I'm wrong, but I think the problem may be related to the fact
that when files are executed from the command line, php now looks for
include_paths, session_paths, etc. relative to the server root; not the site
root.

I can think of no other reason why include paths, starting sessions, and so
on, return errors from the command line but ork perfectly fine when run in a
browser.

Feel free to clue me in -- I know didly about shell access issues.

--Noah


Robert Cummings [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Sat, 2003-09-20 at 15:46, CF High wrote:
  Hey all.
 
  I'm running a script from the command-line php interpreter as follows:
  (thanks to D. Souza for lead)
 
  $text = `usr/local/bin/php /path/to/my/php/page.php`;
 
  within the read file I want to enable sessions, so I session_start() at
the
  top of the page:
 
  ?
  session_start();
  ?
  ?
  code to execute here...
  ?
 
  Regardless of how I mess around with placement of session_start(), I get
a
  Headers already sent.
 
  Why? Nothing has been output to the browser within the read file!
  Furthermore, if I create a test page with just:
 
  ?$text = `usr/local/bin/php /path/to/my/php/page.php`;?
 
  Still receive Headers already sent.
 
  My eyes are completely fried -- anyone feel like saving my vision?

 This often is difficult to detect when there's is implicit output
 outside of the ? tag. Check the top of the included file or start php
 script and see if there is any whitespace or newlines preceding the tag.

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

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



Re: [PHP] Whats wrong with my code?

2003-09-20 Thread Jason Sheets
Sounds like you might have an open { somewhere, PHP can't tell that you 
have a problem until it reaches the end of the file.

Jason

Burhan Khalid wrote:

Stevie D Peele wrote:

Can someone spot what Is wrong with my code?


[ trim ]

It says Line 195 which is the ?

Would it matter I don't have all of these files (i.e.
/includes/world.html) were uploaded yet?


Yes it would matter.

You need to use an editor that supports syntax highlighting.

Whenever the error is on the last line, check the line before it.

Like others have suggested, narrow your post down to a test case, 
never send attachments.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Trying to View php.ini

2003-09-20 Thread Stephen Tiano
I'm on a Mac PowerBook. I'm able to locate the php.ini file. But when I 
open it with BBEdit, it's a blank page. I just want to open it and 
either view it, or make a copy to view. But all I have is the blank. Any 
suggestions?

Thank you.

Steve Tiano

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


Re: [PHP] Trying to View php.ini

2003-09-20 Thread Jason Wong
On Sunday 21 September 2003 06:19, Stephen Tiano wrote:
 I'm on a Mac PowerBook. I'm able to locate the php.ini file. But when I
 open it with BBEdit, it's a blank page. I just want to open it and
 either view it, or make a copy to view. But all I have is the blank. Any
 suggestions?

Search archives for  mac php.ini

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Zymurgy's Law of Volunteer Labor:
People are always available for work in the past tense.
*/

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



[PHP] Problem's addign a script to my web page.

2003-09-20 Thread stratis Aftousmis
Hello, i will be a succinct as possible. I downloaded a php script (a 
chatbox) for my web page. The web page is from my ISP, 15Mb space, you have 
to have knowledge of UNIX and Html to use the service(to create the page 
and upload to the site). I wrote the page in Html, downloaded the php 
script, intalled and changed the file extention from html to php. The site 
from which i got the php chatbox script say's i have to 'chmod' the 
directory where the file's are to be created to 777...the script create the 
file's if they don't exist with 'touch':

snip
if(!is_writable($latest) || !is_writable($archive)) {
  touch($latest);
  touch($archive)
if (!is_writable($latest) || !is_writable($archive)) {
exit($latest or $archive is not writable, please check your permission's 
and try again);
}
/snip

One problem i have is the 'chmod'command is not implemented on this site 
(SunOS 5.8):

snip
lftp [EMAIL PROTECTED]:~/public_html/ext chmod 777 archives
chmod: Access failed: 502 SITE command not implemented. (archives)
lftp [EMAIL PROTECTED]:~/public_html/ext
/snip

i then tryed to do using the php 'chmod' function to 777 on the directory in 
question, no go. (hey...don't laugh)

When i try to use the chatbox in question, i get the error's:

snip
Warning: utime failed: Permission denied in
/export/home/stratus/public_html/ext/minichat2.inc.php on line 102

Warning: utime failed: Permission denied in
/export/home/stratus/public_html/ext/minichat2.inc.php on line 103
/export/home/stratus/public_html/ext/archive/minichat2.latest or
/export/home/stratus/public_html/ext/archive/minichat2.archive is not
writable. Please check your permissions and try again.
/snip

those line's are both the touch command's, the file's are not being created, 
it won't even work if i create them myself.
I *hope* that's enough info for a diagnosis. Any help would be welcome.

stratis.

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



[PHP] PHP Smart Refresh for looping server lookups

2003-09-20 Thread NukedWeb
This may sound a bit long and drawn out, but I'll try my best to summarize 
what I'm having trouble with. Roughly 2 weeks ago I began writing scripts to run 
a free TagBoard service. (Examples: Tag-Board.com and [mine] MyTagBoard.com) 
- my 2-week-long goal was to compile a list of features (based on 3 or 4 
tagboard sites) and add those to this set of scripts.

I was successful in pretty much all the features and more, except for one: 
Smart Refresh. The tagboards currently refresh at a rate of xx seconds, set by 
the tagboard owner. Other sites have managed to design the tagboard to 
refresh ONLY when a new tag exists on the server, simulating a live chat. My 
question is, how is this Smart Refresh done? How does a page that's loaded, just 
sit there and still be able to take a peek at the server without just 
refreshing the whole page? It's mind-boggling, even for me. :-D

I'm not looking for actual code; that part I can do; I'm just looking for a 
basic what does what procedure on how it's done. Any thoughts on this would 
be very greatful! Thanks in advance =)

 ~ Tim


Re: [PHP] PHP Smart Refresh for looping server lookups

2003-09-20 Thread Jim Lucas
in the past people have talked about doing this in a few different ways.

1.  Have an image that javascript refreshes the url on and when doing so
calls
to a php script that checks to see if anything is newer then the last
time
that it checked. And if something has ben updated then have the php
script
pass back an image that is a different size (height or width) then what
the
image was be for.  Then if the size of the image return is something
other
then what you expect, then you can assume that it the data has been
changed
and you need to refresh the entire page.

2.  You could use a hidden IFRAME to do the checking.

3.  You could write an app in Flash the opens a port to the server and does
all
the same checking the option #1 would be doing.

4.  not sure, but I'm sure that others will have different options.

Jim Lucas

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 20, 2003 4:40 PM
Subject: [PHP] PHP Smart Refresh for looping server lookups


 This may sound a bit long and drawn out, but I'll try my best to summarize
 what I'm having trouble with. Roughly 2 weeks ago I began writing scripts
to run
 a free TagBoard service. (Examples: Tag-Board.com and [mine]
MyTagBoard.com)
 - my 2-week-long goal was to compile a list of features (based on 3 or 4
 tagboard sites) and add those to this set of scripts.

 I was successful in pretty much all the features and more, except for one:
 Smart Refresh. The tagboards currently refresh at a rate of xx seconds,
set by
 the tagboard owner. Other sites have managed to design the tagboard to
 refresh ONLY when a new tag exists on the server, simulating a live
chat. My
 question is, how is this Smart Refresh done? How does a page that's
loaded, just
 sit there and still be able to take a peek at the server without just
 refreshing the whole page? It's mind-boggling, even for me. :-D

 I'm not looking for actual code; that part I can do; I'm just looking for
a
 basic what does what procedure on how it's done. Any thoughts on this
would
 be very greatful! Thanks in advance =)

  ~ Tim


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



[PHP] processing post requests

2003-09-20 Thread Vadim Bendebury
The web page has a form with a following element in it:

select multiple size=4 name=city
  option selected value=0no preference/option
  option value=2Paris/option
  option value=1London/option
  option value=3Madrid/option
/select
The intention is to be able to pick multiple cities. However, when the 
request arrives on the server, the $_POST array includes just the one 
last pick, no matter how many options are highligted when the submit 
button is hit.

What's the deal - is the an HTML code problem or PHP problem? Is it at 
all possible to have multiple choices derived from this kind of form 
element?

Thanks in advance!

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


Re: [PHP] processing post requests

2003-09-20 Thread Jason Wong
On Sunday 21 September 2003 08:28, Vadim Bendebury wrote:
 The web page has a form with a following element in it:

 select multiple size=4 name=city
option selected value=0no preference/option
option value=2Paris/option
option value=1London/option
option value=3Madrid/option
 /select

 The intention is to be able to pick multiple cities. However, when the
 request arrives on the server, the $_POST array includes just the one
 last pick, no matter how many options are highligted when the submit
 button is hit.

 What's the deal - is the an HTML code problem or PHP problem? Is it at
 all possible to have multiple choices derived from this kind of form
 element?

manual  PHP and HTML

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If both the monitor and the planter are going to breakdown, they will do so 
simultaneously. 
-- Deere's Dictums n3
*/

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



Re: [PHP] processing post requests

2003-09-20 Thread Vadim Bendebury
Jason Wong wrote:
 
 
 
 manual  PHP and HTML
 

do you feel good being a moron?

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



Re: [PHP] processing post requests

2003-09-20 Thread Vadim Bendebury
Vadim Bendebury wrote:
 Jason Wong wrote:
 


manual  PHP and HTML

 
 
 do you feel good being a moron?

Sorry, I did not mean to post this on the group, it was meant to be a
private email.

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



Re: [PHP] processing post requests

2003-09-20 Thread Jason Wong
On Sunday 21 September 2003 08:47, Vadim Bendebury wrote:

  manual  PHP and HTML

 do you feel good being a moron?

Is that how you feel about people who help you? 

Did you read that chapter of the manual indicated above? 

Did it not answer your question?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
My friend has a baby.  I'm writing down all the noises he makes so
later I can ask him what he meant.
-- Steven Wright
*/

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



Re: [PHP] Trying to View php.ini

2003-09-20 Thread andu
On Sat, 20 Sep 2003 18:19:25 -0400
Stephen Tiano [EMAIL PROTECTED] wrote:

 I'm on a Mac PowerBook. I'm able to locate the php.ini file. But when I 
 open it with BBEdit, it's a blank page. I just want to open it and 
 either view it, or make a copy to view. But all I have is the blank. Any 
 suggestions?

Put a file phpinfo.php with 
?php
phpinfo();
?
in your server's root and call it with the browser, it will tell you where the
php.ini is, don't think it can be empty. 

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



Regards, Andu Novac

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



Re: [PHP] processing post requests

2003-09-20 Thread Vadim Bendebury
Sory, Jason, what particular manual you are talking about? Does it have
a chapter titled PHP and HTNL?

The manuals I have do not answer my question and do not have such a
chapter. If there is an online manual you are referring to, the URL
would be most useful in this situation.

thank you for your willingness to help anyway.


Jason Wong wrote:
 On Sunday 21 September 2003 08:47, Vadim Bendebury wrote:
 
 
manual  PHP and HTML

do you feel good being a moron?
 
 
 Is that how you feel about people who help you? 
 
 Did you read that chapter of the manual indicated above? 
 
 Did it not answer your question?
 

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



Re: [PHP] processing post requests

2003-09-20 Thread Jason Wong
On Sunday 21 September 2003 09:01, Vadim Bendebury wrote:
 Sory, Jason, what particular manual you are talking about? Does it have
 a chapter titled PHP and HTNL?

The php manual?

 The manuals I have do not answer my question and do not have such a
 chapter. If there is an online manual you are referring to, the URL
 would be most useful in this situation.

The php website?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Complex system:
One with real problems and imaginary profits.
*/

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



Re: [PHP] processing post requests

2003-09-20 Thread John Nichel
So he tells you where to find the answer, and he's a moron?  Do you
expect him (us) to hold your hand, and write code for you?

Vadim Bendebury wrote:

 Jason Wong wrote:
 


manual  PHP and HTML

 
 
 do you feel good being a moron?
 

-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com

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



Re: [PHP] processing post requests

2003-09-20 Thread John Nichel
Jason Wong wrote:

 On Sunday 21 September 2003 09:01, Vadim Bendebury wrote:
 
Sory, Jason, what particular manual you are talking about? Does it have
a chapter titled PHP and HTNL?
 
 
 The php manual?
 
 
The manuals I have do not answer my question and do not have such a
chapter. If there is an online manual you are referring to, the URL
would be most useful in this situation.
 
 
 The php website?


And pay close attention to naming conventions of multiple select form
elements, such as checkboxes, and multi-select boxes.

-- 
By-Tor.com
It's all about the Rush
http://www.by-tor.com

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



Re: [PHP] processing post requests

2003-09-20 Thread andu
On Sat, 20 Sep 2003 17:28:45 -0700
Vadim Bendebury [EMAIL PROTECTED] wrote:

 The web page has a form with a following element in it:
 
 select multiple size=4 name=city
option selected value=0no preference/option
option value=2Paris/option
option value=1London/option
option value=3Madrid/option
 /select

 select multiple size=4 name=city[]
   option selected value=0no preference/option
   option value=2Paris/option
option value=1London/option
option value=3Madrid/option
 /select

 
 The intention is to be able to pick multiple cities. However, when the 
 request arrives on the server, the $_POST array includes just the one 
 last pick, no matter how many options are highligted when the submit 
 button is hit.
 
 What's the deal - is the an HTML code problem or PHP problem? Is it at 
 all possible to have multiple choices derived from this kind of form 
 element?
 
 Thanks in advance!
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 



Regards, Andu Novac

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



[PHP] Re: PHP Smart Refresh for looping server lookups

2003-09-20 Thread J. Cox

[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

 I'm not looking for actual code; that part I can do; I'm just looking for
a
 basic what does what procedure on how it's done. Any thoughts on this
would
 be very greatful! Thanks in advance =)

Why not do a meta refresh with the time as a variable to be configured?
Seems to me to be the easiest way to do it.

J. Cox
http://www.xaraya.com

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



[PHP] Mail looping

2003-09-20 Thread Ryan A
Hi,
I am trying to make a tell a friend script, i am getting the emails from a
textarea and am asking for this format [EMAIL PROTECTED],[EMAIL PROTECTED] etc in case 
the
client forgets to put a comma or purposely then how do i check it?
If anybody has any code samples or has already done that,I would appreciate
some help.
Thanks in advance.

Cheers,
-Ryan


We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

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



[PHP] File Upload Issues

2003-09-20 Thread Shad Kaske
I was hoping to get a bit of help with a strange file upload issue that I am having. Below is a simple form that I am using as an example. The output from the $_FILES array follows that. The thing that I am unable to resolve is the fact that the file upload returns the name of the file the user is uploading, but will not give me the tmp_name or the type. I am having this problem with this form and another as part of an application I am working on, however, I have another form with 2 file upload fields that works normally.

HTML FORM:
form enctype=multipart/form-data action=test.php method=POST>
input type=hidden name=MAX_FILE_SIZE value=2048>
Send this file: input name=userfile type=file size=25>
input type=submit value=Send File name=submit>
/form> 

PHP CODE  OUTPUT:
code:
echo Temp Name:  . $_FILES['userfile']['tmp_name'] . br>;
echo File Name:  . $_FILES['userfile']['name'] . br>;
echo File Type:  . $_FILES['userfile']['type'] . br>;

output:
Temp Name: 
File Name: news.pdf 
File Type: 


Shad Kaske

PGP.sig
Description: PGP signature


Re: [PHP] File Upload Issues

2003-09-20 Thread Tom Rogers
Hi,

Sunday, September 21, 2003, 1:10:29 PM, you wrote:
SK I was hoping to get a bit of help with a strange file upload issue that 
SK I am having. Below is a simple form that I am using as an example. The 
SK output from the $_FILES array follows that. The thing that I am unable 
SK to resolve is the fact that the file upload returns the name of the 
SK file the user is uploading, but will not give me the tmp_name or the 
SK type. I am having this problem with this form and another as part of an 
SK application I am working on, however, I have another form with 2 file 
SK upload fields that works normally.

SK HTML FORM:
SK form enctype=multipart/form-data action=test.php method=POST
SK input type=hidden name=MAX_FILE_SIZE value=2048
SK Send this file: input name=userfile type=file size=25
SK input type=submit value=Send File name=submit
SK /form

SK PHP CODE  OUTPUT:
SK code:
SK echo Temp Name:  . $_FILES['userfile']['tmp_name'] . br;
SK echo File Name:  . $_FILES['userfile']['name'] . br;
SK echo File Type:  . $_FILES['userfile']['type'] . br;

SK output:
SK Temp Name:
SK File Name: news.pdf
SK File Type:


SK Shad Kaske

what do you get in $_FILES['userfile']['error']
It might give you a clue

-- 
regards,
Tom

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



[PHP] php|cruise

2003-09-20 Thread John W. Holmes
Is anyone planning on going to this?

http://www.phparch.com/cruise/

I'm trying to go. It would be nice to put a face to the name with a few 
people out there. Let me know.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


[PHP] How to get the Web Address of the Script

2003-09-20 Thread Dan Anderson
I am creating a script and there is an autoconfig file.  I want to read
in the web address of the server, and throw some correct URLs into the
database.

Will using $_SERVER['HTTP_HOST'] guarantee getting me the domain name of
the server on which the web page I am viewing is hosted?  

I am somewhat worried about using such variables because I seem to
remember it being possible to disable them in PHP.ini, but I would love
to get some feedback.

-Dan

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



Re: [PHP] php|cruise

2003-09-20 Thread John Nichel
John W. Holmes wrote:
Is anyone planning on going to this?

http://www.phparch.com/cruise/

I'm trying to go. It would be nice to put a face to the name with a few 
people out there. Let me know.

All depends on money.  Being out of work, in the hot bed of technology 
that South Louisiana is, I can't say for sure.  The wife has been 
bugging me to bring her on a cruise for years now (being ex-Navy, I've 
logged enough time out to sea :)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: Limit keyword not supported in MS-SQL

2003-09-20 Thread YC Nyon
I can connect to MS-SQL via php. However, the LIMIT keyword is not
supported. Looking
at the archieves, SELECT TOP X was recommended. Works ok, however i need to
specify a start row, ie. Page 1, Page 2.

Any ideas?

Nyon



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/2003

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



Re: [PHP] How to get the Web Address of the Script

2003-09-20 Thread Curt Zirzow
* Thus wrote Dan Anderson ([EMAIL PROTECTED]):
 I am creating a script and there is an autoconfig file.  I want to read
 in the web address of the server, and throw some correct URLs into the
 database.
 
 Will using $_SERVER['HTTP_HOST'] guarantee getting me the domain name of
 the server on which the web page I am viewing is hosted?  
 
 I am somewhat worried about using such variables because I seem to
 remember it being possible to disable them in PHP.ini, but I would love
 to get some feedback.

It rather depends on the webserver but in most cases it will be
there.  On apache the way it works is when you access the url
  http://yourhost.com/

The most browsers will send something like:
  GET / HTTP/1.1
  host: yourhost.com


The host: header is what HTTP_HOST is.  If you can access the site
by the IP, I'm not exactly sure what will happen in that case,
cause the browser may not send that host: value.


With all that said, if you have the HTTP_HOST value, it will most
likely be there. php has no control over that var, its set by the
webserver.

HTH

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



php-general Digest 21 Sep 2003 05:35:23 -0000 Issue 2309

2003-09-20 Thread php-general-digest-help

php-general Digest 21 Sep 2003 05:35:23 - Issue 2309

Topics (messages 163299 through 163331):

I have a problem :: help please?
163299 by: Stevie D Peele

Housing multiple classes under one class
163300 by: Gerard Samuel

Re: php.net
163301 by: Shadow

Re: Whats wrong with my code?
163302 by: Burhan Khalid
163306 by: Jason Sheets

Re: preg_replace question
163303 by: Armand Turpel

Re: session_start() || shell access problem..
163304 by: Robert Cummings
163305 by: CF High

Trying to View php.ini
163307 by: Stephen Tiano
163308 by: Jason Wong
163317 by: andu

Problem's addign a script to my web page.
163309 by: stratis Aftousmis

PHP Smart Refresh for looping server lookups
163310 by: NukedWeb.aol.com
163311 by: Jim Lucas
163323 by: J. Cox

processing post requests
163312 by: Vadim Bendebury
163313 by: Jason Wong
163314 by: Vadim Bendebury
163315 by: Vadim Bendebury
163316 by: Jason Wong
163318 by: Vadim Bendebury
163319 by: Jason Wong
163320 by: John Nichel
163321 by: John Nichel
163322 by: andu

Mail looping
163324 by: Ryan A

File Upload Issues
163325 by: Shad Kaske
163326 by: Tom Rogers

php|cruise
163327 by: John W. Holmes
163329 by: John Nichel

How to get the Web Address of the Script
163328 by: Dan Anderson
163331 by: Curt Zirzow

Re: Limit keyword not supported in MS-SQL
163330 by: YC Nyon

Administrivia:

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

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

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


--
---BeginMessage---


I'm making my own style sheet switcher. Here's my problem. My style
switcher will switch the style once or twice, sometimes only once, and
then It will not do It again until the cookie expires, can somebody spot
what I am doing wrong?

---form---action--
?php
$value = $_POST['colors'];
$blue = Royale Blue;
$teal = Teal;
$green = Hunter Green;
$maroon = Maroon;
$grey = Grey;

if ($value == $blue){
setcookie(blue,time()+3600);}

elseif ($value == $teal){
setcookie(teal,time()+3600);}

elseif ($value == $green){
setcookie(green,time()+3600);}

elseif ($value == $maroon){
setcookie(maroon,time()+3600);}

elseif ($value == $grey){
setcookie(grey,time()+3600);}

else
{
echo Nothing isset!;
}

?
centerbh3font face=verdana?php echo $value ? has been
set!/h3brh5a href=categories.php?cat=homeClick Here/a to
return back to the homepage!/h5
/b/font/center
-

and the cookie checker
-
?php
echo link rel=stylesheet href=style.css type=text/css;

if (isset($_COOKIE['blue'])){
echo link rel=stylesheet href=styleblue.css type=text/css;}

elseif (isset($_COOKIE['teal'])){
echo link rel=stylesheet href=styleteal.css type=text/css;}

elseif (isset($_COOKIE['green'])){
echo link rel=stylesheet href=stylegreen.css type=text/css;}

elseif (isset($_COOKIE['maroon'])){
echo link rel=stylesheet href=stylemaroon.css type=text/css;}

elseif (isset($_COOKIE['grey'])){
echo link rel=stylesheet href=stylegrey.css type=text/css;}
?
-

Thanks for everyones help..


Stevie---End Message---
---BeginMessage---
I got an application that uses Smarty, ADODB, and some other custom classes.
So I have about about 5 objects floating around,
and the Smarty object, and another class contains a reference copy of 
the ADODB object, and I just get that feeling that it can
be better.
By having one class where they all can share each others data.
Is it just a dream?
The only way I know how is by making object/objects like 
$foo-bar-do_something()
But that may lead to passing an object to a class, and Ill end up with 
multiple copies of an object
Any insight or examples would be appreciated.
Thanks
---End Message---
---BeginMessage---
None that I am aware of.went there just now.
Shadow
---End Message---
---BeginMessage---
Stevie D Peele wrote:
Can someone spot what Is wrong with my code?
[ trim ]

It says Line 195 which is the ?

Would it matter I don't have all of these files (i.e.
/includes/world.html) were uploaded yet?
Yes it would matter.

You need to use an editor that supports syntax highlighting.

Whenever the error is on the last line, check the line before it.

Like others have suggested, narrow your post down to a test case, never 
send attachments.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
---End Message---
---BeginMessage---
Sounds like you might have an open { somewhere, PHP can't tell that you 
have a problem until it reaches the end of the file.

Jason

Burhan Khalid wrote:


Re: [PHP] How to get the Web Address of the Script

2003-09-20 Thread NukedWeb
In a message dated 9/21/2003 1:35:43 AM Eastern Standard Time, 
[EMAIL PROTECTED] writes:


 The host: header is what HTTP_HOST is.  If you can access the site
 by the IP, I'm not exactly sure what will happen in that case,
 cause the browser may not send that host: value.
 

If it's accessed by IP, the Host: header is omitted, and $HTTP_HOST returns 
the IP address. To build the full URL to that particular script, you would 
have to piece it together, using protocol + :// + $http_host + / + 
$REQUEST_URIetc etc, not sure the exact code, but thats what ya gotta do...