Re: [PHP] Generating forms using OOP

2002-12-06 Thread Davy Obdam
Hi Peter,

Thanks for your help, but in this case i ve to build everythng up from 
the ground. Next time i`ll definatly take a look at smarty. It works now..

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Peter J. Schoenster wrote:

On 7 Dec 2002 at 0:43, Davy Obdam wrote:

 

I ve just started with some OOP programming in PHP and now i have to
build a set of classes that can generate a html form.. But i have a
problem with the  thing I hope
someone can help me here or give me some pointers,... any help is
apreciated. Here is a part of my code :

class selectField extends formElement {

   //Constructor
   function selectField($name, $value) {
   formElement::setName($name);
   formElement::setValue($value);
   }

   function generateSelectField() {
   $theOutput = "name."\">\n";
   foreach($this->value as $key=>$val) {
   $theOutput .= "value."\">".$this->value."\n";
   }
   $theOutput .= "\n";
   Return $theOutput;
   }
}

This is how i call the Object:

$test[] = "Test1";
$test[] = "Test2";
$test[] = "Test3";
$test[] = "Test4";
$test[] = "Test5";
$select = new selectField("testje", $test);
echo$select->generateSelectField();

But all i get is a select box with the word Array in it 5 times...Thanks
for your time...
   


Below is an example that works. I don't know from formElement. But why, 
why in the world do you REALLY want to do this? Have you truly used and 
understood smarty and yet felt this must be done? I haven't. 

http://smarty.php.net/

It lets you focus on your application.

Peter




// require_once 'selectField.php';

$test[] = "Yea, this works";
$test[] = "No trouble mate";
$test[] = "Test3";
$test[] = "Test4";
$test[] = "Test5";

$select = new selectField("testje", $test);
echo $select->generateSelectField();


class selectField {

   var $name;
   var $value;
   
   function selectField($name, $value) {
   $this->name = $name;
   $this->value = $value;
   }

   function generateSelectField() {
   $theOutput = "name."\">\n";
   foreach($this->value as $key=>$val) {
   $theOutput .= "".$val."\n";
   }
   $theOutput .= "\n";
   return $theOutput;
   }
}


?>


 




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




Re: [PHP] Generating forms using OOP

2002-12-06 Thread Davy Obdam
Hi Tom,

Thanks it now works, ..

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]

Tom Rogers wrote:


Hi,

Saturday, December 7, 2002, 9:43:47 AM, you wrote:
DO> Hi People,

DO> I ve just started with some OOP programming in PHP and now i have to 
DO> build a set of classes that can generate a html form.. But i have a 
DO> problem with the  thing
DO> I hope someone can help me here or give me some pointers,... any help is 
DO> apreciated. Here is a part of my code :

DO> class selectField extends formElement {
  
DO> //Constructor
DO> function selectField($name, $value) {
DO> formElement::setName($name);
DO> formElement::setValue($value);
DO> }

DO> function generateSelectField() {
DO> $theOutput = "name."\">\n";
DO> foreach($this->value as $key=>$val) {
DO> $theOutput .= ">value."\">".$this->value."\n";
DO> }
DO> $theOutput .= "\n";
DO> Return $theOutput;
DO> }
DO> }

DO> This is how i call the Object:

DO> $test[] = "Test1";
DO> $test[] = "Test2";
DO> $test[] = "Test3";
DO> $test[] = "Test4";
DO> $test[] = "Test5";
DO> $select = new selectField("testje", $test);
echo$select->>generateSelectField();

DO> But all i get is a select box with the word Array in it 5 times...Thanks 
DO> for your time...

DO> Best regards,

DO> Davy Obdam
DO> mailto:[EMAIL PROTECTED]

The output function is wrong it should be

function generateSelectField() {
   $theOutput = "name."\">\n";
   foreach($this->value as $key=>$val) {
   $theOutput .= "".$val."\n"; //this line
   }
   $theOutput .= "\n";
   Return $theOutput;
   }

 




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




Re: [PHP] mail() problems...

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 12:16, Anthony Ritter wrote:
> To all who assisted me today.
>
> I finally managed to get the mail () funtion to work.

Would you mind disclosing what you did to make it work? Those searching the 
archives in generations to come would appreciate what the conclusion was.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Reply hazy, ask again later.
*/


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




Re: [PHP] Date again

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 11:39, Miguel Brás wrote:
> Ok guys,
>
> having a problem here. I did my table with 6 fields, they are:
> id  position  name  timein  timeout  date
>
> I have a form to insert the info on the fields, and at the date field, I
> have a drop down menu that returns me the next 7 days (the date in d/m/y),
> people will choose the date they want and that will be stored on the table.
>
> Now I want to retrieve the position, name, timein and timeout from by table
> and display it on a page. But I want only the records for the present date.
> I inserted the info on my table and on the date's field I inserted 07/12/02
> and 06/12/02 just for testing
>
> I called the data via a query: SELECT position, name, timein, timeout, date
> FROM table WHERE date=NOW()
> It was supposed that only the record from the present date was shown. But
> not, I can't have anything. Only the custom message I did if nothing was
> available

NOW() returns the current date and TIME. Use CURRENT_DATE or CUR_DATE() to get 
just the date portion.

> One more thing, how can I do to prevent that different people apply for a
> same position, on the same day and during the "shift" of the first one that
> applied?

Check the archives, there was a thread in the last couple of days about 
"Checking for Overlapping Dates". The same principles should apply so it may 
be useful reading.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Abstainer, n.:
A weak person who yields to the temptation of denying himself a
pleasure.
-- Ambrose Bierce, "The Devil's Dictionary"
*/


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




Re: [PHP] Allowed memory size exhausted

2002-12-06 Thread @ Edwin
Hello,

"Jeff Schwartz" <[EMAIL PROTECTED]> wrote:

>
> I have a large amount of data (1,948,280 bytes) that I tried to write out
to a file using
>
> if ($fp = fopen($file,"w")):
>
> fwrite($fp,$contents,strlen($contents));
>
> fclose($fp);
>
> endif;

I'm not sure if I understand this correctly but don't you think you don't
need strlen($contents) up there? Also, try fopen($file,"wb").

And here,

> and got "Fatal error: Allowed memory size of 8388608 bytes exhausted
(tried to allocate 1948281 bytes)" on the 2nd line. So, I tried to write out
smaller portions with:
>
> if ($fp = fopen($file,"w")):
>
> $size = 4096;
>
> while (strlen($contents)){
>
> $temp = substr($contents,0,$size);
>
> fwrite($fp,$temp,$size);
>
> $contents = substr($contents,$size+1);
>
> }
>
> fclose($fp);
>
> endif;

...doing "$contents = substr($contents,$size+1);" would actually cause you
to lose some data.

Try this instead:

  if ($fp = fopen($file,"wb")): // add "b"
$size = 4096;
 while (strlen($contents)){
   $temp = substr($contents,0,$size);
   fwrite($fp,$temp); // remove $size
   $contents = substr($contents,$size);  // remove "+1"
 }
 fclose($fp);
  endif;

I didn't test so I'm not sure if it'll work--just some ideas...

HTH,

- E

...[snip]...


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




Re: [PHP] Humour me

2002-12-06 Thread Jerry M . Howell II
if you ran locate php.ini you would find it's in /etc/php.ini :)
hey it sure beats RTFM, lol

On Fri, 06 Dec 2002 23:39:59 -0500
John Taylor-Johnston <[EMAIL PROTECTED]> wrote:

> Humour me. New server. I'm a little tired.
> Where is my php.ini on a red hat server?
> John
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


-- 
Jerry M. Howell II

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




Re: [PHP] Re: XSLT failing when DOCTYPE declaration present

2002-12-06 Thread Chris Wesley
no, that's not it.  everything was configured properly.  everything
conformed, except the xslt processor.  the correct people were contacted
many many weeks ago now.

again, thanks for your time ...
~Chris

On Fri, 6 Dec 2002, Dave wrote:

> oops,
>
> file permission problem, if it isn't set to right permissions, it won't read
> and
> act as if there wasn't one, which then makes it work. so it does look like
> your doc
> doesn't conform.
>
> "Chris Wesley" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > On Wed, 4 Dec 2002, Dave wrote:
> >
> > Whoah ... was this reply sent several weeks ago when I sent the original
> > message and I'm just getting it now, or was it sent just recently?
> >
> > > without seeing the specifics, and assuming that PHP is never wrong (in
> the 4
> > > years i've used it, it hasn't been!)... your xml doc doesn't conform to
> > > the DTD. if you think this isn't the case, well, double check. if you
> >
> > Re-read my original message, and it's painfully obvious that I did
> > check, and that the XML did in fact conform to the DTD I used.
> > (The XSLT was fine when the DTD was referenced locally, rather than
> > remotely.)
> >
> > > still feel it is an error, you may want to email a bug issue to the
> > > sablotron people (i'm assuming that's what you're using).
> >
> > Yes, I used the Sablotron extension to PHP 4.2.2.  Thanks for the
> > insightful advice 
> >
> > ~Chris
> >
> > > "Chris Wesley" <[EMAIL PROTECTED]> wrote in message
> > >
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > I'm using the xslt capabilities in PHP 4.2.2 and running into an odd
> > > > problem.  I'm transforming an XML document which has a DOCTYPE
> > > > declaration referencing an external DTD.
> > > >
> > > > http://my.host.org/foo.dtd";>
> > > >
> > > > When I have xslt_process() attempt to transform the XML document, with
> an
> > > > XSL document I provide, it fails.  These are the errors I get back
> from
> > > > xslt_error() & xslt_errno.
> > > >   error: XML parser error 4: not well-formed (invalid token).
> > > >   errno: 2
> > > >
> > > > If I remove the DOCTYPE declaration from the XML, xslt_process() has
> no
> > > > problem transforming the XML.
> > > >
> > > > If I change the DOCTYPE declaration to:
> > > > 
> > > > then xslt_process() has no problem transfoming the XML.
> > > >
> > > > However, I need to make this work with the external DTD reference
> being to
> > > > some other host (http://other.my.host.org/foo.dtd).
> > > > Has anyone gotten this to work properly, have any insight into the
> error
> > > > information above, or know what I might have to do differently?
> >
> >
>
>
>
> --
> 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] Generating forms using OOP

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 9:43:47 AM, you wrote:
DO> Hi People,

DO> I ve just started with some OOP programming in PHP and now i have to 
DO> build a set of classes that can generate a html form.. But i have a 
DO> problem with the  thing
DO> I hope someone can help me here or give me some pointers,... any help is 
DO> apreciated. Here is a part of my code :

DO> class selectField extends formElement {
   
DO> //Constructor
DO> function selectField($name, $value) {
DO> formElement::setName($name);
DO> formElement::setValue($value);
DO> }

DO> function generateSelectField() {
DO> $theOutput = "name."\">\n";
DO> foreach($this->value as $key=>$val) {
DO> $theOutput .= ">value."\">".$this->value."\n";
DO> }
DO> $theOutput .= "\n";
DO> Return $theOutput;
DO> }
DO> }

DO> This is how i call the Object:

DO> $test[] = "Test1";
DO> $test[] = "Test2";
DO> $test[] = "Test3";
DO> $test[] = "Test4";
DO> $test[] = "Test5";
DO> $select = new selectField("testje", $test);
echo$select->>generateSelectField();

DO> But all i get is a select box with the word Array in it 5 times...Thanks 
DO> for your time...

DO> Best regards,

DO> Davy Obdam
DO> mailto:[EMAIL PROTECTED]

The output function is wrong it should be

function generateSelectField() {
$theOutput = "name."\">\n";
foreach($this->value as $key=>$val) {
$theOutput .= "".$val."\n"; //this line
}
$theOutput .= "\n";
Return $theOutput;
}

-- 
regards,
Tom


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




Re: [PHP] Confused about $_SESSION and $_COOKIE scope..

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 6:01:19 AM, you wrote:
CD> I'm not sure why this isn't working, been banging my head at it for a couple
CD> hours now.

CD> I have a file (index.php), which calls a function that draws the header to
CD> my page.

CD> Inside that function (site_header), is an include to a file (menu.php) which
CD> draws dynamic javascript menus based on
CD> cookie or session values.

CD> I can't seem to access ANY variables, be them $_SESSION, $_COOKIE, or
CD> anything else, inside this menu.php file.  I've tried even passing simple
CD> variables, globalizing them, etc, all the way down to see if I can access
CD> them in that menu.php file.  I still can't.. the closest I get is being able
CD> to access them in the site_header function, but when the include("menu.php")
CD> is called, everything seems to vanish.

CD> And yes, I have session_start(); at the top of my menu.php file as well..

CD> Can anyone help me out on this?  I was under the impression that the
CD> superglobals would be available from basically anything.. apparently I was
CD> wrong.

CD> Thanks,
CD> Chad

Get rid of that second session_start() you don't need it on included files only
on the main files which the browser is asking for.

-- 
regards,
Tom


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




Re[2]: [PHP] PHP includes without access to the default directory

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 7:15:38 AM, you wrote:

>> ini_set
G> ("include_path","/path/to/local/includes:"ini_get("include_path"));
>>
>> Then no matter what directory you are in you can just include("filename");
>>
>> --
>> regards,
>> Tom
>>

G> Thank you. This should work, but I have one question about the format of
G> that. this way I can make sure I do things right (getting a parse error
G> right now)

G> what did you mean by "include_path"?
G> /path/to/local/includes is just the path to the default includes folder?
G> and is include_path just the path to the includes folder that I use. And
G> with this, do I use the URL, or the file path (what I get whenever I get
G> errors)

G> and thank you again
Looks like I forgot a '.' in there :)
"/path/to/local/includes:" is the path to your new includes, we do that first so
that is the first place it will look . The ':' is used to add in another path
which we use ini_get() to retrieve the system wide include file from php.ini.
You may drop this and the ':' if you don't need it.

so if you are setup like this for example

/home/username/public_html/...web directory
/home/username/includes/..your include directory

the line would be

ini_set("include_path","/home/username/includes:".ini_get("include_path"));

-- 
regards,
Tom


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




Re: [PHP] Output page cut off after 7000 characters

2002-12-06 Thread Tom Rogers
Hi,

Thursday, December 5, 2002, 9:40:20 PM, you wrote:
FW> Hi All,
FW> i have to migrate a website from WNT/IIS to Solaris/Apache.

FW> Some stuff seems to work, but now I am stuck with a page which gets cut 
FW> off in the middle of the out put. It is a template system with a chain 
FW> of includes and requires (4 files involved, no fancy stuff, just some 
FW> variable assignements and selection of templates based on the HTTP_HOST 
FW> header). The last file contains the HTML code for the browser, the 
FW> server starts to send the output to the client, but stops in the middle 
FW> of this file. The cut appears after a certain constant number of 
FW> characters (7728 characters, cr's not counted).

FW> CR/LFs are not an issue, I verified all invioved files, they are just 
FW> plain text, even in vi ;-)

FW> I have Apache/1.3.14 (Unix) PHP/4.0.6 tomcat/1.0 (tomcat is not used for 
FW> this pages)

FW> Has anybodey an idea whre to look for the cause?

FW> Thanks
FW> Fritz

If the data is coming from an odbc connected database you may need to take a
look at odbc_longreadlen()

-- 
regards,
Tom


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




Re: [PHP] Humour me

2002-12-06 Thread @ Edwin
Hello,

"John Taylor-Johnston" <[EMAIL PROTECTED]> wrote:

> Humour me. New server. I'm a little tired.
> Where is my php.ini on a red hat server?

I took it :) Anyway,

Run phpinfo() --should give you a hint...

- E

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




Re: [PHP] Generating forms using OOP

2002-12-06 Thread Peter J. Schoenster
On 7 Dec 2002 at 0:43, Davy Obdam wrote:

> I ve just started with some OOP programming in PHP and now i have to
> build a set of classes that can generate a html form.. But i have a
> problem with the  thing I hope
> someone can help me here or give me some pointers,... any help is
> apreciated. Here is a part of my code :
> 
> class selectField extends formElement {
> 
> //Constructor
> function selectField($name, $value) {
> formElement::setName($name);
> formElement::setValue($value);
> }
> 
> function generateSelectField() {
> $theOutput = "name."\">\n";
> foreach($this->value as $key=>$val) {
> $theOutput .= " value=\"".$this->value."\">".$this->value."\n";
> }
> $theOutput .= "\n";
> Return $theOutput;
> }
> }
> 
> This is how i call the Object:
> 
> $test[] = "Test1";
> $test[] = "Test2";
> $test[] = "Test3";
> $test[] = "Test4";
> $test[] = "Test5";
> $select = new selectField("testje", $test);
> echo$select->generateSelectField();
> 
> But all i get is a select box with the word Array in it 5 times...Thanks
> for your time...

Below is an example that works. I don't know from formElement. But why, 
why in the world do you REALLY want to do this? Have you truly used and 
understood smarty and yet felt this must be done? I haven't. 

http://smarty.php.net/

It lets you focus on your application.

Peter


generateSelectField();


class selectField {

var $name;
var $value;

function selectField($name, $value) {
$this->name = $name;
$this->value = $value;
}

function generateSelectField() {
$theOutput = "name."\">\n";
foreach($this->value as $key=>$val) {
$theOutput .= "".$val."\n";
}
$theOutput .= "\n";
return $theOutput;
}
}


?>


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




[PHP] Humour me

2002-12-06 Thread John Taylor-Johnston
Humour me. New server. I'm a little tired.
Where is my php.ini on a red hat server?
John


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




Re[2]: [PHP] Repeating Decimals

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 6:36:18 AM, you wrote:
S> How would I run the functions though and then print the repeating decimal to
S> the screen?

The function returns the string ready to print
You will need to comment out the echo $s line, it was there for debugging.

just do   where ever you need it



-- 
regards,
Tom


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




[PHP] Re: HOW GET ALL HTML CONTENT

2002-12-06 Thread Dave
not sure exactly what you mean, but try $HTTP_RAW_POST_DATA
or $_SERVER['HTTP_RAW_POST_DATA']

"Nice_boy" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi,
>
> who knows how to get all contents when i use javascript to get bookmark of
> IE
> ex:
>
> window.external.ImportExportFavoritesfalse,"http://localhost/test.php";);
>
> because  i use $_POST to get that data,but it can't get all data.
>
> if it has 27593 bytes ,then only get 7XXX bytes. that means so many data
was
> not geted.
>
> i got some informations when use $HTTP_SERVER_VARS, then data is
>
> [key=COMSPEC]=value[C:\\WINDOWS\\COMMAND.COM]
> [key=CONTENT_LENGTH]=value[27593]
> [key=CONTENT_TYPE]=value[application/x-www-form-urlencoded]
> [key=DOCUMENT_ROOT]=value[c:/windows/desktop/web]
> [key=HTTP_CACHE_CONTROL]=value[no-cache]
> [key=HTTP_CONNECTION]=value[Keep-Alive]
> [key=HTTP_HOST]=value[localhost]
> [key=HTTP_USER_AGENT]=value[PostFavorites]
>
[key=PATH]=value[C:\\WINDOWS;C:\\WINDOWS\\COMMAND;C:\\PROGRA~1\\SSHCOM~1\\SS
>
HSEC~1;C:\\PROGRA~1\\MICROS~4\\80\\TOOLS\\BINN;C:\\PROGRA~1\\ULTRAE~1;C:\\PR
>
OGRA~1\\BORLAND\\DELPHI5\\BIN;C:\\PROGRA~1\\BORLAND\\VBROKER\\BIN;C:\\PROGRA
>
~1\\BORLAND\\VBROKER\\JRE\\BIN;C:\\PROGRA~1\\BORLAND\\DELPHI5\\PROJECTS\\BPL
> ;C:\\PROGRA~1\\ULTRAE~1]
> [key=REMOTE_ADDR]=value[127.0.0.1]
> [key=REMOTE_PORT]=value[1755]
> [key=SCRIPT_FILENAME]=value[c:/windows/desktop/web/test.php]
> [key=SERVER_ADDR]=value[127.0.0.1]
> [key=SERVER_ADMIN]=value[[EMAIL PROTECTED]]
> [key=SERVER_NAME]=value[211.22.80.5]
> [key=SERVER_PORT]=value[80]
> [key=SERVER_SIGNATURE]=value[Apache/1.3.24 Server at 211.22.80.5
> Port 80
> ]
> [key=SERVER_SOFTWARE]=value[Apache/1.3.24 (Win32) PHP/4.2.2]
> [key=WINDIR]=value[C:\\WINDOWS]
> [key=GATEWAY_INTERFACE]=value[CGI/1.1]
> [key=SERVER_PROTOCOL]=value[HTTP/1.1]
> [key=REQUEST_METHOD]=value[POST]
> [key=QUERY_STRING]=value[]
> [key=REQUEST_URI]=value[/test.php]
> [key=SCRIPT_NAME]=value[/test.php]
> [key=PATH_TRANSLATED]=value[c:/windows/desktop/web/test.php]
> [key=PHP_SELF]=value[/test.php]
> [key=argv]=value[Array]
> [key=argc]=value[0]
>
> so i know the content length is 27593
>
> who can tell me how to get all data but not use $_POST variables.
>
> thanks a lot..^^
>
>



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




Re: [PHP] Middle Number

2002-12-06 Thread Rick Widmer
At 09:45 PM 12/6/02 -0500, Stephen wrote:

How can you find the meadian (or middle number) of a list of numbers? If
there is an even amount of numbers, how would I still find it?



load the list into an array, in numeric order...

then:

$List = array( 1,2,3,4,5,6 );

$Middle = ( count( $List ) - 1 ) / 2;

$median = ( $List[ floor( $Middle ) ] + $List[ ceil( $Middle ) ] ) / 2;


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




[PHP] Re: Help! Stuck! Perm denied w/ fopen.

2002-12-06 Thread Dave
i thought (could be wrong) that directories need execute to read within
them, files only need r+w,
to make a directory readable.. i always chmod 755 my directories and 644 my
files (or in your case
chmod 777 directories and 666 files, but i don't recommend that at all).

sometimes, i chgrp nobobdy [file/dir] and then 775 [dir] or 664 [file] so
that apache can have access,
and your user, but not anybody else. make sure that doesn't mess anything
else that might want access
locally up.


"Psy Berpunk" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am running using php with apache and curl on a redhat machine.
> All the installs are very recent with recent versions.
> Processing of .phtml from the html directory is working great except:
>
> I am getting perm denied with fopen for a directory that is set to 666
> for permissions, and owned by the same user and group as specified in
> httpd.conf: apache
>
> Something strange is going on here, as I have verified and reverified
> the paths and httpd config and test code, and either 666 or ownership
> should
> be enough and I'm still getting permission denied.
>



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




Re: [PHP] Date again

2002-12-06 Thread Stephen
Not sure but I think now() doesn't return the date formate you'd want
assuming your date section is classified as a date. Here's what I would do:

$date = date("Y-m-d");
$sql = "SELECT * FROM table WHERE date='".$date"'";
$result = mysql_query($sql, $connection);

Hope it works!


- Original Message -
From: "Miguel Brás" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 10:39 PM
Subject: [PHP] Date again


> Ok guys,
>
> having a problem here. I did my table with 6 fields, they are:
> id  position  name  timein  timeout  date
>
> I have a form to insert the info on the fields, and at the date field, I
> have a drop down menu that returns me the next 7 days (the date in d/m/y),
> people will choose the date they want and that will be stored on the
table.
>
> Now I want to retrieve the position, name, timein and timeout from by
table
> and display it on a page. But I want only the records for the present
date.
> I inserted the info on my table and on the date's field I inserted
07/12/02
> and 06/12/02 just for testing
>
> I called the data via a query: SELECT position, name, timein, timeout,
date
> FROM table WHERE date=NOW()
> It was supposed that only the record from the present date was shown. But
> not, I can't have anything. Only the custom message I did if nothing was
> available
>
> What is missing here? Looked at PHP manual, time, date mktime and so on
> functions, but nothing.
> Anybody for a hand?
>
> One more thing, how can I do to prevent that different people apply for a
> same position, on the same day and during the "shift" of the first one
that
> applied?
>
> I mean, I decide to occupy the FSS position from 21:00 to 23:00 on 08th
> Decemeber.
> Someone come and try to apply also for FSS but from 19:00 to 20:30 or from
> 21:30 to 22:30. Since the position is occupied during a portion of the
> requested time or during all the requested time, how can I prevent this to
> be added on the table??
>
> Thx
> Miguel
>
>
>
> --
> 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: XSLT failing when DOCTYPE declaration present

2002-12-06 Thread Dave
or either the permissions are wrong on the external site or the file doesn't
exist

-dave

ps - just trying to give some quick advice hoping it would help, if you
don't appreciate it,
i can give you some "insightful advice" about what to go do with yourself.

"Dave" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> oops,
>
> file permission problem, if it isn't set to right permissions, it won't
read
> and
> act as if there wasn't one, which then makes it work. so it does look like
> your doc
> doesn't conform.
>
> "Chris Wesley" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > On Wed, 4 Dec 2002, Dave wrote:
> >
> > Whoah ... was this reply sent several weeks ago when I sent the original
> > message and I'm just getting it now, or was it sent just recently?
> >
> > > without seeing the specifics, and assuming that PHP is never wrong (in
> the 4
> > > years i've used it, it hasn't been!)... your xml doc doesn't conform
to
> > > the DTD. if you think this isn't the case, well, double check. if you
> >
> > Re-read my original message, and it's painfully obvious that I did
> > check, and that the XML did in fact conform to the DTD I used.
> > (The XSLT was fine when the DTD was referenced locally, rather than
> > remotely.)
> >
> > > still feel it is an error, you may want to email a bug issue to the
> > > sablotron people (i'm assuming that's what you're using).
> >
> > Yes, I used the Sablotron extension to PHP 4.2.2.  Thanks for the
> > insightful advice 
> >
> > ~Chris
> >
> > > "Chris Wesley" <[EMAIL PROTECTED]> wrote in message
> > >
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > I'm using the xslt capabilities in PHP 4.2.2 and running into an odd
> > > > problem.  I'm transforming an XML document which has a DOCTYPE
> > > > declaration referencing an external DTD.
> > > >
> > > > http://my.host.org/foo.dtd";>
> > > >
> > > > When I have xslt_process() attempt to transform the XML document,
with
> an
> > > > XSL document I provide, it fails.  These are the errors I get back
> from
> > > > xslt_error() & xslt_errno.
> > > >   error: XML parser error 4: not well-formed (invalid token).
> > > >   errno: 2
> > > >
> > > > If I remove the DOCTYPE declaration from the XML, xslt_process() has
> no
> > > > problem transforming the XML.
> > > >
> > > > If I change the DOCTYPE declaration to:
> > > > 
> > > > then xslt_process() has no problem transfoming the XML.
> > > >
> > > > However, I need to make this work with the external DTD reference
> being to
> > > > some other host (http://other.my.host.org/foo.dtd).
> > > > Has anyone gotten this to work properly, have any insight into the
> error
> > > > information above, or know what I might have to do differently?
> >
> >
>
>



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




Re: [PHP] Re: XSLT failing when DOCTYPE declaration present

2002-12-06 Thread Dave
oops,

file permission problem, if it isn't set to right permissions, it won't read
and
act as if there wasn't one, which then makes it work. so it does look like
your doc
doesn't conform.

"Chris Wesley" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Wed, 4 Dec 2002, Dave wrote:
>
> Whoah ... was this reply sent several weeks ago when I sent the original
> message and I'm just getting it now, or was it sent just recently?
>
> > without seeing the specifics, and assuming that PHP is never wrong (in
the 4
> > years i've used it, it hasn't been!)... your xml doc doesn't conform to
> > the DTD. if you think this isn't the case, well, double check. if you
>
> Re-read my original message, and it's painfully obvious that I did
> check, and that the XML did in fact conform to the DTD I used.
> (The XSLT was fine when the DTD was referenced locally, rather than
> remotely.)
>
> > still feel it is an error, you may want to email a bug issue to the
> > sablotron people (i'm assuming that's what you're using).
>
> Yes, I used the Sablotron extension to PHP 4.2.2.  Thanks for the
> insightful advice 
>
> ~Chris
>
> > "Chris Wesley" <[EMAIL PROTECTED]> wrote in message
> >
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I'm using the xslt capabilities in PHP 4.2.2 and running into an odd
> > > problem.  I'm transforming an XML document which has a DOCTYPE
> > > declaration referencing an external DTD.
> > >
> > > http://my.host.org/foo.dtd";>
> > >
> > > When I have xslt_process() attempt to transform the XML document, with
an
> > > XSL document I provide, it fails.  These are the errors I get back
from
> > > xslt_error() & xslt_errno.
> > >   error: XML parser error 4: not well-formed (invalid token).
> > >   errno: 2
> > >
> > > If I remove the DOCTYPE declaration from the XML, xslt_process() has
no
> > > problem transforming the XML.
> > >
> > > If I change the DOCTYPE declaration to:
> > > 
> > > then xslt_process() has no problem transfoming the XML.
> > >
> > > However, I need to make this work with the external DTD reference
being to
> > > some other host (http://other.my.host.org/foo.dtd).
> > > Has anyone gotten this to work properly, have any insight into the
error
> > > information above, or know what I might have to do differently?
>
>



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




[PHP] Date again

2002-12-06 Thread Miguel Brás
Ok guys,

having a problem here. I did my table with 6 fields, they are:
id  position  name  timein  timeout  date

I have a form to insert the info on the fields, and at the date field, I
have a drop down menu that returns me the next 7 days (the date in d/m/y),
people will choose the date they want and that will be stored on the table.

Now I want to retrieve the position, name, timein and timeout from by table
and display it on a page. But I want only the records for the present date.
I inserted the info on my table and on the date's field I inserted 07/12/02
and 06/12/02 just for testing

I called the data via a query: SELECT position, name, timein, timeout, date
FROM table WHERE date=NOW()
It was supposed that only the record from the present date was shown. But
not, I can't have anything. Only the custom message I did if nothing was
available

What is missing here? Looked at PHP manual, time, date mktime and so on
functions, but nothing.
Anybody for a hand?

One more thing, how can I do to prevent that different people apply for a
same position, on the same day and during the "shift" of the first one that
applied?

I mean, I decide to occupy the FSS position from 21:00 to 23:00 on 08th
Decemeber.
Someone come and try to apply also for FSS but from 19:00 to 20:30 or from
21:30 to 22:30. Since the position is occupied during a portion of the
requested time or during all the requested time, how can I prevent this to
be added on the table??

Thx
Miguel



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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
To all who assisted me today.

I finally managed to get the mail () funtion to work.

Thank you and happy holidays to you all...
TR





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




[PHP] Middle Number

2002-12-06 Thread Stephen
How can you find the meadian (or middle number) of a list of numbers? If
there is an even amount of numbers, how would I still find it?

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

"What is a dreamer that cannot persevere?" -- http://www.melchior.us


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


Re: [PHP] Good eve

2002-12-06 Thread Miguel Brás
thx to both

Miguel

"Rolf Vreijdenberger" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> SELECT field1, field2, field3 FROM table WHERE date=NOW()
>
>



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




Re: [PHP] Good eve

2002-12-06 Thread rolf vreijdenberger
 SELECT field1, field2, field3 FROM table WHERE date=NOW()



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




[PHP] Allowed memory size exhausted

2002-12-06 Thread Jeff Schwartz

I have a large amount of data (1,948,280 bytes) that I tried to write out to a file 
using

if ($fp = fopen($file,"w")):

fwrite($fp,$contents,strlen($contents));

fclose($fp);

endif;





and got "Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to 
allocate 1948281 bytes)" on the 2nd line. So, I tried to write out smaller portions 
with:

if ($fp = fopen($file,"w")):

$size = 4096;

while (strlen($contents)){

$temp = substr($contents,0,$size);

fwrite($fp,$temp,$size);

$contents = substr($contents,$size+1);

}

fclose($fp);

endif;

but get a similar error on the line "$contents = substr($contents,$size+1);" which is 
what I'm using to try to avoid running out of memory. It appears that I can't replace 
the variable with a smaller version of itself. 

So, if I can't write out the whole thing and can't section it either, what can I do?

Jeff



-
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now


Re: [PHP] Good eve

2002-12-06 Thread Brad Bonkoski
Check out:
http://www.php.net/manual/en/function.mktime.php
HTH
-Brad

"Miguel Brás" wrote:

> I have a table with several field, one of them has a date insertion on the
> d/m/y format.
> I would like to return only the data for the present day (today will be date
> 05/12/02 tomorrow will be 06/12/02)
>
> I will do SELECT field1, field2, field3 FROM table WHERE date=?
>
> What is missing on the ??s ?
>
> Thx in advance
> Miguel
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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




[PHP] Re: Date

2002-12-06 Thread Miguel Brás
And sorry about the subject, it should be Date
"Miguel BráS" <[EMAIL PROTECTED]> escreveu na mensagem
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a table with several field, one of them has a date insertion on the
> d/m/y format.
> I would like to return only the data for the present day (today will be
date
> 05/12/02 tomorrow will be 06/12/02)
>
> I will do SELECT field1, field2, field3 FROM table WHERE date=?
>
> What is missing on the ??s ?
>
> Thx in advance
> Miguel
>
>



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




[PHP] Good eve

2002-12-06 Thread Miguel Brás
I have a table with several field, one of them has a date insertion on the
d/m/y format.
I would like to return only the data for the present day (today will be date
05/12/02 tomorrow will be 06/12/02)

I will do SELECT field1, field2, field3 FROM table WHERE date=?

What is missing on the ??s ?

Thx in advance
Miguel



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




[PHP] Help! Stuck! Perm denied w/ fopen.

2002-12-06 Thread psy berpunk
I am running using php with apache and curl on a redhat machine.
All the installs are very recent with recent versions.
Processing of .phtml from the html directory is working great except:

I am getting perm denied with fopen for a directory that is set to 666
for permissions, and owned by the same user and group as specified in
httpd.conf: apache

Something strange is going on here, as I have verified and reverified
the paths and httpd config and test code, and either 666 or ownership
should
be enough and I'm still getting permission denied.


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




[PHP] Generating forms using OOP

2002-12-06 Thread Davy Obdam
Hi People,

I ve just started with some OOP programming in PHP and now i have to 
build a set of classes that can generate a html form.. But i have a 
problem with the  thing
I hope someone can help me here or give me some pointers,... any help is 
apreciated. Here is a part of my code :

class selectField extends formElement {
  
   //Constructor
   function selectField($name, $value) {
   formElement::setName($name);
   formElement::setValue($value);
   }

   function generateSelectField() {
   $theOutput = "name."\">\n";
   foreach($this->value as $key=>$val) {
   $theOutput .= "value."\">".$this->value."\n";
   }
   $theOutput .= "\n";
   Return $theOutput;
   }
}

This is how i call the Object:

$test[] = "Test1";
$test[] = "Test2";
$test[] = "Test3";
$test[] = "Test4";
$test[] = "Test5";
$select = new selectField("testje", $test);
echo$select->generateSelectField();

But all i get is a select box with the word Array in it 5 times...Thanks 
for your time...

Best regards,

Davy Obdam
mailto:[EMAIL PROTECTED]



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



Re: [PHP] evaluating vars in a var

2002-12-06 Thread Leif K-Brooks
Yes.  If it was in double quotes, it would parse the variables before 
the loop started.  Another way would be to put it in double quotes and 
escape the dollar signs.

Rolf Vreijdenberger wrote:

I notice that you put everything in single quotes and then escape it.
is there any special reason for that? 

thanks

 


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




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




Re: [PHP] evaluating vars in a var

2002-12-06 Thread rolf vreijdenberger
thanks a lot,
I thought there might be a trick,
this is really helpful,
thanks again



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




Re: [PHP] evaluating vars in a var

2002-12-06 Thread Leif K-Brooks
$htmlEmail = 'hello $firstName
$lastName';
//Start loop
eval("\$thisemail = $htmlemail");
//Send mail out, using $thisemail for mail body
//End loop

rolf vreijdenberger wrote:


Hi,
this problem came forth from my previously posted -Mail(): how much time-,
but is different so I posted it seperately.

I make html emails with personal stuff in it e.g.
hello $firstName $lastName
etc.

Problem:
I would like to put the whole email html layout in one var, like this:
$htmlEmail = "hello $firstName
$lastName";

and then I want to have the values of firstName and $lastName updated in
every iteration of a loop where I put in new Values of these vars.
In order to do this, I have to reevaluate the whole $htmlEmail variable.

Is this possible, and if so, how?

thanks a lot



 


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




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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
DL,
Sorry to be a pain... but using either:

the address of my outgoing mail server

or

localhost

still gives me:

Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14

Thanks again for your time.
TR




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




Re: [PHP] Re: stripping spaces from a string

2002-12-06 Thread Jule Slootbeek
perfect, exactly what i needed
thanks

J.
On Friday, Dec 6, 2002, at 16:38 US/Eastern, J Smith wrote:



Regular expressions would be overkill. Try

$newString = str_replace(" ", "", $oldString);

J


Jule Slootbeek wrote:


Hi,

What's the best and easiest way to strip all the spaces from a string?
do i use regular expressions for it?

TIA,
J.
Jule Slootbeek
[EMAIL PROTECTED]



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



Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] Re: stripping spaces from a string

2002-12-06 Thread J Smith

Regular expressions would be overkill. Try

$newString = str_replace(" ", "", $oldString);

J


Jule Slootbeek wrote:

> Hi,
> 
> What's the best and easiest way to strip all the spaces from a string?
> do i use regular expressions for it?
> 
> TIA,
> J.
> Jule Slootbeek
> [EMAIL PROTECTED]


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




[PHP] stripping spaces from a string

2002-12-06 Thread Jule Slootbeek
Hi,

What's the best and easiest way to strip all the spaces from a string? 
do i use regular expressions for it?

TIA,
J.
Jule Slootbeek
[EMAIL PROTECTED]


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



[PHP] I can list directories. But not the files :/

2002-12-06 Thread
 Hello. Here is the code to list all directories in my /members directory: $path = 
"./"; // even "."if ($dir = @opendir($path)) {while (($file = readdir($dir)) !== 
false) {if ($file=='.' || $file=='..' || $file=='_vti_cnf' || $file=='notes.htm' || 
$file=='showall_copy(1).php') continue;if (is_dir($path."/".$file)) {echo 
$file."
";}} closedir($dir);} Ok. So it shows:directory1directory2 How do I place the filename in the directory in a line left - right under each directory name?Is this possible? (for ex.)Directoryfile 1 - file 10... Ps. I hope the format is correct. If not my apologies. ___ Join Excite! - http://www.excite.com The most personalized portal on the Web!

[PHP] evaluating vars in a var

2002-12-06 Thread rolf vreijdenberger
Hi,
this problem came forth from my previously posted -Mail(): how much time-,
but is different so I posted it seperately.

I make html emails with personal stuff in it e.g.
hello $firstName $lastName
etc.

Problem:
I would like to put the whole email html layout in one var, like this:
$htmlEmail = "hello $firstName
$lastName";

and then I want to have the values of firstName and $lastName updated in
every iteration of a loop where I put in new Values of these vars.
In order to do this, I have to reevaluate the whole $htmlEmail variable.

Is this possible, and if so, how?

thanks a lot



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




Re: [PHP] PHP includes without access to the default directory

2002-12-06 Thread Gundamn

"Tom Rogers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi,
>
> Friday, December 6, 2002, 11:06:36 AM, you wrote:
> G> I have a hosted account. As such, I am unable to use the default
location
> G> for files when used with the include command. So could somebody tell me
how
> G> I can either make it go to a different directory, or to link to
something
> G> (and how to add the variable as the filename)?
>
> G> Thank you in advance.
>
> If you still need access to the default include directory put this at the
top of
> each page:
>
> ini_set
("include_path","/path/to/local/includes:"ini_get("include_path"));
>
> Then no matter what directory you are in you can just include("filename");
>
> --
> regards,
> Tom
>

Thank you. This should work, but I have one question about the format of
that. this way I can make sure I do things right (getting a parse error
right now)

what did you mean by "include_path"?
/path/to/local/includes is just the path to the default includes folder?
and is include_path just the path to the includes folder that I use. And
with this, do I use the URL, or the file path (what I get whenever I get
errors)

and thank you again



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




Re: [PHP] Mail(): How much time?

2002-12-06 Thread rolf vreijdenberger
I do something similar, I wasn't clear with what I meant by a loop. the loop
is the same as you do, I work on the result set too!



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




Re: [PHP] Bug with "+" sign when using CLI?

2002-12-06 Thread Chris Wesley
On Fri, 6 Dec 2002, Charles Bronson wrote:
> I found nothing about a + splitting argument variables anywhere in the
> CLI documentation though I know this is a CGI characteristic. I've tried
> escaping the + character to no avail.

Check out the bug:

http://bugs.php.net/bug.php?id=18566

I experienced the same thing (Linux 2.4.17, Apache 1.3.26, PHP 4.2.2
mod_php & CGI).  I can't really tell if there is a fix, or intent to fix
it, since the bug is still open.  Perhaps there is a mention of this issue
in the changelogs of more recent versions.

g.luck,
~Chris




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




RE: [PHP] Mail(): How much time?

2002-12-06 Thread Charles Bronson
There are a couple of spots it may be slowing down depending on how your
doing things. I have a mysql database and submit one query in which I
hold all the data in an array. Then I loop through the array so I do not
need to send multiple queries.

I use something like the following, though I like to stay away from the
mail() function, especially when sending a lot of emails.

$Subject = "This is the subject";
$Message = "This is the message\nand with a second line";
$Query_Result = mysql_query("SELECT `EID`, `Email`, FROM `Emails_Main`")
or die (mysql_error());
while ($CurrentRow = mysql_fetch_row($Query_Result)){
mail($CurrentRow[1], $Subject, $Message, "From:
[EMAIL PROTECTED]\r\n");
}

Hope this helps.
Bronson_AT_udatasystems.com


-Original Message-
From: rolf vreijdenberger [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 06, 2002 3:53 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Mail(): How much time?


Hi,
I am getting all my emailadresses for my mailinglist out of a database
in a loop, and in that same loop I personalize the email by adding the
name and a personal URL (script.php?email=youremail). In that loop I
then send the email. This whole process takes about 0.5 to 2 seconds per
adress. This seems quite long to me. It can't be the database query or
the if conditions in the loop, so why is this taking so long?? I don't
have any problems with script execution time as I increment it in every
iteration. This is not a nice solution though. I am also wondering how
many adresses you can put in one subject, Cc or Bcc field?

thanks in advance

--
Rolf Vreijdenberger
De Pannekoek en De Kale
Maystraat 6
2593 VW Den Haag
T: 06-24245719
E: [EMAIL PROTECTED]
W: www.depannekoekendekale.nl



-- 
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] Updating int4 field with multiple values

2002-12-06 Thread Andre Dubuc
de-ja vu   (P)  Pronunciation Key (du hhh)
n . Foreign
1. Something unpleasantly familiar
2. 'Been-there-done-that'

Don't you love it when you've set a field to a certain type, only to find out 
much later, after much coding, it's wrong?

Thanks for the reminder. Guess it's back to Geek 1.0.1 for me.

Regards,
Andre



On Friday 06 December 2002 03:31 pm, 1LT John W. Holmes wrote:
> > I would like to update an int4 column with new values appended to the end
> > (preferably with a delimiter such as @ or a comma).
>
>   in·te·ger( P )  Pronunciation Key  (nt-jr)
>   n. Mathematics
> 1.. A member of the set of positive whole numbers 1, 2, 3,... ,
> negative whole numbers -1, -2, -3,... , and zero {0}.
> 2.. A complete unit or entity.
>
>
> ---John Holmes...

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




[PHP] Mail(): How much time?

2002-12-06 Thread rolf vreijdenberger
Hi,
I am getting all my emailadresses for my mailinglist out of a database in a
loop,
and in that same loop I personalize the email by adding the name and a
personal URL (script.php?email=youremail).
In that loop I then send the email.
This whole process takes about 0.5 to 2 seconds per adress.
This seems quite long to me.
It can't be the database query or the if conditions in the loop, so why is
this taking so long??
I don't have any problems with script execution time as I increment it in
every iteration.
This is not a nice solution though.
I am also wondering how many adresses you can put in one subject, Cc or Bcc
field?

thanks in advance

--
Rolf Vreijdenberger
De Pannekoek en De Kale
Maystraat 6
2593 VW Den Haag
T: 06-24245719
E: [EMAIL PROTECTED]
W: www.depannekoekendekale.nl



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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread Andre Dubuc
Hi Jason,

So, I gather from your reply that I cannot add more digits to that integer 
field separated by spaces or whatever?  I sort of figured I won't be able to 
do it, so I'm trying to get things working by changing the type to varchar() 
and doing it as a string. Seems to work - with glitches.



An

On Friday 06 December 2002 01:39 pm, you wrote:
> On Saturday 07 December 2002 00:56, Andre Dubuc wrote:
> > I would like to update an int4 column with new values appended to the end
> > (preferably with a delimiter such as @ or a comma).
> >
> > With PostgreSQl 7.2, I can't seem to add the number with a delimiter (it
> > gives me a parser error at the delimiter). For example, If I update the
> > field 'radd' that already has  number 36 in it, it does append the new
> > number, but without any space. So, if I updated with a new number, 6, the
> > 'radd' result would now be '366' instead of '36 6'
> >
> > Without the delimiter, it might be difficult to do selects on this field
> > when I need to find a specific number within the field. (Btw, I'm using
> > $_SESSION['rid'] . . . etc instead of $rid in the actual code.) Any ideas
> > what I'm doing wrong?
> >
> > Any suggestions will be greatly appreciated.
>
> Am I missing something or are you really trying to insert non-digits into
> an INTEGER field?

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




[PHP] Failed to install Mod_cURL under Windows/Apache

2002-12-06 Thread DL Neil
PHP v4.2.3 with Apache 1.3.24 under Win2000 Prof SP2

Downloaded the full v4.2.3 zip package/Win binary, some weeks ago.
Installation went fine. Extensions are happily included. Have had several
weeks of operations.

Decided to install cURL to do some URL (strangely enough) link
verification-checking. Started at manual: XII. CURL, Client URL Library
Functions
with sent me to http://curl.haxx.se and in turn
http://curl.haxx.se/libcurl/php/

Downloaded curl-7.10.2-win32-nossl which (really) only contains CURL.EXE. I
cannot see any instructions telling me what to do with this/where to put
it!? Moved it to the same location as PHP.EXE. It runs happily from the
command line (so that's something!)

Moved both the .dlls around, checked the MVC file, and uncommented the
PHP.INI line - and verified it with PHPINFO().

However when a PHP script (copied straight off the PHP manual) calls
curl_init () it causes Apache to crash: "Apache.exe has generated errors and
will be closed by Windows. You will need to restart the program. An error
log is being created."
- restarting the Apache service and re-running results in the same error
- rebooting the whole system and re-running also.
- the v-server's error log shows nothing and the access log only shows the
PHPINFO() mentioned
- there's nothing in the Windows Event log
- I can't figure out where this "error log" is created

Help! I've missed something...
=dn


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




RE: [PHP] html output from system() command

2002-12-06 Thread Charles Bronson
If you try viewing the source of the webpage it will probably show up
correctly.

If this is the case, try putting the output into a variable and passing
it to the nl2br() function.

Echo nl2br($commandoutput);

And/or make your way to http://www.php.net/manual/en/function.nl2br.php

Bronson_AT_udatasystems.com


-Original Message-
From: Clay Stuckey [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 06, 2002 3:41 PM
To: Php
Subject: [PHP] html output from system() command


When I execute:
system('who');

I get the output to the screen but it is all concatenated together like
this:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net) sneakytrick pts/1
Dec 6 10:22 (34-218-228-130.arpa.kmail.net)

How can I make it look like:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net) sneakytrick pts/1
Dec 6 10:22 (34-218-228-130.arpa.kmail.net)



--
Clay Stuckey - RHCE, CCNA, MCSE
Charleston Housing Authority - MIS Manager
[EMAIL PROTECTED]
--



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




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




Re: [PHP] html output from system() command

2002-12-06 Thread Chris Shiflett
--- Clay Stuckey <[EMAIL PROTECTED]> wrote:
> When I execute:
> system('who');
> 
> I get the output to the screen but it is all concatenated
> together like this:
> root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net)
> sneakytrick pts/1 Dec 6 10:22
> (34-218-228-130.arpa.kmail.net)
> 
> How can I make it look like:
> root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net)
> sneakytrick pts/1 Dec 6 10:22
> (34-218-228-130.arpa.kmail.net)

Try surrounding it with  tags.

Chris

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




RE: [PHP] Problems with header

2002-12-06 Thread Charles Bronson
It looks like your trying to do something before redirecting the user.
Try the below near the end of your script so everything completes before
redirecting them.

Echo ";

Bronson_AT_udatasystems.com

-Original Message-
From: Carlos Alberto Pinto Hurtado [mailto:[EMAIL PROTECTED]] 
Sent: Friday, December 06, 2002 3:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problems with header


I'm use 

header("Location:
http://www.ica.gov.co/contratacion/RObs_borradores?control=1";);

but the answer is

Warning Cannont add header information - headers already send by (output
started at G:\Intranet\common\mail.php:36) in
G:\Intranet\common\mail.php on line 37

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



-- 
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] html output from system() command

2002-12-06 Thread Clay Stuckey
When I execute:
system('who');

I get the output to the screen but it is all concatenated together like
this:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net) sneakytrick pts/1 Dec
6 10:22 (34-218-228-130.arpa.kmail.net)

How can I make it look like:
root pts/0 Dec 6 15:31 (34-218-228-130.arpa.kmail.net)
sneakytrick pts/1 Dec 6 10:22 (34-218-228-130.arpa.kmail.net)



--
Clay Stuckey - RHCE, CCNA, MCSE
Charleston Housing Authority - MIS Manager
[EMAIL PROTECTED]
--



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




Re: [PHP] Repeating Decimals

2002-12-06 Thread Stephen
How would I run the functions though and then print the repeating decimal to
the screen?


- Original Message -
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "Stephen" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 8:38 AM
Subject: Re: [PHP] Repeating Decimals


> Hi,
>
> Friday, December 6, 2002, 5:00:07 AM, you wrote:
> S> Hello again,
>
> S> This is another PHP mathematical question. How can I display a bar over
a
> S> number (overline) if it's a repeating decimal? When the user types in 1
by
> S> 3, they get 0.. I want it to display as 0.3 with the 3
> S> overlined. How can I do this keeping in mind that not all numbers will
be
> S> repeating decimals?
>
> Did this as an exercise :)
>
> function check_to_end($str,$pat){
> $lp = strlen($pat);
> $ls = strlen($str);
> $x = 0;
> while(true){
> $ls = strlen($str);
> if($ls > $lp){//string bigger than pattern
> $t = substr($str,0,$lp);
> if($t != $pat){
> return false;
> }
> $str = substr($str,$lp);
> }else{//pattern too big .. checks tail end
> $pat = substr($pat,0,strlen($str));
> if( $pat != $str) return false; //no repeat
> if($x < 2) return false; //didn't repeat enough
> return true; //found a pattern
> }
> $x++;
> }
> }
> function repeat($num){
> $s = substr(number_format($num,16),0,-1); //make a string
> echo $s;
> list($a,$b) = split('\.',$s); //split decimal bit out
> $l = strlen($b);
> for($i=0;$i<$l;$i++){ //loop through string
> $o = 0;
> $k = $b[$i];//number to find
> for($y = $i+1;$y<$l;$y++){ //loop look for same number
> $c = ord($b[$y]);
> if(ord($k) == ord($b[$y])){ //got a match
> $pat = substr($b,$i,$y-$i); //cut out
pattern
> $str = substr($b,$i); //string to check
> if(check_to_end($str,$pat)){ //see if
pattern runs till the end
> $o = 1; //yep
> if(ord($pat) == ord('0')) $o = 2;
//were they just '0's
> break;
> }
> }
> }
> if($o)break; // all done
> }
> if($o == 1){ // a pattern
> $r = $a.'.'.substr($b,0,$i).''.$pat.'';
> }elseif($o == 2){ // whole bunch of ending 0s
> $r = (substr($b,0,$i) != '')? $a.'.'.substr($b,0,$i):$a;
> }else{ //no repeat
> $r = $s;
> }
> return $r;
> }
> //usage
> for($x = 1;$x < 100;$x++){
> $a = 11/$x;
> $res = repeat($a);
> echo '   returned: '.$res.'';
> }
>
> The  check_to_end() function could probably be replaced with a regex but
those
> go in the same basket as vi with my old brain :)
>
>  Regards Tom
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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




Re: [PHP] Problems with header

2002-12-06 Thread Stephen
Plainly put, you've already sent headers. Wheather it be an  tag, a
plain character, or just a space. Check line 37 and see what it is...


- Original Message -
From: "Carlos Alberto Pinto Hurtado" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 3:31 PM
Subject: [PHP] Problems with header


I'm use

header("Location:
http://www.ica.gov.co/contratacion/RObs_borradores?control=1";);

but the answer is

Warning Cannont add header information - headers already send by (output
started at G:\Intranet\common\mail.php:36) in G:\Intranet\common\mail.php on
line 37

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181
(57 1) 2324698
Movil.(57 3) 310 6184251



--
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] Problems with header

2002-12-06 Thread Carlos Alberto Pinto Hurtado
I'm use 

header("Location: http://www.ica.gov.co/contratacion/RObs_borradores?control=1";);

but the answer is

Warning Cannont add header information - headers already send by (output started at 
G:\Intranet\common\mail.php:36) in G:\Intranet\common\mail.php on line 37

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread 1LT John W. Holmes
> I would like to update an int4 column with new values appended to the end
> (preferably with a delimiter such as @ or a comma).

  in·te·ger( P )  Pronunciation Key  (nt-jr)
  n. Mathematics
1.. A member of the set of positive whole numbers 1, 2, 3,... ,
negative whole numbers -1, -2, -3,... , and zero {0}.
2.. A complete unit or entity.


---John Holmes...



Re: [PHP] redirect URL

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 04:26, 1LT John W. Holmes wrote:
> >I don't can redirect my page to new url
> >please help me
> >
> >Carlos Alberto Pinto Hurtado
>
> I posted the answer on my web page.

Can you redirect the answer to the list so we can all see? 

Only joking ;-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It is the business of little minds to shrink.
-- Carl Sandburg
*/


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




Re: [PHP] Sigh :)

2002-12-06 Thread 1LT John W. Holmes
> OK, I think I've solved this, and you'll probably kick yourself when I
explain it!"  But first, a teaser:  what looks like a double-quote in HTML,
but isn't?

Hey, if that's it, I get a free kick, too. I suggested that a while ago but
there was no response.

---John Holmes...


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




[PHP] Bug with "+" sign when using CLI?

2002-12-06 Thread Charles Bronson
I'm using the CLI script shown below to parse and show all argv
variables passed to it.

##
-rwxr-xr-x1 nobody  nobody  plusbug.php
##
#!/usr/bin/php -q 

### END ##

Command being entered:
./plusbug.php 'something+something'

Output:
Array
(
[0] => ./plusbug.php
[1] => something
[2] => something
)

I found nothing about a + splitting argument variables anywhere in the
CLI documentation though I know this is a CGI characteristic. I've tried
escaping the + character to no avail.

I need to pass a string with a + character in it, anyone know anything I
can do other than repopulating the character back into the string within
the php script which would make what I'm trying to accomplish very
difficult.


In the php.ini I have:
register_globals = On
register_argc_argv = On

Note:
If I have either of these turned off, I am not even able to pick-up the
arguments passed to the script whether I use $argv or $_SERVER['argv'].

PHP Version: 4.2.3

Regards,
Bronson_AT_udatasystems.com



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




Re: [PHP] redirect URL

2002-12-06 Thread 1LT John W. Holmes
>I don't can redirect my page to new url 
>please help me
>
>Carlos Alberto Pinto Hurtado

I posted the answer on my web page. 

---John Holmes...

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




Re: [PHP] redirect URL

2002-12-06 Thread Chris Shiflett
--- Carlos Alberto Pinto Hurtado <[EMAIL PROTECTED]>
wrote:
> I don't can redirect my page to new url

Try this:

http://www.google.com/";);
exit;
?>

Chris

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




[PHP] redirect URL

2002-12-06 Thread Carlos Alberto Pinto Hurtado
I don't can redirect my page to new url 

please help me

Carlos Alberto Pinto Hurtado
IT ICA
(57 1) 2322181 
(57 1) 2324698
Movil.(57 3) 310 6184251



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




[PHP] Confused about $_SESSION and $_COOKIE scope..

2002-12-06 Thread Chad Day
I'm not sure why this isn't working, been banging my head at it for a couple
hours now.

I have a file (index.php), which calls a function that draws the header to
my page.

Inside that function (site_header), is an include to a file (menu.php) which
draws dynamic javascript menus based on
cookie or session values.

I can't seem to access ANY variables, be them $_SESSION, $_COOKIE, or
anything else, inside this menu.php file.  I've tried even passing simple
variables, globalizing them, etc, all the way down to see if I can access
them in that menu.php file.  I still can't.. the closest I get is being able
to access them in the site_header function, but when the include("menu.php")
is called, everything seems to vanish.

And yes, I have session_start(); at the top of my menu.php file as well..

Can anyone help me out on this?  I was under the impression that the
superglobals would be available from basically anything.. apparently I was
wrong.

Thanks,
Chad


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




[PHP] Re: XSLT support for RH8

2002-12-06 Thread electroteque
dont use rpm's at all use soure , i did a base net install of RH8 most of
the packages i didnt even select coz i wanted to get them manually were
older versions and unpatched versions with security issues dammit ! , you
will need sablot for xslt support , goto www.php.net/xslt and check out
sablot

"Derick Rethans" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Dan Kuykendall wrote:
> > I cannot seem to get RH8 to to compile XSLT support. Has anyone else
> > gotten this to work? Anyone with the resulting php-xslt rpm?
>
> What is the error message? And you really should not rely on the RH8 RPMS
as
> they found it necessary to change some defaults.
>
> --
>
> -
>   Derick Rethans http://derickrethans.nl/
>   PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
> -
>



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




[PHP] Output page cut off after 7000 characters

2002-12-06 Thread Fritz.Wittwer
Hi All,
i have to migrate a website from WNT/IIS to Solaris/Apache.

Some stuff seems to work, but now I am stuck with a page which gets cut 
off in the middle of the out put. It is a template system with a chain 
of includes and requires (4 files involved, no fancy stuff, just some 
variable assignements and selection of templates based on the HTTP_HOST 
header). The last file contains the HTML code for the browser, the 
server starts to send the output to the client, but stops in the middle 
of this file. The cut appears after a certain constant number of 
characters (7728 characters, cr's not counted).

CR/LFs are not an issue, I verified all invioved files, they are just 
plain text, even in vi ;-)

I have Apache/1.3.14 (Unix) PHP/4.0.6 tomcat/1.0 (tomcat is not used for 
this pages)

Has anybodey an idea whre to look for the cause?

Thanks
	Fritz


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



Re: [PHP] Cookies help please

2002-12-06 Thread Steve Vernon
Thanks a million, must of had something else on my mind ;-)

Love,

Steve
XX



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




Re: [PHP] mail() problems...

2002-12-06 Thread Chris Shiflett
--- Anthony Ritter <[EMAIL PROTECTED]>
wrote:
> "If you're using PHP4 on Windows, look for the following
> lines in your php.ini file:
> 
> [mail function]
> SMTP =; for Win32 only
> sendmail_from = ;for Win32 only
> 
> You'll need to modify the last two lines so that the mail
> function works properly.
> 
> 1. For the SMTP entry, use 'localhost" or the name of the
> outgoing mailserver you use in your e-mail client.
> 
> 2. For the sendmail_from entry, enter your e-mail
> address.
> 
> For example in my php.ini file on Windows contains this:
> 
> [mail function]
> SMTP =localhost
> sendmail_from = [EMAIL PROTECTED]
> 
> So that's what I did -using localhost - and I get:
> 
> "failed to connect".

Right. Unlike Linux, I doubt Windows has a mail server
running locally without you having to buy and/or install
some extra software. I have very little experience with
Windows, but this is most likely your problem.

Take the author's advice and use whatever mail server your
mail client is using. It is probably a remote server of
some sort.

Chris

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




Re: [PHP] mail() problems...

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 04:35, Anthony Ritter wrote:

> Gentlemen,
> Thank you for your assistance.
>
> The PHP mail scripts were taken from Julie Meloni's book on PHP called
> "Fast and East" on pp. 116-117. (PrimaTech).

Let's not blame it on her.

> In fact, she writes:

[snip]

Right, but didn't heed her advice?

> For example in my php.ini file on Windows contains this:
>
> [mail function]
> SMTP =localhost
> sendmail_from = [EMAIL PROTECTED]

Those are _her_ settings, doesn't necessarily work for you as well.

> So that's what I did -using localhost - and I get:

I think Julie is sure glad you didn't use her email address as well ;-)

> "failed to connect".
>
> I'm at a loss.

Others have already pointed out, only use localhost IF AND ONLY IF you have an 
SMTP server running on the same machine as your webserver.

Otherwise try using whatever SMTP server you're using to send mail from your 
mail client.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You can tell how far we have to go, when FORTRAN is the language of
supercomputers.
-- Steven Feiner
*/


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




Re: [PHP] Cookies help please

2002-12-06 Thread Jason Wong
On Friday 06 December 2002 20:22, Steve Vernon wrote:

> The code below keeps my sessions but the cookie bit dosent work.
>
> Thanks,
>
> Steve
> XX
>
>  /* Check a session is valid
>   */
>  function session_check($db_link)
>  {
>   //Ok so either want to log on, or have a session or cookie allready
>   if(isset($_SESSION['ssun']) || isset($_COKKIE["ssun"]) ||
-^

Shouldn't that be $_COOKIE??

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
A closed mouth gathers no foot.
*/


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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
Gentlemen,
Thank you for your assistance.

The PHP mail scripts were taken from Julie Meloni's book on PHP called "Fast
and East" on pp. 116-117. (PrimaTech).

In fact, she writes:

"If you're using PHP4 on Windows, look for the following lines in your
php.ini file:

[mail function]
SMTP =; for Win32 only
sendmail_from = ;for Win32 only

You'll need to modify the last two lines so that the mail function works
properly.

1. For the SMTP entry, use 'localhost" or the name of the outgoing
mailserver you use in your e-mail client.

2. For the sendmail_from entry, enter your e-mail address.

For example in my php.ini file on Windows contains this:

[mail function]
SMTP =localhost
sendmail_from = [EMAIL PROTECTED]

END QUOTE

So that's what I did -using localhost - and I get:

"failed to connect".

I'm at a loss.
Please help.
Thanks.
TR





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




RE: [PHP] Looping Addition

2002-12-06 Thread Ford, Mike [LSS]
- Original Message -
From: "Chris Wesley" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>

> On Wed, 4 Dec 2002, Stephen wrote:
> > This is only a snippet, there is more to it but for simplicities
sake...
> > Then I calculate it. My question is, how would I loop the adding? I
hope
you
> > understand this now...
>
> Ah!, I think I understand better now.  You want to add num1, num2,
num3,
> ... numN, which are inputs from the second form in your sequence.
Gotcha.
>
> If you name /all/ the form elements as "nums[]" instead of
individually as
> "num${current}", the numbers put into the form will all be accessible
in
> one array to the PHP script that does the adding.  Then you can just
loop
> over the array of numbers.
>
> In your second form, change this:
> "  size="25">"
>
> To this:
> "
>
> Then in the script that adds the numbers:
> $total = 0;
> foreach( $_POST['nums'] as $number ){
> $total += $number;
> }

Or even $total = array_sum($_POST['nums'])

Cheers!

Mike

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




RE: [PHP] Sigh :)

2002-12-06 Thread Ford, Mike [LSS]
OK, I think I've solved this, and you'll probably kick yourself when I explain it!"  
But first, a teaser:  what looks like a double-quote in HTML, but isn't?

>-Original Message-
>From: John Taylor-Johnston

> If I run the SQL in PHPMyAdmin, (a MySQL web interface), it works.
> 
> jdaxell.ccl = 2 records found.
> 
> SELECT id,AU,ST,BT,AT FROM ccl_main WHERE MATCH
> (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
> AGAINST ('"ready maria"' IN BOOLEAN MODE)
> ORDER BY id asc
> 
> But try to pass it through PHP - zippo. MySQL thinks it is a boolean
> search for
> +ready +maria
> not an exact search for the two words together
> 
> "ready maria"
> 
> MySQL does not see the double quotes. It should. Somehow, PHP is
> thwarting them?

Not PHP, your browser, I suspect.  In fact there are no quotes there!  No, donm't yell 
at me, there really aren't!!

Close inspection of the source of your "non-working" result reveals that what it has 
actually searched for is "ready maria" -- which, of course, displays on the 
screen as "ready maria", with the HTML " entities converted to double quotes!  Of 
course, as the $search variable actually contains the version with the " 
entities, this is what MySQL sees, and duly regards it as a non-quoted string 
contining the words quot, ready and maria, and a few non-significant punctuation marks!

What I think is happening is that your browser is encoding certain characters in the 
form field into HTML entities before submitting them -- so to get PHP to see them 
correctly, you're going to need to unencode any HTML-entities in the string in your 
$search variable.  I suggest a quick visit to the manual page for html_entity_decode 
(http://www.php.net/html-entity-decode) may be in order (this function is not 
available until PHP 4.3.0, but the manual page does give a pre-4.3.0 alternative).

(Of course, don't forget to keep the HTML-entities version for echoing back to your 
HTML results page!)

This was a neat one -- hope this analysis helps!

Cheers!

Mike

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




Re: [PHP] String to an Array

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 02:12, [EMAIL PROTECTED] wrote:
> Hello,
>
> "Rodrigo de Oliveira Costa" <[EMAIL PROTECTED]> wrote:
> > Hi guys, I got a string that I need to be transformed into na array of
> > characters, something like:
> >
> >
> > $str  ="im the one trying to do this";
> >
> > //this is the string
> >
> > I'd like to get an array that I can access something like $array[0] and
> > get the value " i ". And this foward. Anyone have any clues on this?
>
> You can actually treat $str "like" an array so
>
>   $str[0]
>
> would be "i".

This isn't officially endorsed anymore. You should use $str{0} instead.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
The new Congressmen say they're going to turn the government around.  I
hope I don't get run over again.
*/


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




Re: [PHP] Installation of PHP with gd support

2002-12-06 Thread Jason Wong
On Friday 06 December 2002 23:18, [EMAIL PROTECTED] wrote:
> Hi list,
>
> anybody here who knows a HowTo of installing PHP with gd support?

If gd libraries was installed in /usr/lib then use "--with-gd=/usr".

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
QOTD:
"I haven't come far enough, and don't call me baby."
*/


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




Re: [PHP] Updating int4 field with multiple values

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 00:56, Andre Dubuc wrote:
> I would like to update an int4 column with new values appended to the end
> (preferably with a delimiter such as @ or a comma).
>
> With PostgreSQl 7.2, I can't seem to add the number with a delimiter (it
> gives me a parser error at the delimiter). For example, If I update the
> field 'radd' that already has  number 36 in it, it does append the new
> number, but without any space. So, if I updated with a new number, 6, the
> 'radd' result would now be '366' instead of '36 6'
>
> Without the delimiter, it might be difficult to do selects on this field
> when I need to find a specific number within the field. (Btw, I'm using
> $_SESSION['rid'] . . . etc instead of $rid in the actual code.) Any ideas
> what I'm doing wrong?
>
> Any suggestions will be greatly appreciated.

Am I missing something or are you really trying to insert non-digits into an 
INTEGER field?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
A compliment is something like a kiss through a veil.
-- Victor Hugo
*/


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




Re: [PHP] $_FILES associative array

2002-12-06 Thread Jason Wong
On Saturday 07 December 2002 01:10, Tom Rogers wrote:
>
> If your input is like this:
>
> 
>
> The array you get would look like this:
>
> $_FILES['userfile']['name'] The original name of the file on the client
> machine.
>
> $_FILES['userfile']['type'] The mime type of the file, if the browser
> provided this information. An example would be "image/gif".
>
> $_FILES['userfile']['size'] The size, in bytes, of the uploaded file.
>
> $_FILES['userfile']['tmp_name'] The temporary filename of the file in which
> the uploaded file was stored on the server

Hmm, just print_r() the damn thing and see what it contains ;-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
In Nature there are neither rewards nor punishments, there are consequences.
-- R.G. Ingersoll
*/


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




Re: Re[2]: [PHP] Error GD

2002-12-06 Thread info
Thank u Tom

Oliver
  - Original Message - 
  From: Tom Rogers 
  To: Tom Rogers 
  Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  Sent: Friday, December 06, 2002 5:35 PM
  Subject: Re[2]: [PHP] Error GD


  Hi,

  Saturday, December 7, 2002, 2:31:09 AM, you wrote:
  TR> Hi,

  TR> Saturday, December 7, 2002, 1:41:22 AM, you wrote:
  ithc>> Hi Paul,

  ithc>> compiled PHP like that
  ithc>> ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion

  ithc>> Error Message:
  ithc>> In file included from gd.c:83:
  ithc>> gd_ctx.c: In function `_php_image_output_ctx':
  ithc>> gd_ctx.c:70: structure has no member named `free'
  ithc>> gd_ctx.c:98: structure has no member named `free'
  ithc>> gd.c: In function `_php_image_create_from':
  ithc>> gd.c:1176: structure has no member named `free'
  ithc>> make[3]: *** [gd.lo] Fehler 1

  TR> I think the function name got changed to gdFree(), I'll try to find more info if
  TR> I can

  TR> -- 
  TR> regards,
  TR> Tom


  I was close :) change the lines in the offending files to this:

  ctx->gd_free(ctx);

  That should fix it

  -- 
  regards,
  Tom


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




Re: [PHP] Installation of PHP with gd support

2002-12-06 Thread info
Hello Paul M,
yes I succeded with the following stable Version 4.3. Here is the link:
http://snaps.php.net/php4-STABLE-200212061430.tar.gz

Works fine!

Thank u
Oliver

  - Original Message - 
  From: Paul Marinas 
  To: [EMAIL PROTECTED] 
  Sent: Friday, December 06, 2002 5:57 PM
  Subject: Re: [PHP] Installation of PHP with gd support


  have u succeded ?

  Paul Marinas
  Technical Support
  RDS Craiova


  Phone:  +402-51-410-194
  Mobile: +407-22-451-439
  Fax:+402-51-416-579
  www.rdsnet.ro
  .

  Privileged/Confidential Information may be contained in this message. If you
  are not the addressee indicated in this
  message (or responsible for delivery of the message to such person), you may
  not copy or deliver this message to
  anyone. In such a case, you should destroy this message and kindly notify
  the sender by reply e-mail.

  On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:

  > Hi Paul,
  >
  > where can I get it?
  >
  >   - Original Message -
  >   From: Paul Marinas
  >   To: [EMAIL PROTECTED]
  >   Sent: Friday, December 06, 2002 5:23 PM
  >   Subject: Re: [PHP] Installation of PHP with gd support
  >
  >
  >   try php4-STABLE-200212061430.tar.gz, with gd 2.0.8 should work
  >
  >   Paul Marinas
  >   Technical Support
  >   RDS Craiova
  >
  >
  >   Phone:  +402-51-410-194
  >   Mobile: +407-22-451-439
  >   Fax:+402-51-416-579
  >   www.rdsnet.ro
  >   .
  >
  >   Privileged/Confidential Information may be contained in this message. If you
  >   are not the addressee indicated in this
  >   message (or responsible for delivery of the message to such person), you may
  >   not copy or deliver this message to
  >   anyone. In such a case, you should destroy this message and kindly notify
  >   the sender by reply e-mail.
  >
  >   On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:
  >
  >   > Hi Paul,
  >   >
  >   > compiled PHP like that
  >   > ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion
  >   >
  >   > Error Message:
  >   > In file included from gd.c:83:
  >   > gd_ctx.c: In function `_php_image_output_ctx':
  >   > gd_ctx.c:70: structure has no member named `free'
  >   > gd_ctx.c:98: structure has no member named `free'
  >   > gd.c: In function `_php_image_create_from':
  >   > gd.c:1176: structure has no member named `free'
  >   > make[3]: *** [gd.lo] Fehler 1
  >   >   - Original Message -
  >   >   From: Paul Marinas
  >   >   To: [EMAIL PROTECTED]
  >   >   Sent: Friday, December 06, 2002 4:33 PM
  >   >   Subject: Re: [PHP] Installation of PHP with gd support
  >   >
  >   >
  >   >   what error do you get ?
  >   >
  >   >   Paul Marinas
  >   >   Technical Support
  >   >   RDS Craiova
  >   >
  >   >
  >   >   Phone:  +402-51-410-194
  >   >   Mobile: +407-22-451-439
  >   >   Fax:+402-51-416-579
  >   >   www.rdsnet.ro
  >   >   .
  >   >
  >   >   Privileged/Confidential Information may be contained in this message. If you
  >   >   are not the addressee indicated in this
  >   >   message (or responsible for delivery of the message to such person), you may
  >   >   not copy or deliver this message to
  >   >   anyone. In such a case, you should destroy this message and kindly notify
  >   >   the sender by reply e-mail.
  >   >
  >   >   On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:
  >   >
  >   >   > Oh mann
  >   >   >   - Original Message -
  >   >   >   From: Paul Marinas
  >   >   >   To: [EMAIL PROTECTED]
  >   >   >   Sent: Friday, December 06, 2002 4:29 PM
  >   >   >   Subject: Re: [PHP] Installation of PHP with gd support
  >   >   >
  >   >   >
  >   >   >   on my computer, why ?
  >   >   >
  >   >   >
  >   >   >   Paul Marinas
  >   >   >   Technical Support
  >   >   >   RDS Craiova
  >   >   >
  >   >   >
  >   >   >   Phone:  +402-51-410-194
  >   >   >   Mobile: +407-22-451-439
  >   >   >   Fax:+402-51-416-579
  >   >   >   www.rdsnet.ro
  >   >   >   .
  >   >   >
  >   >   >   Privileged/Confidential Information may be contained in this message. If 
you
  >   >   >   are not the addressee indicated in this
  >   >   >   message (or responsible for delivery of the message to such person), you 
may
  >   >   >   not copy or deliver this message to
  >   >   >   anyone. In such a case, you should destroy this message and kindly notify
  >   >   >   the sender by reply e-mail.
  >   >   >
  >   >   >   On Fri, 6 Dec 2002 [EMAIL PROTECTED] wrote:
  >   >   >
  >   >   >   > where?
  >   >   >   >   - Original Message -
  >   >   >   >   From: Paul Marinas
  >   >   >   >   To: [EMAIL PROTECTED]
  >   >   >   >   Sent: Friday, December 06, 2002 4:24 PM
  >   >   >   >   Subject: Re: [PHP] Installation of PHP with g

Re: [PHP] String to an Array

2002-12-06 Thread @ Edwin
Hello,

"Rodrigo de Oliveira Costa" <[EMAIL PROTECTED]> wrote:

> Hi guys, I got a string that I need to be transformed into na array of
> characters, something like:
>  
>  
> $str  ="im the one trying to do this";
>  
> //this is the string
>  
> I'd like to get an array that I can access something like $array[0] and
> get the value " i ". And this foward. Anyone have any clues on this?

You can actually treat $str "like" an array so

  $str[0]

would be "i".

If you're after something else, check the archives for more info:

  http://marc.theaimsgroup.com/?t=100526380400016&r=1&w=2

- E

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




Re: [PHP] String to an Array

2002-12-06 Thread Matt Vos
A string is an array of characters.
In your example, $str[4] == "h".

Matt
- Original Message - 
From: Rodrigo de Oliveira Costa <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 1:50 PM
Subject: [PHP] String to an Array


> Hi guys, I got a string that I need to be transformed into na array of
> characters, something like:
>  
>  
> $str  ="im the one trying to do this";
>  
> //this is the string
>  
> I'd like to get an array that I can access something like $array[0] and
> get the value " i ". And this foward. Anyone have any clues on this?
>  
> Thanks,
> Rodrigo
>  
> 


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




[PHP] Question about displaying directories and files

2002-12-06 Thread
 Hi. I have studied the manual, and have scripts that indivudually display a directory 
(or list of them) and a script that displays scripts in a folder However, I am curious 
as to how to take all folders in /members directory (It will grow over time, now I 
have 3) and no matter how many folders are there (each with a zip and gzip file)I want 
it to display all folders and files inside it on one page Such as, a dynamic way to do 
this:Directory Azip | gzip Directory Bzip | gzip ... So if there are 10 directories, 
you see 10 listings like that. If 4, 4 listings and so on. I go to the manual, but 
can't figure out how to do this *dynamically* what would I physically have to do to 
make sure a list of directories in my 'list director' script includes the spitout of 
files and then link to them?

___
Join Excite! - http://www.excite.com
The most personalized portal on the Web!



[PHP] String to an Array

2002-12-06 Thread Rodrigo de Oliveira Costa
Hi guys, I got a string that I need to be transformed into na array of
characters, something like:
 
 
$str  ="im the one trying to do this";
 
//this is the string
 
I'd like to get an array that I can access something like $array[0] and
get the value " i ". And this foward. Anyone have any clues on this?
 
Thanks,
Rodrigo
 



Re: [PHP] Where can I find a new HowTo of compiling php with gd support???

2002-12-06 Thread @ Edwin
Did you try Google?

  Keyword: "compiling php with gd support"

<[EMAIL PROTECTED]> wrote:
> Hi folks,
> 
> a single and simple question :
> 
> Where can I find a  new HowTo of compiling php with gd support???
> 
> Incl Bugtraps?
> 
> Oliver Etzel

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




Re: [PHP] mail() problems...

2002-12-06 Thread DL Neil
Anthony,

> I'm not sure I understand.

=that makes one more! This feature is a bit of a minefield - but once you
get a handle on it, its too useful to be without...


> I had this working a few months ago by changing the php.ini settings to:
> SMTP   = localhost   ;for win32 only
> sendmail_from = [EMAIL PROTECTED] ;for win32 only
> and I was able to run that script on my box and get an e-mail returned to
> me.
> Now, I getting a "failed to connect".
> I'm using MS OE5.

=this can only work if:
a) there is an SMTP server on the localhost (and the DNS finds it), or
b) the code wrapped around mail() specifies a valid and reachable SMTP
server, or
c) the code sidesteps the PHP mail facility completely by doing something
else, or
d) its not a Win box (and needs a completely different approach)

=if it was working, it was working; I'm not sure what has been
updated/replaced since - but let's not even go down that track.

=I assume that the Win98 machine has outbound email working from some MTA,
eg Outlook [Express]. Check its definition for an SMTP server. Cut-and-paste
from there into PHP.INI.

=also (because I'm a simple boy), forget all the optional headers etc, just
use a stripped down/simple email stub-script for testing/proving.

=If PHP's mail() can be persuaded to work, thereafter it (and any scripts)
can be 'tweaked'/made better - or we can look back and compare...

=dn


> - Original Message -
> From: "DL Neil" <[EMAIL PROTECTED]>
> To: "Anthony Ritter" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Friday, December 06, 2002 10:37 AM
> Subject: Re: [PHP] mail() problems...
>
>
> > Anthony,
> >
> > Do you have an SMTP server on your Win98 localhost?
> > Recommend you change the PHP.INI SMTP= to say the same as your email
> > package's server definitions.
> >
> > =dn
> >
> >
> >
> > > I'm using MS Win98 and Apache and getting the following after
submitting
> > the
> > > mail form:
> > > ..
> > > Warning: Failed to Connect in c:\program files\apache
> > > group\apache\htdocs\send_simpleform.php on line 14
> > > 
> > >
> > > The html and php scripts follow along with my php.ini settings.
> > >
> > > Any help would be appreciated.
> > >
> > > Thank you.
> > > Tony Ritter
> > >
> > > The following e-mail has been sent:
> > > Your Name:
> > > Linda
> > >
> > > Your E-Mail Address:
> > > [EMAIL PROTECTED]
> > >
> > > Message:
> > > Test
> > > .
> > >
> > >
> > > //this is the html form
> > >
> > > 
> > > 
> > > Simple Feedback Form
> > > 
> > > 
> > >
> > > 
> > >
> > >
> > > Your Name:
> > > 
> > >
> > > Your E-Mail Address:
> > > 
> > >
> > > Message:
> > > 
> > >
> > > 
> > >
> > > 
> > >
> > > 
> > > 
> > > ..
> > > //this is the php script
> > >  > > if (($sender_name == "") && ($sender_email == "") && ($message == ""))
{
> > >  header("Location: http://localhost/simple_form.html";);
> > >  exit;
> > > }
> > > $msg = "E-MAIL SENT FROM WWW SITE\n";
> > > $msg .= "Sender's Name:$sender_name\n";
> > > $msg .= "Sender's E-Mail:  $sender_email\n";
> > > $msg .= "Message:  $message\n\n";
> > > $to = "[EMAIL PROTECTED]";
> > > $subject = "Web Site Feedback";
> > > $mailheaders = "From: My Web Site <> \n";
> > > $mailheaders .= "Reply-To: $sender_email\n\n";
> > > mail($to, $subject, $msg, $mailheaders);
> > > ?>
> > > 
> > > 
> > > Simple Feedback Form Sent
> > > 
> > > 
> > > The following e-mail has been sent:
> > > Your Name:
> > > 
> > > Your E-Mail Address:
> > > 
> > > Message:
> > > 
> > > 
> > > 
> > > 
> > > My php.ini settings are:
> > >
> > > [mail function]
> > > SMTP   = localhost   ;for win32 only
> > > sendmail_from = [EMAIL PROTECTED] ;for win32 only
> > > ;sendmail_path =  ;for unix only,
> > > may supply arguments as well (default is sendmail -t)
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> > ---
> > [This E-mail scanned for viruses by gonefishingguideservice.com]
> >
> >
>
> ---
> [This E-mail scanned for viruses by gonefishingguideservice.com]
>
>


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




Re: [PHP] mail() problems...

2002-12-06 Thread @ Edwin
Hello,

"Anthony Ritter" <[EMAIL PROTECTED]> wrote:

> DL,
> I'm not sure I understand.

Let me try :)

> I had this working a few months ago by changing the php.ini settings to:
>
> SMTP   = localhost   ;for win32 only
> sendmail_from = [EMAIL PROTECTED] ;for win32 only
>
> and I was able to run that script on my box and get an e-mail returned to
> me.
>
> Now, I getting a "failed to connect".

Strange... (I mean it's strange that it worked before. I don't think that
setting would work unless you have your own mail server in your pc.)

> Please advise.

I think what DL meant was to change "localhost" to

  (Ex.)  smtp.yourdomain.com

> I'm using MS OE5.

In that case you'll find that info by clicking Tools -> Account -> Mail ->
Property then click "Server" and check under SMTP.

HTH,

- E

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




Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread @ Edwin
Oops...

<[EMAIL PROTECTED]> wrote:
> success. And I have read through the user contributed notes and havent'
> found it there.

Sorry 'bout the link earlier. (You could find some hints under file()
though...)

- E

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




Re: [PHP] More $_ array question...

2002-12-06 Thread Tim Ward
not quite ... 
if the form elements are (e.g) , etc.
then you need $_POST["array"][0] to refer to the element
(just like any other array of arrays in PHP).

but you're right about count($_POST["array"]) ...
and foreach ($_POST["array"] as $key=>$value), etc.

Tim Ward
http://www.chessish.com
mailto:[EMAIL PROTECTED]
- Original Message - 
From: Mako Shark <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 5:03 PM
Subject: [PHP] More $_ array question...


> If I want to access an array of something from a form,
> is it true that I just have to use
> $_POST["array[$counter"]? So I can legitimately do a
> count() of this array, like count($_POST["array"])?
> 
> __
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> -- 
> 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] mail() problems...

2002-12-06 Thread Anthony Ritter
DL,
I'm not sure I understand.

I had this working a few months ago by changing the php.ini settings to:

SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only

and I was able to run that script on my box and get an e-mail returned to
me.

Now, I getting a "failed to connect".

Please advise.

I'm using MS OE5.

Thank you.
TR
..


- Original Message -
From: "DL Neil" <[EMAIL PROTECTED]>
To: "Anthony Ritter" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 10:37 AM
Subject: Re: [PHP] mail() problems...


> Anthony,
>
> Do you have an SMTP server on your Win98 localhost?
> Recommend you change the PHP.INI SMTP= to say the same as your email
> package's server definitions.
>
> =dn
>
>
>
> > I'm using MS Win98 and Apache and getting the following after submitting
> the
> > mail form:
> > ..
> > Warning: Failed to Connect in c:\program files\apache
> > group\apache\htdocs\send_simpleform.php on line 14
> > 
> >
> > The html and php scripts follow along with my php.ini settings.
> >
> > Any help would be appreciated.
> >
> > Thank you.
> > Tony Ritter
> >
> > The following e-mail has been sent:
> > Your Name:
> > Linda
> >
> > Your E-Mail Address:
> > [EMAIL PROTECTED]
> >
> > Message:
> > Test
> > .
> >
> >
> > //this is the html form
> >
> > 
> > 
> > Simple Feedback Form
> > 
> > 
> >
> > 
> >
> >
> > Your Name:
> > 
> >
> > Your E-Mail Address:
> > 
> >
> > Message:
> > 
> >
> > 
> >
> > 
> >
> > 
> > 
> > ..
> > //this is the php script
> >  > if (($sender_name == "") && ($sender_email == "") && ($message == "")) {
> >  header("Location: http://localhost/simple_form.html";);
> >  exit;
> > }
> > $msg = "E-MAIL SENT FROM WWW SITE\n";
> > $msg .= "Sender's Name:$sender_name\n";
> > $msg .= "Sender's E-Mail:  $sender_email\n";
> > $msg .= "Message:  $message\n\n";
> > $to = "[EMAIL PROTECTED]";
> > $subject = "Web Site Feedback";
> > $mailheaders = "From: My Web Site <> \n";
> > $mailheaders .= "Reply-To: $sender_email\n\n";
> > mail($to, $subject, $msg, $mailheaders);
> > ?>
> > 
> > 
> > Simple Feedback Form Sent
> > 
> > 
> > The following e-mail has been sent:
> > Your Name:
> > 
> > Your E-Mail Address:
> > 
> > Message:
> > 
> > 
> > 
> > 
> > My php.ini settings are:
> >
> > [mail function]
> > SMTP   = localhost   ;for win32 only
> > sendmail_from = [EMAIL PROTECTED] ;for win32 only
> > ;sendmail_path =  ;for unix only,
> > may supply arguments as well (default is sendmail -t)
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> ---
> [This E-mail scanned for viruses by gonefishingguideservice.com]
>
>

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


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




Re: [PHP] $_FILES associative array

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 2:56:53 AM, you wrote:
MS> I'm trying to find some documentation on the $_FILES
MS> array, but on PHP, it's a little confusing. I read the
MS> documentation and the comment from rep_spam@..., but
MS> that wasn't too clear to me either.

MS> I'm aware that when uploading a file named
MS> $uploadedfile, the size, name, etc. get stored in
MS> variables called $uploadedfile_size, _name,  But
MS> when using the $_FILES array, does everything then get
MS> stored in $_FILES["uploadedfile"],
MS> $_FILES["uploadedfile_size"], etc...?

If your input is like this:



The array you get would look like this:

$_FILES['userfile']['name'] The original name of the file on the client machine. 

$_FILES['userfile']['type'] The mime type of the file, if the browser provided this 
information. An example would be "image/gif". 

$_FILES['userfile']['size'] The size, in bytes, of the uploaded file. 

$_FILES['userfile']['tmp_name'] The temporary filename of the file in which the 
uploaded file was stored on the server


-- 
regards,
Tom


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




[PHP] More $_ array question...

2002-12-06 Thread Mako Shark
If I want to access an array of something from a form,
is it true that I just have to use
$_POST["array[$counter"]? So I can legitimately do a
count() of this array, like count($_POST["array"])?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] $_FILES associative array

2002-12-06 Thread Mako Shark
I'm trying to find some documentation on the $_FILES
array, but on PHP, it's a little confusing. I read the
documentation and the comment from rep_spam@..., but
that wasn't too clear to me either.

I'm aware that when uploading a file named
$uploadedfile, the size, name, etc. get stored in
variables called $uploadedfile_size, _name,  But
when using the $_FILES array, does everything then get
stored in $_FILES["uploadedfile"],
$_FILES["uploadedfile_size"], etc...?

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Updating int4 field with multiple values

2002-12-06 Thread Andre Dubuc
I would like to update an int4 column with new values appended to the end 
(preferably with a delimiter such as @ or a comma). 

With PostgreSQl 7.2, I can't seem to add the number with a delimiter (it 
gives me a parser error at the delimiter). For example, If I update the field 
'radd' that already has  number 36 in it, it does append the new number, but 
without any space. So, if I updated with a new number, 6, the 'radd' result 
would now be '366' instead of '36 6'

Without the delimiter, it might be difficult to do selects on this field when 
I need to find a specific number within the field. (Btw, I'm using 
$_SESSION['rid'] . . . etc instead of $rid in the actual code.) Any ideas 
what I'm doing wrong?

Any suggestions will be greatly appreciated.

**

Simplified code:




Tia,
Andre

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




Re: [PHP] Unsubscribing

2002-12-06 Thread Chris Shiflett
--- "Van Andel, Robert" <[EMAIL PROTECTED]> wrote:
> Anyone know how to unsubscribe from this list. I have
> tried several different things including the unscribe
> field on the mailing list page and an unsubscribe command
> via email.

The unsubscribe page (http://www.php.net/unsub.php) should
work. Are you sure you are trying to unsubscribe the
correct email address?

Chris

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




Re: [PHP] mail() problems...

2002-12-06 Thread DL Neil
Anthony,

Do you have an SMTP server on your Win98 localhost?
Recommend you change the PHP.INI SMTP= to say the same as your email
package's server definitions.

=dn



> I'm using MS Win98 and Apache and getting the following after submitting
the
> mail form:
> ..
> Warning: Failed to Connect in c:\program files\apache
> group\apache\htdocs\send_simpleform.php on line 14
> 
>
> The html and php scripts follow along with my php.ini settings.
>
> Any help would be appreciated.
>
> Thank you.
> Tony Ritter
>
> The following e-mail has been sent:
> Your Name:
> Linda
>
> Your E-Mail Address:
> [EMAIL PROTECTED]
>
> Message:
> Test
> .
>
>
> //this is the html form
>
> 
> 
> Simple Feedback Form
> 
> 
>
> 
>
>
> Your Name:
> 
>
> Your E-Mail Address:
> 
>
> Message:
> 
>
> 
>
> 
>
> 
> 
> ..
> //this is the php script
>  if (($sender_name == "") && ($sender_email == "") && ($message == "")) {
>  header("Location: http://localhost/simple_form.html";);
>  exit;
> }
> $msg = "E-MAIL SENT FROM WWW SITE\n";
> $msg .= "Sender's Name:$sender_name\n";
> $msg .= "Sender's E-Mail:  $sender_email\n";
> $msg .= "Message:  $message\n\n";
> $to = "[EMAIL PROTECTED]";
> $subject = "Web Site Feedback";
> $mailheaders = "From: My Web Site <> \n";
> $mailheaders .= "Reply-To: $sender_email\n\n";
> mail($to, $subject, $msg, $mailheaders);
> ?>
> 
> 
> Simple Feedback Form Sent
> 
> 
> The following e-mail has been sent:
> Your Name:
> 
> Your E-Mail Address:
> 
> Message:
> 
> 
> 
> 
> My php.ini settings are:
>
> [mail function]
> SMTP   = localhost   ;for win32 only
> sendmail_from = [EMAIL PROTECTED] ;for win32 only
> ;sendmail_path =  ;for unix only,
> may supply arguments as well (default is sendmail -t)
>
>
>
>
>
> --
> 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[2]: [PHP] Error GD

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 2:31:09 AM, you wrote:
TR> Hi,

TR> Saturday, December 7, 2002, 1:41:22 AM, you wrote:
ithc>> Hi Paul,

ithc>> compiled PHP like that
ithc>> ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion

ithc>> Error Message:
ithc>> In file included from gd.c:83:
ithc>> gd_ctx.c: In function `_php_image_output_ctx':
ithc>> gd_ctx.c:70: structure has no member named `free'
ithc>> gd_ctx.c:98: structure has no member named `free'
ithc>> gd.c: In function `_php_image_create_from':
ithc>> gd.c:1176: structure has no member named `free'
ithc>> make[3]: *** [gd.lo] Fehler 1

TR> I think the function name got changed to gdFree(), I'll try to find more info if
TR> I can

TR> -- 
TR> regards,
TR> Tom


I was close :) change the lines in the offending files to this:

ctx->gd_free(ctx);

That should fix it

-- 
regards,
Tom


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




Re: [PHP] Error GD

2002-12-06 Thread Tom Rogers
Hi,

Saturday, December 7, 2002, 1:41:22 AM, you wrote:
ithc> Hi Paul,

ithc> compiled PHP like that
ithc> ./configure --with-config-file-path=/etc --enable-force-cgi-redirect 
--with-mysql -with-gd=/usr/local/gd2 --no-create --no-recursion

ithc> Error Message:
ithc> In file included from gd.c:83:
ithc> gd_ctx.c: In function `_php_image_output_ctx':
ithc> gd_ctx.c:70: structure has no member named `free'
ithc> gd_ctx.c:98: structure has no member named `free'
ithc> gd.c: In function `_php_image_create_from':
ithc> gd.c:1176: structure has no member named `free'
ithc> make[3]: *** [gd.lo] Fehler 1

I think the function name got changed to gdFree(), I'll try to find more info if
I can

-- 
regards,
Tom


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




[PHP] Unsubscribing

2002-12-06 Thread Van Andel, Robert
Anyone know how to unsubscribe from this list.  I have tried several different things 
including the unscribe field on the mailing list page and an unsubscribe command via 
email.

Robbert van Andel 





Re: [PHP] PHP adding slash to MySql results

2002-12-06 Thread Kevin Lowe
Hi Marek,

That is switched off. However, I was just having another look at the
problem, and, it actually appears to be fixed! I didnt shange anything, so
the ISP must have done something?

Thanks,
Kevin


Marek Kilimajer <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You ISP turned magic_quotes_runtime on, use set_magic_quotes_runtime()
> to override it.




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




[PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
I'm using MS Win98 and Apache and getting the following after submitting the
mail form:
..
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14


The html and php scripts follow along with my php.ini settings.

Any help would be appreciated.

Thank you.
Tony Ritter

The following e-mail has been sent:
Your Name:
Linda

Your E-Mail Address:
[EMAIL PROTECTED]

Message:
Test
.


//this is the html form



Simple Feedback Form






Your Name:


Your E-Mail Address:


Message:








..
//this is the php script
http://localhost/simple_form.html";);
 exit;
}
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Sender's Name:$sender_name\n";
$msg .= "Sender's E-Mail:  $sender_email\n";
$msg .= "Message:  $message\n\n";
$to = "[EMAIL PROTECTED]";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $sender_email\n\n";
mail($to, $subject, $msg, $mailheaders);
?>


Simple Feedback Form Sent


The following e-mail has been sent:
Your Name:

Your E-Mail Address:

Message:




My php.ini settings are:

[mail function]
SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path =  ;for unix only,
may supply arguments as well (default is sendmail -t)





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




  1   2   >