[PHP] Using fsockopen

2002-07-04 Thread ER Lees

Help

I'm a newbie to indepth PHP.

I want to issue an fsockopen command to pass a POST data set to a remote server script.

I understand the pricipals behind fsockopen, but I cannot figure out the string I need 
to pass to POST the data - I will be emulating the output from a  element.

In addition, how do I detect a successful operation? before closing the socket?.

Any help greatfully received.

thks

Richard


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




Re: [PHP] Re: PHP: Script Security: Best coding practices

2002-07-04 Thread Jean-Christian Imbeault

Sp wrote:

> I thought it was a good site.  I was reading up on the security bugs found
> and now I know what not to do.


True. It's just too specific. In order for me to figure out what to do I 
need to read every advisory to see what it is about and how to prevent 
against that particular problem.

If you have the time it is probably worth reading most of those 
advisories. But a general list of Do's and Don't would be more handy :)

Jc


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




[PHP] Help!

2002-07-04 Thread John Lazos

Hi, I installed apache with support of php as i found on the online 
manual at php.net.
I created a simple php file named hello.php



PHP Test Page


"; ?>





and i put the file in my htdocs directory i restarted apache and when 
i'm trying to access the page http://localhost/hello.php as a result i'm 
getting the contents of the file hello.,php
which are:


PHP Test Page


"; ?>




What is wrong is my apache able to display php pages?

Thanx for your time!



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




Re: [PHP] Help!

2002-07-04 Thread Alberto Serra

John Lazos wrote:

> and i put the file in my htdocs directory i restarted apache and when 
> i'm trying to access the page http://localhost/hello.php as a result i'm 
> getting the contents of the file hello.,php


> What is wrong is my apache able to display php pages?

Looks like Apache does not know about PHP :) in your 
/usr/local/apache/conf/httpd.conf file (or another path, if you have set 
another prefix while compiling the tarball) you seem to miss this:

 AddType application/x-httpd-php .php
 AddType application/x-httpd-php .phtml
 AddType application/x-httpd-php .php3
 AddType application/x-httpd-php-source .phps

have fun :))
Alberto
Kiev



-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Thanx!!!

2002-07-04 Thread John Lazos

Thanx all for your help it worked..!!! :)


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




Re: [PHP] Help!

2002-07-04 Thread Alberto Serra

> John Lazos wrote:
> 
>> and i put the file in my htdocs directory i restarted apache and when 
>> i'm trying to access the page http://localhost/hello.php as a result 
>> i'm getting the contents of the file hello.,php
> 
> 
> 
>> What is wrong is my apache able to display php pages?
> 
> 
> Looks like Apache does not know about PHP :) in your 
> /usr/local/apache/conf/httpd.conf file (or another path, if you have set 
> another prefix while compiling the tarball) you seem to miss this:
> 
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php .phtml
> AddType application/x-httpd-php .php3
> AddType application/x-httpd-php-source .phps
> 

I almost forgot. Also check the module list. It should be
something like this (but you might have much less modules
installed then I do, anyway, just make sure that after
deleting those you don't have the LoadModule and AddModule
order do match with the example. Apache gets quite nervous
if you give it some other module order)

LoadModule agent_log_module   libexec/mod_log_agent.so
LoadModule referer_log_module libexec/mod_log_referer.so
LoadModule mime_magic_module  libexec/mod_mime_magic.so
LoadModule status_module  libexec/mod_status.so
LoadModule info_modulelibexec/mod_info.so
LoadModule speling_module libexec/mod_speling.so
LoadModule rewrite_module libexec/mod_rewrite.so
LoadModule proxy_module   libexec/libproxy.so
LoadModule expires_module libexec/mod_expires.so
LoadModule usertrack_module   libexec/mod_usertrack.so
LoadModule unique_id_module   libexec/mod_unique_id.so
LoadModule php4_modulelibexec/libphp4.so

LoadModule ssl_module libexec/libssl.so



#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_log_agent.c
AddModule mod_log_referer.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_proxy.c
AddModule mod_expires.c
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c

AddModule mod_ssl.c

AddModule mod_php4.c


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




RE: [PHP] Re: Weird preg problem

2002-07-04 Thread SP

A that's what that means.  Thanks Tracker

-Original Message-
From: Tracker 1 [mailto:[EMAIL PROTECTED]]
Sent: July 4, 2002 3:00 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Weird preg problem


the /i means case insensitive, remove the i, and it will work as intended.

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/


"Sp" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi I am trying to check if a word contains only capital letters.  For some
> reason it's not working.  The below example is checking the word "weird"
to
> see if it's all capital letters but it's saying it's matches.  I've tried
> checking for only lower case letters with "WEIRD" and it's not working
there
> too.  What am I doing wrong?
>
>
> $pattern = "A-Z";
> $regexp = '/^['.$pattern.']*$/i';
> if( preg_match($regexp, "weird") )
> echo "matches";
> else
> echo "does not match";
>
>



--
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] How to pass unknown number of variables to a function?

2002-07-04 Thread Uwe Birkenhain

Hi everybody on this rainy morning!

My problem:
I give the user a form with a list of options with checkboxes.
The list is long and not predictable - the values change always.
I want to put the checked values (or all, that doesn't matter) in an array,
to pass it to my function.

How can I write those keys and values in an array?

I suppose it will be best done with JS - but since I don't know JS ...
Has anybody a ready solution?

Thank's a lot!

Uwe



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




Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Jason Wong

On Thursday 04 July 2002 16:52, Uwe Birkenhain wrote:
> Hi everybody on this rainy morning!
>
> My problem:
> I give the user a form with a list of options with checkboxes.
> The list is long and not predictable - the values change always.
> I want to put the checked values (or all, that doesn't matter) in an array,
> to pass it to my function.
>
> How can I write those keys and values in an array?
>
> I suppose it will be best done with JS - but since I don't know JS ...
> Has anybody a ready solution?

Search archives for "checkbox array"

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

/*
For your penance, say five Hail Marys and one loud BLAH!
*/


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




Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Alberto Serra

Uwe Birkenhain wrote:
> Hi everybody on this rainy morning!

Rainy!? It's damn hot in Kiev :)

> My problem:
> I give the user a form with a list of options with checkboxes.
> The list is long and not predictable - the values change always.
> I want to put the checked values (or all, that doesn't matter) in an array,
> to pass it to my function.
> 
> How can I write those keys and values in an array?
> 

Suppose you have a number of checkboxes. First, you name them 
sequentially (like "active_0,active_1 and so on) and you assign it your 
value. Then you process posted data like this. BEWARE! you need at least 
an array of hidden variables to know exactly how many checkboxes you 
must process. Then you just rebuild it the structure and pass it thru.

   # put the received input into an ordered structure
   ##
   $count = 0;
   while ( isset($id[$count]) ) {

 # Build variable names;
 ###
 $w_active   = "active_".$count;

 # get actual form values
 
 $active[$count]   = $$w_active;

 $count++;
   }

Hope it solves the problem. I've been using this for ages and it never 
gave me problems.

Alberto
Kiev

-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Nothing will execute after calling imagejpeg.

2002-07-04 Thread Victor Spång Arthursson

This thread has been up before, but there was never sent a reply to it, 
and I'm having the same problem…

Anyone who knows what to do?

Sincerely

Victor

> -Original Message-
> From: Kris Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 01, 2002 11:11 PM
> To: Leotta, Natalie (NCI/IMS)
> Subject: Nothing will execute after calling imagejpeg.
>
>
> Hello, My name is Kris Johnson. I 'm hoping you can give me some 
> direction
> on a problem I am having.
>
> After calling imagejpeg nothing else will work. I have tried echoing 
> html,
> echoing just a word in quotes, as well as a using a location header. I 
> do
> not get any errors or warnings, but whatever command I use simply 
> doesn't
> work. As a test I remarked imagejpeg out of the code and as soon as I 
> did
> this the commands after worked fine. I tried changing the filetype to 
> png
> but still get the same problem.
>
> Have a nice day
> Kris
>
>
> --
> 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] extension problem

2002-07-04 Thread adelpfephp

hi
I have an extension problem.
i have wrote this exemple
#include...
char* xx(){

return "true";


}
it's a simple example.
I have compiled it into .SO dynamic library.
when I try to load it into PHP i get this message
cannot include .(may be not php extension).
CAN YOU HELP ME PLEASE.





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




[PHP] Picture Cache

2002-07-04 Thread Steve Vernon

Hello,
At the moment I have a PHP script which accesses a database, to
get the data to return a picture. So the follwing url is actually a
picture of type image/jpeg:

getdata.php?id=6

So I can use:



Thats great and it works fine, but I feel that it does not cache
the picture in the web browser? I don't know how the cache works but my
friend says it asks the server for the data the file was generated and
the size, so I suppose with this is dosent?

Help!

Thanks,

Steve


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




[PHP] mysql/php how to retrieve the right column with 2 columns of the same name

2002-07-04 Thread Wilbert Enserink

Hi all,


I have to tables A and B.
They boyh have a column with the same name.

Now, I wrote this MySQL statement performing a left join.
This results in a data set with rows consisting of 2 columns of the same name, in 
which the date is stored when the record was last altered. This column is called 
"last_altered".

Later on in my script I'm calling the value of this column with php.
$query="select * from tblA LEFT JOIN ";
$resultID=mysql_query($query);
while ($result_row=mysql_fetch_array($resultID))
{
echo "$result_row[column with the same name]";
}

Well, this works without any php or mysql errors, but it is giving me the data back of 
that column wich I don't wanna have...It returns the "last_altered" date of tblB in 
stead of tblA.
A solution might be te exclude the second column (the wrong one) from the select 
statement in the query. This is a MySQL adjustement. Anybody knows how this can be 
done?? 

Maybe there are also PHP solutions which I don't know of...?

thx 

Wilbert Enserink

-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


Re: [PHP] Re: Program executing in PHP. Please help (SOLVED)

2002-07-04 Thread Latex Master

Hello Richard, PHP,
  Well I did a typo here. Sorry about it. At that moment i was
really nuts, and needed a rest. Now I solved that problem, but only
after UPDATING PHP from 4.0.6 to 4.2.1 And shell_exec worked. Exec
didn't :( I'm going to investigate this question in the future.

Thank's for the help.  And as usual if anyone will need it. Here is a
working script:

";
$output = shell_exec('uudeview -i /bla/bla.txt -p /bla/bla/');
echo "";
echo ($kick_my_ass);
echo "";
?>

Thursday, July 4, 2002, 12:48:13 AM, you wrote:

>>>$output = shell_exec("uudeview -i /bla/bla.txt -p /bla/bla/");
>>echo "";
>>echo $kick_my_ass;
>>echo "";
>>?>
>> And I get nothing :(. Script like below:

RL> Well, no...

RL> Your data is in $output, and you are echo-ing out $kick_my_ass...  Try echo
RL> $output

>>>$output = shell_exec("uudeview");
>>echo "";
>>echo $kick_my_ass;
>>echo "";
>>?>
>>  Work fine outputting me command line parameters.
>>
>>  What have I done wrong?

RL> It's also possible that you just made a typo here, but the real code has the
RL> right variables...

RL> In that case, try this:

RL> $command = "uudeview -i /bal/bal.txt -p /bla/la";
RL> exec($command, $results, $errorcode);
RL> echo implode("\n", $results);
RL> if ($errorcode){
RL>   echo "OS Error: $errorcode.  Use 'man errno' to look it up, but it's
RL> probably path/permissions.\n");
RL> }

RL> -- 
RL> Like Music?  http://l-i-e.com/artists.htm





-- 
Best regards,
 Latexmailto:[EMAIL PROTECTED]


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




[PHP] loop problem

2002-07-04 Thread Emmanuel FAIVRE

Hi All,

I'm currently working with a friends that want to use irc protocol at
his work cause there is only http proxy.

so it is very easy, i found phpIRC and everything works fine...He is
very happy

i've just seen that some process are always connected. this is really
weird. so i started to watch that on details and it seems that the
loop which dispatch messages don't stop when Apache client is away

Am i wrong ?

To sum up, i have a PHP script that loop and send messages to client
but when client go away script continue to run.

did i see some ghost that does not exist ?

Thanks for your answer

Manu


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




Re: [PHP] mysql/php how to retrieve the right column with 2 columns of the same name

2002-07-04 Thread Jason Wong

On Thursday 04 July 2002 17:23, Wilbert Enserink wrote:
> Hi all,
>
>
> I have to tables A and B.
> They boyh have a column with the same name.
>
> Now, I wrote this MySQL statement performing a left join.
> This results in a data set with rows consisting of 2 columns of the same
> name, in which the date is stored when the record was last altered. This
> column is called "last_altered".
>
> Later on in my script I'm calling the value of this column with php.
> $query="select * from tblA LEFT JOIN ";
> $resultID=mysql_query($query);
> while ($result_row=mysql_fetch_array($resultID))
> {
> echo "$result_row[column with the same name]";
> }
>
> Well, this works without any php or mysql errors, but it is giving me the
> data back of that column wich I don't wanna have...It returns the
> "last_altered" date of tblB in stead of tblA. A solution might be te
> exclude the second column (the wrong one) from the select statement in the
> query. This is a MySQL adjustement. Anybody knows how this can be done??

Try to limit your select statement, instead of SELECT *, use 

SELECT colA, 
   colB, 
   tablA.samenamecolA,
   tablB.samenamecolA, etc

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

/*
Love is the process of my leading you gently back to yourself.
-- Saint Exupery
*/


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




RE: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Rudolf Visagie

Hi Uwe,

If you define the checkbox list as an array (OptionList[] in the example
below), only the checked values will be returned as an array $OptionList
when you post the form. You can then use this as an array or pass it as an
array to a function in the script:

";
$i++;
}
?>


Untitled Document





Option 1
Option 2
Option 3





Regards

Rudolf Visagie
Principal Software Developer
Digital Healthcare Solutions
 

-Original Message-
From: Uwe Birkenhain [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 04, 2002 10:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP] How to pass unknown number of variables to a function?


Hi everybody on this rainy morning!

My problem:
I give the user a form with a list of options with checkboxes.
The list is long and not predictable - the values change always.
I want to put the checked values (or all, that doesn't matter) in an array,
to pass it to my function.

How can I write those keys and values in an array?

I suppose it will be best done with JS - but since I don't know JS ...
Has anybody a ready solution?

Thank's a lot!

Uwe



-- 
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] Need Help with $_SESSION.

2002-07-04 Thread Ford, Mike [LSS]

> -Original Message-
> From: Scott Fletcher [mailto:[EMAIL PROTECTED]]
> Sent: 03 July 2002 20:58
> 
> Still working on the script. Here what I found out so far. 
> Why does the
> example #1 work and example #2 doesn't?
> 
> Example #1
> 
> Page 1
> 
> $_SESSION[0] = "Zero";
> 
> $_SESSION[1] = "One";

[snip]

Actually, I'm amazed either of your examples work correctly, since numeric
session variable names aren't supported (see bug report 17122 at
http://bugs.php.net/bug.php?id=17122.  As the $_SESSION indexes you use
indeed have the potential to be actual variable names (if register_globals
is turned on), they must themselves be valid PHP variable names.

Cheers!

Mike

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

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




Re: [PHP] mysql/php how to retrieve the right column with 2 columns of the same name

2002-07-04 Thread W. Enserink

thx Jason,


now I understand the use of aliases in select queries.
Good ID:-)


Wilbert

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 04, 2002 11:38 AM
Subject: Re: [PHP] mysql/php how to retrieve the right column with 2 columns
of the same name


> On Thursday 04 July 2002 17:23, Wilbert Enserink wrote:
> > Hi all,
> >
> >
> > I have to tables A and B.
> > They boyh have a column with the same name.
> >
> > Now, I wrote this MySQL statement performing a left join.
> > This results in a data set with rows consisting of 2 columns of the same
> > name, in which the date is stored when the record was last altered. This
> > column is called "last_altered".
> >
> > Later on in my script I'm calling the value of this column with php.
> > $query="select * from tblA LEFT JOIN ";
> > $resultID=mysql_query($query);
> > while ($result_row=mysql_fetch_array($resultID))
> > {
> > echo "$result_row[column with the same name]";
> > }
> >
> > Well, this works without any php or mysql errors, but it is giving me
the
> > data back of that column wich I don't wanna have...It returns the
> > "last_altered" date of tblB in stead of tblA. A solution might be te
> > exclude the second column (the wrong one) from the select statement in
the
> > query. This is a MySQL adjustement. Anybody knows how this can be done??
>
> Try to limit your select statement, instead of SELECT *, use
>
> SELECT colA,
>colB,
>tablA.samenamecolA,
>tablB.samenamecolA, etc
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Love is the process of my leading you gently back to yourself.
> -- Saint Exupery
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-

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




RE: [PHP] Re: Does Location: headers constantly

2002-07-04 Thread Ford, Mike [LSS]

> -Original Message-
> From: Richard Lynch [mailto:[EMAIL PROTECTED]]
> Sent: 03 July 2002 21:17

[...]
 
> 
> It's a good idea to get in the habit of doing:
> 
> header("Location: xxx");
> exit;
> 
> There's no point in sending any more data after the Location: 
> header anyway,

I can't let this go unchallenged -- what happens if you're sending this to a
browser which *doesn't* honour the "Location: " header, but *is* capable of
displaying any attached page content?  The poor user will be left with a
completely blank screen, and no hint of why.  In fact, the HTTP/1.1 spec
(RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616.html) even says:

> Unless the request method was HEAD, the entity of the response
> SHOULD contain a short hypertext note with a hyperlink to the
> new URI(s). 

So at the very least you should do something like this:

header("Location: xxx");
  ?>


Moved to xxx


  This page has moved to xxx.


  http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] adding a variable to a variable name

2002-07-04 Thread Ford, Mike [LSS]

> -Original Message-
> From: Tom Beidler [mailto:[EMAIL PROTECTED]]
> Sent: 03 July 2002 21:41
> 
> For the current issue I'm trying to unset some variables with 
> common names
> and I would like to step through them with a loop. Here's 
> where I'm at to
> give you an idea but the code doesn't work.
> 
> for ($i = 2; $i <= 4; $i++) {
> unset($level$iName);
> unset($level$iUrl);
> }

[...]

> I guess I could create a variable before the unset like so
> 
> $unsetA = "level" . $i . "Name";

This does the trick:

   unset(${"level${i}Name"});

> but that seems cloogey.

cloogey --> kludgy???

Cheers!

Mike

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

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




Re: [PHP] mysql/php how to retrieve the right column with 2 columnsof the same name

2002-07-04 Thread Alberto Serra

Wilbert Enserink wrote:

> Later on in my script I'm calling the value of this column with php.
> $query="select * from tblA LEFT JOIN ";

it's been said over and over :) NEVER EVER write a select * query...

use syntax

Select
a.column1,
a.column2,
b.column1
from
tbl1 as a,
tbl2 as b
where
.

and you'll never get in trouble :))

Alberto
Kiev


-- 


@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@-_=}{=_-@

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] How to pass unknown number of variables to a function?

2002-07-04 Thread Terence Kearns

This is a nice easy one :)

It couldn't be simpler.

Just put empty square brackets (as used in arrays) in front of your
checkbox name.
The example below assumes you have PHP 4.1 or greater (which uses
$_POST to contain form posted data)
notice how name="ck[]"




Untitled



".$varval."");
}
}
?>

















in earlier versions of PHP, $_POST["ck"] would be equal to $ck
(although, the former is safer)


On Thu, 4 Jul 2002 10:52:37 +0200, "Uwe Birkenhain"
<[EMAIL PROTECTED]> said:
> Hi everybody on this rainy morning!
> 
> My problem:
> I give the user a form with a list of options with checkboxes.
> The list is long and not predictable - the values change always.
> I want to put the checked values (or all, that doesn't matter) in an
> array,
> to pass it to my function.
> 
> How can I write those keys and values in an array?
> 
> I suppose it will be best done with JS - but since I don't know JS ...
> Has anybody a ready solution?
> 
> Thank's a lot!
> 
> Uwe
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

[TK]

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




[PHP] HTML & Java script doubt..

2002-07-04 Thread Balaji Ankem

Hi friend,

 sorry for putting this question to php-list.

Here I am getting the error as "Object doesn't support this property or
method" in line number 22.






function checkall()
{
var n=0,i=document.form1.OptionList.length;

while(n

[PHP] IIS unexpected error

2002-07-04 Thread news.per.connect.net.au

I am setting up PHP on WinXP Pro with IIS 5.1.

I tried to start the IIS server and I get an "Unexpected error 0x8ffe2740
occured." error.
Anyone know how to resolve this problem?



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




Re: [PHP] HTML & Java script doubt..

2002-07-04 Thread John Legg

Hi Balaji

Have re-written the code now works.. two problems:

1. checkall() appears to be a reserved function - have renamed function to
checkitall

2. You didn't need to put [] after OptionList in checkbox name




function checkitall()
{
var n=0,i=document.form1.OptionList.length;
while(n
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 04, 2002 12:04 PM
Subject: [PHP] HTML & Java script doubt..


> Hi friend,
>
>  sorry for putting this question to php-list.
>
> Here I am getting the error as "Object doesn't support this property or
> method" in line number 22.
>
> 
>
> 
> 
> 
> function checkall()
> {
> var n=0,i=document.form1.OptionList.length;
>
> while(n {
> document.form1.OptionList[n].checked=true;
> n=n+1;
> }
> }
> 
> 
>
> 
> 
>  value="something1">Option 1
>  value="something2">Option 2
>  value="something3">Option 3
>  OnClick=checkall()> /This is error line
>
> 
> 
> 
>
> ==
>
> Thanks and Regards
> Balaji
>
>






> --
> 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] Content-Length

2002-07-04 Thread Grant

Hi

I am currently having problems with a custom written
web-authentication-proxy.  The proxy works fine with standard html pages but
not with php pages.  After doing a bit of digging I have found that the
proxy does a HEAD request and checks the Content-Length to see if the page
if valid.

I have been able to use

Header( "Content-Length: 100" )

to fool the proxy into loading the php page.

My question is how do I go about calculating the correct Content-Length for
each and every php page on my site.

I have done some digging and presume I need to do "Output buffering" and
calculate the strlen of the response the php returns, but how do I reference
the result of a php page to get a strlen from it??

Any assistance would be welcome

Thanks

Grant




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




[PHP] Sort with PHP or SQL?

2002-07-04 Thread Patrick Teague

Hey,

I'm working on a way to pull menus/pages from a database.  Currently I have
this working on 2 levels - Topic headers & actual page titles - & it prints
it out fairly nice & doesn't take long to load.  What I need to do is add a
level between the 2, a sub-header.

I'm running both the apache server & mysql server on the same linux box as
the current load isn't very high.  I'm wondering whether it would be
better/easier to Load all the topic headers into an array, then any possible
sub-headers into a 2nd array, then the pages into a 3rd array (or even into
a multidimensional array?).  Then go through the arrays & match the pages.
Or would it be easier to write 1 huge SQL statement & have the SQL server
run the whole query?

Currently the menu looks like -

Win Programs
  - Anti-Bot
  - Find Ascii
  - Game Pack
Online Projects
  - Anti-Bot
etc...

I need something more like -

Win Programs
Utils
  - Anti-Bot
  - Find Ascii
Games
  - Game Pack
Online Projects
  - Anti-Bot
etc...

Patrick



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




[PHP] AdRotator for PHP?

2002-07-04 Thread Patrick Teague

Hey,

I'm wondering if anyone has found or ended up writing something similar to
the MSWC AdRotator object in ASP, but for PHP?  Or is there already a module
on apache.org that I missed?

Thanks for any help :)

Patrick



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




[PHP] Re: Nothing will execute after calling imagejpeg.

2002-07-04 Thread val petruchek

> This thread has been up before, but there was never sent a reply to it,
> and I'm having the same problem…

Just idea.

If you doesn't have GD installed and php error reporting turned off
this situation is possible.

In other words php simply dies because of undeclared function and
doesn't report about error.

Maybe this helps

--
Sincerely, val petruchek




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




[PHP] MySql_Error();

2002-07-04 Thread Skyhawk

Please, How do I make to get all errors of MySql ?

I'm making a function for translate all errors. Example:

function TranslateErrors($err)
{
   global $result;
   global $text;
   Switch ($err)
   {
  case 1045 :
 $text = "User or Password invalid";
 Break;
  case 2005 :
 $text = "Host not exists";
 Break;
  case 1049 :
 $text = "Database not exists";
 Break;
   }
   result = $text;
}


Thanks



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




Re: [PHP] Content-Length

2002-07-04 Thread Daniel Tryba

On Thu, Jul 04, 2002 at 01:24:04PM +0200, Grant wrote:
> My question is how do I go about calculating the correct Content-Length for
> each and every php page on my site.
> 
> I have done some digging and presume I need to do "Output buffering" and
> calculate the strlen of the response the php returns, but how do I reference
> the result of a php page to get a strlen from it??

You didn't dig far enough, since there is an example of exactly what you
want on:

http://www.php.net/manual/en/function.ob-get-length.php

Isn't the online reference need? :)

-- 

  Daniel Tryba


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




RE: [PHP] AdRotator for PHP?

2002-07-04 Thread joakim . andersson

I'm pretty sure you'll find what you are looking for here:
http://www.hotscripts.com/PHP/Scripts_and_Programs/Ad_Management/

/Joakim

> -Original Message-
> From: Patrick Teague [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 04, 2002 1:31 PM
> To: PHP-General
> Subject: [PHP] AdRotator for PHP?
> 
> 
> Hey,
> 
> I'm wondering if anyone has found or ended up writing 
> something similar to
> the MSWC AdRotator object in ASP, but for PHP?  Or is there 
> already a module
> on apache.org that I missed?
> 
> Thanks for any help :)
> 
> Patrick
> 
> 
> 
> -- 
> 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] Function imap_headers question.

2002-07-04 Thread Latex Master

Hello php-general,

  I've got a little question about imap_headers. I working on a
  project which must connect to local nntp server. I have no problems
  doing it, but as far as I know from documentation Imap_headers()
  fetches msg headers in to the arrey. So let's say I've got 5000 post
  in the box. When i try to open it it fetches all the headers. and
  then brings me them on the web page. I want to display sets of 50
  headers per page. that makes 100 pages. and every page will connect
  to server fetch ALL headers and etc. Any possibility to limit
  headers fetch like mysql limit 0, 50 and so on?
  Also any ideas how to speed it up also are welcome

-- 
Best regards,
 Latex  mailto:[EMAIL PROTECTED]


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




Re: [PHP] AdRotator for PHP?

2002-07-04 Thread Latex Master

Hello Patrick,
  Try to look at hotscripts.com there are lots of scripts there.
  Personally i prefer to write ones by myself.
Thursday, July 4, 2002, 3:31:20 PM, you wrote:

PT> Hey,

PT> I'm wondering if anyone has found or ended up writing something similar to
PT> the MSWC AdRotator object in ASP, but for PHP?  Or is there already a module
PT> on apache.org that I missed?

PT> Thanks for any help :)

PT> Patrick






-- 
Best regards,
 Latexmailto:[EMAIL PROTECTED]


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




[PHP] PHP 4.2.1 - Apache 2.0.36 - Win98SE

2002-07-04 Thread Erik Hegreberg

Php 4.2.1 - Apache 2.0.36 -Win98SE
This configuration works great, but when I try to upgrade to Apache 2.0.39 nothing 
works.Even when I try php 4.3.0 it wont work.

My question is: Is there anybody out there who have tried to configure php 4.2.1 or 
4.3.0  with Apache 2.039  and Win98SE?
Please tell me how!

Erik




Re: [PHP] Re: $this in an XML data handler ... in a class

2002-07-04 Thread Peter Clarke

I hadn't noticed that. My php.ini was set to on, changing it to off gave the
warning.
Having changed:
xml_set_object($this->parser,&$this);
to:
xml_set_object($this->parser,$this);
Stops the warning and the parser works fine.

This is the class I'm using and it works fine:

class parse_words_xml  {
 var $words;

 function parse_words_xml($xml_data) {
 $this->words = array();
 $this->parser = xml_parser_create();
 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, false);
 xml_set_element_handler($this->parser,"tag_open","tag_close");
 xml_set_character_data_handler($this->parser,"cdata");
 $this->parse($xml_data);
 }

 function parse($xml_data) {
  xml_set_object($this->parser,$this);
  reset ($xml_data);
  while (list (, $data) = each ($xml_data)) {
  if (!xml_parse($this->parser, $data)) {
  die(sprintf( "XML error: %s at line %d\n\n",
  xml_error_string(xml_get_error_code($this->parser)),
  xml_get_current_line_number($this->parser)));
  }
  }

 }

 function tag_open($parser,$tag,$attributes) {
 $this->current_tag = $tag;
 switch($tag){
 case 'Word':
$this->id = $attributes['id'];
$this->words[$attributes['id']] = 1;
 break;
 default:
 break;
 }
 }

 function cdata($parser,$cdata) {
  $this->temp = $cdata;
 }

 function tag_close($parser,$tag) {
 switch($tag){
 case 'Word':
$this->words[$this->id] = $this->temp;
$this->temp = '';
 break;
 default:
 break;
 }
 }

}


"Clay Loveless" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Unfortunately, the xml_set_object function does not work to solve this
> problem. I tried using it, and my results were the same as they were when
I
> was not using it.
>
> [I found that the array($this, 'function_name') method instead of 'string
> function_name' for the xml_set_*_handler functions worked just as well,
only
> without this Warning message one gets from PHP 4.2.1 upon using
> xml_set_object($this->parser, &$this):
>
> "PHP Warning:  Call-time pass-by-reference has been deprecated - argument
> passed by value;  If you would like to pass it by reference, modify the
> declaration of xml_set_object().  If you would like to enable call-time
> pass-by-reference, you can set allow_call_time_pass_reference to true in
> your INI file.  However, future versions may not support this any
longer."]
>
>
> Still searching for an answer on this one ...
>
> Thanks,
> -Clay
>
>
>
> > "Peter Clarke" <[EMAIL PROTECTED]>
> >
> > Have a look at:
> > http://www.php.net/manual/en/function.xml-set-object.php
> >
> > xml_set_object($this->parser, &$this);
> >
> >
> >
> > "Clay Loveless" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >> Here's a brain-bender ... At least it is for me at the moment. : )
> >>
> >> When I use an XML parser inside a class, the xml_*_handler functions
> > aren't
> >> recognizing "$this->" variables. I can kind of see why ... But would
like
> > it
> >> to work anyway. : )
> >>
> >> Here's an example:
> >>
> >> class Blah
> >> {
> >> var $xmlparser;
> >> var $current_element;
> >>
> >> // ...
> >>
> >> function _parseXML($data)
> >> {
> >> $this->xmlparser = xml_parser_create();
> >> xml_set_element_handler(
> >> $this->xmlparser,
> >> array($this,"_xml_start_element"),
> >> array($this,"_xml_end_element"));
> >> xml_set_character_data_handler(
> >> $this->xmlparser,
> >> array($this,"_xml_character_data"));
> >> xml_parse($this->xmlparser, $data);
> >> xml_parser_free($this->xmlparser);
> >> }
> >>
> >> function _xml_start_element($p, $e_name, $e_attributes)
> >> {
> >> $this->current_element = $e_name;
> >> }
> >>
> >> function _xml_end_element($p, $e_name)
> >> {
> >> // ...
> >> }
> >>
> >> function _xml_character_data($p, $data)
> >> {
> >> echo "element is: ".$this->current_element."\n";
> >> echo "data is: $data\n";
> >> }
> >>
> >> } // end of class Blah
> >>
> >>
> >>
> >> When this XML parser gets called from within the Blah class, the
"element
> >> is:" portion of _xml_character_data comes out blank!
> >>
> >> This sort of makes sense, because the callback functions are "children"
of
> >> the xml_parser_create "parent" ... But should that make the children
> >> ignorant of the "grandparent" variables referred to by $this->varname?
> >>
> >> I hope this makes sense ... Has anyone else encountered this sort of
> >> problem? I'm an old hat at PHP, but am relatively new to both XML
parsing
> >> and writing my own classes.
> >>
> >> Thanks,
> >> Clay
> >>
> >
> >
>


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




[PHP] Button can't see form!

2002-07-04 Thread Mark Colvin

I use the following line in some of my php scripts to navigate between
pages:

 

The problem I have is with a page I build dynamically. The whole page is
encased in  tags. In between these tags there are sections
echoed as a result of a databasse query. Each of these sections is a form.
After all of the sections have been created, there is a button at the bottom
of the page that is similar to that above. The button is outwith the form
tags of the sections but within the form tags of the whole page i.e.






  dynamic content


  dynamic content


  dynamic content



 



Clicking on the button has no effect. On all my other pages this button
behaves as it should. Why?



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




[PHP] Moving a file with 'rename'?

2002-07-04 Thread Tim Stoop

Hi people,

I want to move a file from one location to another. I expect I can only do 
this with 'rename', because there's no 'move'-command (at least nog in the 
manual). Following situation:

original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg
with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos
new location: /var/www/html/foto/0/0/0/0/.thumb.jpg

syntax: rename($old_location, $new_location);

Error: Warning: Rename failed (Invalid cross-device link) in 
/home/cvd/sandbox/webfotos/admin/save.php on line 95

When I 'su' to 'apache' (the user under which the httpd is running), I can 
do the following without any error:

mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg 
/var/www/html/foto/0/0/0/0/.thumb.jpg

Any ideas on why I get the error and how I can solve it? Tia!

-- 
Kind regards,
Tim

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




[PHP] Microsoft Access & PHP

2002-07-04 Thread Daniel J Owen-Mcgee

Hi,

I'm gleaning microsoft SQL from queries within a MS Access database, for insertion 
into my PHP pages. This has been working fine but the example below just refuses to 
work,

SELECT ExamPapers.EPaperID, ExamPapers.EPapersText, ExamPapers.[Title of Paper], 
ExamPapers.Course, ExamPapers.School, ExamPapers.Year, ExamPapers.[Jan/Summer], 
ExamPapers.[Module Code], ExamPapers.Stage, ExamPapers.[Storage Location], 
ExamPapers.[Add to Webpage]
FROM ExamPapers
WHERE (((ExamPapers.School)="Colour and Imaging Institute") AND ((ExamPapers.[Add to 
Webpage])=True));

I want to pull records from 1 table (ExamPapers). 
The WHERE line is causing problems i.e if I remove it, my php pages actually show. Can 
anyone see what I'm doing wrong?

Thanks,

Daniel Owen-McGee


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




Re: [PHP] Moving a file with 'rename'?

2002-07-04 Thread Latex Master

Hello Tim,
Tim why don't you try shell_exec ?

Thursday, July 4, 2002, 5:03:34 PM, you wrote:

TS> Hi people,

TS> I want to move a file from one location to another. I expect I can only do 
TS> this with 'rename', because there's no 'move'-command (at least nog in the 
TS> manual). Following situation:

TS> original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg
TS> with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos
TS> new location: /var/www/html/foto/0/0/0/0/.thumb.jpg

TS> syntax: rename($old_location, $new_location);

TS> Error: Warning: Rename failed (Invalid cross-device link) in 
TS> /home/cvd/sandbox/webfotos/admin/save.php on line 95

TS> When I 'su' to 'apache' (the user under which the httpd is running), I can 
TS> do the following without any error:

TS> mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg 
TS> /var/www/html/foto/0/0/0/0/.thumb.jpg

TS> Any ideas on why I get the error and how I can solve it? Tia!

TS> -- 
TS> Kind regards,
TS> Tim




-- 
Best regards,
 Latexmailto:[EMAIL PROTECTED]


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




Re: [PHP] Moving a file with 'rename'?

2002-07-04 Thread Marek Kilimajer

rename can "move" the file only on the same partition, it is realy just 
_rename_, not full _move_

Marek

Tim Stoop wrote:

>Hi people,
>
>I want to move a file from one location to another. I expect I can only do 
>this with 'rename', because there's no 'move'-command (at least nog in the 
>manual). Following situation:
>
>original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg
>with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos
>new location: /var/www/html/foto/0/0/0/0/.thumb.jpg
>
>syntax: rename($old_location, $new_location);
>
>Error: Warning: Rename failed (Invalid cross-device link) in 
>/home/cvd/sandbox/webfotos/admin/save.php on line 95
>
>When I 'su' to 'apache' (the user under which the httpd is running), I can 
>do the following without any error:
>
>mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg 
>/var/www/html/foto/0/0/0/0/.thumb.jpg
>
>Any ideas on why I get the error and how I can solve it? Tia!
>
>  
>



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




Re: [PHP] Microsoft Access & PHP

2002-07-04 Thread Latex Master

Hello Daniel,
Try to use a query line like below:
WHERE (((ExamPapers.School)=\"Colour and Imaging Institute\") AND ((ExamPapers.[Add to 
Webpage])=True));
And let us know it it will work


Thursday, July 4, 2002, 5:21:50 PM, you wrote:

DJOM> Hi,

DJOM> I'm gleaning microsoft SQL from queries within a MS Access database, for 
insertion into my PHP pages. This has been working fine but the example below just 
refuses to work,

DJOM> SELECT ExamPapers.EPaperID, ExamPapers.EPapersText, ExamPapers.[Title of Paper], 
ExamPapers.Course, ExamPapers.School, ExamPapers.Year, ExamPapers.[Jan/Summer], 
ExamPapers.[Module Code],
DJOM> ExamPapers.Stage, ExamPapers.[Storage Location], ExamPapers.[Add to Webpage]
DJOM> FROM ExamPapers
DJOM> WHERE (((ExamPapers.School)="Colour and Imaging Institute") AND 
((ExamPapers.[Add to Webpage])=True));

DJOM> I want to pull records from 1 table (ExamPapers). 
DJOM> The WHERE line is causing problems i.e if I remove it, my php pages actually 
show. Can anyone see what I'm doing wrong?

DJOM> Thanks,

DJOM> Daniel Owen-McGee





-- 
Best regards,
 Latexmailto:[EMAIL PROTECTED]


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




RE: [PHP] Other than substr

2002-07-04 Thread César Aracena

Thanks for all the responses.

C.

> -Original Message-
> From: César Aracena [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 03, 2002 1:36 PM
> To: PHP General List
> Subject: [PHP] Other than substr
> 
> Hi all.
> 
> I need to show up some data from a DB which consist of phone numbers
> with area code. They’re stored like () . What is the best
> approach to print them into some textboxes so they can be edited? I’m
> using substr but area codes (inside parenthesis) goes from 3 to 5
> numbers, so sometimes the closing parenthesis is showed and other
times
> even the first number from the actual number is also showed. Can I use
> regex instead? How is it used? I tried to figure it out in the PHP
> manual, but it is NOT written in my level of English.
> 
> 
> Thanks in advance,
> 
>   Cesar Aracena
> CE / MCSE+I
> Neuquen, Argentina
> +54.299.6356688
> +54.299.4466621
> 


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




[PHP] How to trigger particular java script function?

2002-07-04 Thread Balaji Ankem


Hi friend,
 I want to trigger one java script function ( time delay) every time.
How can I achieve this?
 Here my questuion is: I want to play all song files from my database.
 Here what I do is initially I display one button "PLAY" and then call
java script delay function and it has to come back  to php script and
play next one again trigger to timedelay function etc...

Any inputs highly appreciable.


Thanks in advance
Balaji













==


Thanks in advance
Balaji




**Disclaimer

Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged' and 'confidential' and intended for use only by the individual
 or entity to which it is addressed. You are notified that any use, copying 
or dissemination of the information contained in the E-MAIL in any manner 
whatsoever is strictly prohibited.

***



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


[PHP] User generated Web pages?

2002-07-04 Thread Anthony Rodriguez

I'm trying to develop a software package for end users with no knowledge of 
PHP.  The package would allow these users to generate Web pages displaying 
a custom questionnaire to be used by consumers to answer questions online.

I thought of writing a PHP script that asks the end users the type of 
questions to be displayed, the questions themselves to be displayed, and, 
if required, the responses to be displayed.  This information would be 
stored in a MySQL database.

I then would write another PHP script that would dynamically generate the 
questionnaire based on the information stored in the MySQL database.

The types of questions include text fields, radio buttons, check boxes, 
menu selections, and text areas.

Is this the right approach or is there another way?

Thanks!

Anthony Rodriguez
([EMAIL PROTECTED])







  to be 



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




Re: [PHP] mySQL and phpMyAdmin

2002-07-04 Thread Marek Kilimajer

You need to install php-mysql* too.

Jadiel Flores wrote:

>Hi, I installed php and mysql today and I'm trying to use phpMyAdmin but
>I'm receiving the error message:
>cannot load MySQL extension,
>please check PHP Configuration.
>
>I checked the php.ini and couldn't find anything related, my configure
>command says '--with-mysql=shared,/usr' and I have no idea why it's not
>working.
>
>I'm using redhat 7.3, Apache 1.3.23, php 4.1.2 and MySQL 3.23.51
>
>Any idea or similar problem??
>
>Thanks.
>
>Jadiel
>
>
>
>
>  
>



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




Re: [PHP] User generated Web pages?

2002-07-04 Thread Justin French

It's the right approach, but since you're dealing with large amounts of
user-contributed (untrusted, dangerous, suspicious, whatever) data both to
create the forms AND to gather information from form submissions, I'd be
very wary about security.

Infact, I wouldn't recommend it for a first project unless you've got some
form of programming experience in a simular web language.


Good luck!


Justin French


on 04/07/02 10:51 PM, Anthony Rodriguez ([EMAIL PROTECTED]) wrote:

> I'm trying to develop a software package for end users with no knowledge of
> PHP.  The package would allow these users to generate Web pages displaying
> a custom questionnaire to be used by consumers to answer questions online.
> 
> I thought of writing a PHP script that asks the end users the type of
> questions to be displayed, the questions themselves to be displayed, and,
> if required, the responses to be displayed.  This information would be
> stored in a MySQL database.
> 
> I then would write another PHP script that would dynamically generate the
> questionnaire based on the information stored in the MySQL database.
> 
> The types of questions include text fields, radio buttons, check boxes,
> menu selections, and text areas.
> 
> Is this the right approach or is there another way?
> 
> Thanks!
> 
> Anthony Rodriguez
> ([EMAIL PROTECTED])
> 
> 
> 
> 
> 
> 
> 
> to be 
> 
> 


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




[PHP] eregi problems

2002-07-04 Thread dan radom

I've got a form that's posted to a php page where I'm attempting to validate a field 
contains a valid email address.  The eregi below seems to be totally ignored...

  if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
  echo "please enter a valid email address";
  exit;
  }


$emp_email is being posted to the form.  Any ideas why this is being ignored?

dan

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




[PHP] extension problem

2002-07-04 Thread adelpfephp




Hi all
I am working with php on linux.
I want to create dynamic library and use it in php.
For example:
I have to built this
#include 
char* aa(){
return "true";
}

I succeed to compile this into a dynamic library x.so.

When I try to call this from php I get

Cannot load x.so. may be not a php library.

Can you help me please.



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


[PHP] mail atashments

2002-07-04 Thread adi

HI,
How to send atashments with mail() function?
I have a form to mail page, and i want to atash and transmit files

tx



Re: [PHP] Using fsockopen

2002-07-04 Thread Remy Dufour

Take a look at this class. I think thats what you want !

> Help
>
> I'm a newbie to indepth PHP.
>
> I want to issue an fsockopen command to pass a POST data set to a remote
server script.
>
> I understand the pricipals behind fsockopen, but I cannot figure out the
string I need to pass to POST the data - I will be emulating the output from
a  element.
>
> In addition, how do I detect a successful operation? before closing the
socket?.
>
> Any help greatfully received.
>
> thks
>
> Richard




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


Re: [PHP] Moving a file with 'rename'?

2002-07-04 Thread Tim Stoop

Marek Kilimajer wrote:

> rename can "move" the file only on the same partition, it is realy just
> _rename_, not full _move_

So there is no full-features move in PHP?

-- 
Kind regards,
Tim

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




Re: [PHP] Moving a file with 'rename'?

2002-07-04 Thread Tim Stoop

Latex Master wrote:

> Hello Tim,
> Tim why don't you try shell_exec ?

As a last resort, I might, but I'd rather do it in PHP... Code-portability, 
y'know :)

-- 
Kind regards,
Tim

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




Re: [PHP] eregi problems

2002-07-04 Thread Justin French

Dan,

I'll give you a little piece of advise that was given to me a little while
back on this list:

Go to http://www.killersoft.com/ and grab a copy of the validateEmailFormat
program.


PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program
from O'Reilly's Mastering Regular Expressions.  This function is used to
confirm if an e-mail address adheres to the RFC 822 specification for
internet email addresses.


Rather than trying re-invent the wheel, why not use something that conforms
closely to specs, and is widely accepted by many development groups.


All you'll have to do is something like (function names and filenames may
not be right):

please enter a valid email address";
}
?>


Side topic:  of course, you aren't checking for a valid email address at
all, your checking to see if the email address LOOKS valid.  You're not
checking to see if the address is attached to an email box, or furthermore
if there's anyone at the other end to open/read your email... you're just
validating the appearance of the address to fall within RFC 822 specs.

Subsequently [EMAIL PROTECTED] and [EMAIL PROTECTED]
will both return valid.


The only way to ensure an email address is truely valid is to send an email
to it, and have them respond... indicating that the address is linked to an
email box and furthermore, someone opened the email, read it, and responded.

Even then, this could be done by a robot I guess.


Justin French

Creative Director
http://Indent.com.au





on 05/07/02 12:23 AM, dan radom ([EMAIL PROTECTED]) wrote:

> I've got a form that's posted to a php page where I'm attempting to validate a
> field contains a valid email address.  The eregi below seems to be totally
> ignored...
> 
> if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
> echo "please enter a valid email address";
> exit;
> }
> 
> 
> $emp_email is being posted to the form.  Any ideas why this is being ignored?
> 
> dan


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




[PHP] Broken Cookies

2002-07-04 Thread Robert Wray

Hiyas :)

I'm having a problem with the code copied below not creating the cookies
that it should do;
  setcookie("loggedInUID",$_POST['uname'],ms_cookie_time((time()+120)),'/',
$cookie_base);

setcookie($_POST['site_id'],$_POST['ucaps'],ms_cookie_time((time()+120)),'/'
, $cookie_base);
Basically those two lines are part of a file on server X that's called by a
file on server Y by a command similar to:
  header("Location:
http://ServerX/connect.php?uname=username&site_id=siteid&ucaps=ucaps";);
I'm at a complete loss as to why it's not creating the cookies properly. Any
suggestions?

Rob! x ;o)



Re: [PHP] eregi problems

2002-07-04 Thread dan radom

My main cnocern at this point is that the eregi is being totally ignored.  I just want 
to make sure the email address is in a valid format, not that it is a valid email 
address.  I'll look at validEmailFormat as well, but I don't understand why it's not 
even being examined.

dan


* Justin French ([EMAIL PROTECTED]) wrote:
> Dan,
> 
> I'll give you a little piece of advise that was given to me a little while
> back on this list:
> 
> Go to http://www.killersoft.com/ and grab a copy of the validateEmailFormat
> program.
> 
> 
> PHP4 translation of Jeffrey E.F. Friedl's definitive Email Regex Program
> from O'Reilly's Mastering Regular Expressions.  This function is used to
> confirm if an e-mail address adheres to the RFC 822 specification for
> internet email addresses.
> 
> 
> Rather than trying re-invent the wheel, why not use something that conforms
> closely to specs, and is widely accepted by many development groups.
> 
> 
> All you'll have to do is something like (function names and filenames may
> not be right):
> 
>  include('inc/validEmailFormat.inc');
> if(!validEmailFormat($emp_email))
> {
> echo "please enter a valid email address";
> }
> ?>
> 
> 
> Side topic:  of course, you aren't checking for a valid email address at
> all, your checking to see if the email address LOOKS valid.  You're not
> checking to see if the address is attached to an email box, or furthermore
> if there's anyone at the other end to open/read your email... you're just
> validating the appearance of the address to fall within RFC 822 specs.
> 
> Subsequently [EMAIL PROTECTED] and [EMAIL PROTECTED]
> will both return valid.
> 
> 
> The only way to ensure an email address is truely valid is to send an email
> to it, and have them respond... indicating that the address is linked to an
> email box and furthermore, someone opened the email, read it, and responded.
> 
> Even then, this could be done by a robot I guess.
> 
> 
> Justin French
> 
> Creative Director
> http://Indent.com.au
> 
> 
> 
> 
> 
> on 05/07/02 12:23 AM, dan radom ([EMAIL PROTECTED]) wrote:
> 
> > I've got a form that's posted to a php page where I'm attempting to validate a
> > field contains a valid email address.  The eregi below seems to be totally
> > ignored...
> > 
> > if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
> > echo "please enter a valid email address";
> > exit;
> > }
> > 
> > 
> > $emp_email is being posted to the form.  Any ideas why this is being ignored?
> > 
> > dan
> 
> 
> -- 
> 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: Does Location: headers constantly

2002-07-04 Thread Analysis & Solutions

On Thu, Jul 04, 2002 at 11:01:50AM +0100, Ford, Mike   [LSS] wrote:
> 
> I can't let this go unchallenged -- what happens if you're sending this to a
> browser which *doesn't* honour the "Location: " header, but *is* capable of
> displaying any attached page content?  The poor user will be left with a
> completely blank screen, and no hint of why.  In fact, the HTTP/1.1 spec

But, which browser is incapable of handling location headers?


> (RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616.html) even says:
> 
> > Unless the request method was HEAD, the entity of the response
> > SHOULD contain a short hypertext note with a hyperlink to the
> > new URI(s). 

Oddly, I don't find that text you excerpted on the URI you provided.

But, the thing is, I'm under the impression that PHP (and/or Apache?)  
doesn't send anything else from your script once a Location header is
sent.  I just confirmed this with two different tests.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] extension problem

2002-07-04 Thread joakim . andersson

You probably shoul start here: http://www.php.net/manual/en/zend.php

/Joakim

> -Original Message-
> From: adelpfephp [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 04, 2002 4:34 PM
> To: php-france; [EMAIL PROTECTED]
> Subject: [PHP] extension problem
> 
> 
> 
> 

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




Re: [PHP] Sort with PHP or SQL?

2002-07-04 Thread Analysis & Solutions

Patrick:

Grouping and sorting is something databases specialize in.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Microsoft Access & PHP - Solved

2002-07-04 Thread Daniel J Owen-Mcgee

Hi All,

My query (below) has been solved. Thanks to all who responded so quickly!

Putting single quote marks around 'Colour and Imaging Institute' did the trick.

DAniel



Hi,

I'm gleaning microsoft SQL from queries within a MS Access database, for insertion 
into my PHP pages. This has been working fine but the example below just refuses to 
work,

SELECT ExamPapers.EPaperID, ExamPapers.EPapersText, ExamPapers.[Title of Paper], 
ExamPapers.Course, ExamPapers.School, ExamPapers.Year, ExamPapers.[Jan/Summer], 
ExamPapers.[Module Code], ExamPapers.Stage, ExamPapers.[Storage Location], 
ExamPapers.[Add to Webpage]
FROM ExamPapers
WHERE (((ExamPapers.School)="Colour and Imaging Institute") AND ((ExamPapers.[Add to 
Webpage])=True));

I want to pull records from 1 table (ExamPapers). 
The WHERE line is causing problems i.e if I remove it, my php pages actually show. Can 
anyone see what I'm doing wrong?

Thanks,

Daniel Owen-McGee


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




Re: [PHP] MySql_Error();

2002-07-04 Thread Analysis & Solutions

On Thu, Jul 04, 2002 at 08:48:26AM -0300, Skyhawk wrote:
> Please, How do I make to get all errors of MySql ?
> 
> I'm making a function for translate all errors. Example:

Uh, why?  PHP's mysql_error() does the job for you.
http://www.php.net/manual/en/function.mysql-error.php

If you're hell bent on your project, I don't know of a particular location
to find a list of all MySQL errors.  First try a _well_ _defined_ search
on Google.  Second, do a search on
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&group=mailing.database
As a LAST RESORT, ask the MySQL mailing list.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Button can't see form!

2002-07-04 Thread Analysis & Solutions

On Thu, Jul 04, 2002 at 01:44:00PM +0100, Mark Colvin wrote:
> I use the following line in some of my php scripts to navigate between
> pages:
> 
>   value='New' onClick="this.form.action='newproduct.php?mode=new';
> this.form.submit()">

And then folks with Java'sCrap turned off won't use your site.

Why people go to such lengths to destroy the elegance of HTML I just don't 
know...

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Paradox Tables with PHP (Still the Same old Question)...

2002-07-04 Thread Kondwani Spike Mkandawire

Hallo Folks

I have come across this problem many times...  But still haven't
seen anyone give a reasonably coherent solution...  I am trying
to get my script to read Paradox Tables...  Its a no go so far...
I do believe that this can be achieved via. odbc...  I have tried
the configurations but have fallen short each time...  I keep getting
the following Error:

  Warning: SQL error: [Microsoft][ODBC Paradox
Driver] The Microsoft Jet database engine could
not find the object 'Test.db'. Make sure the object
exists and that you spell its name and the path
name correctly.,

There has to be someone in this Forum who has successfully worked
with Paradox Tables in conjunction with php...  Do I have to
download another version of ODBC...  My Scripts have no
issues reading MSAccess tables the problem is when it gets
to Paradox...


Please Help...

Spike...



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




[PHP] Problem uploading an image

2002-07-04 Thread Barajas, Arturo

Greetings.

I have two pages where I upload images to a database.

The first one is a "capture", where I insert a record to the database, and the second 
is to edit the data.

The problem: When I go to insert, the following code works flawlessly:



But, if I do in another page (the same darn snippet), it goes:

Warning: fopen("C:\WINNT\Web\wuicon1.gif", "r") - No such file or directory in 
/web/domain/adconsolutions/htdocs/conexionescolar/frmnoticiasedi.php on line 18

Warning: stat failed for C:\WINNT\Web\wuicon1.gif (errno=2 - No such file or 
directory) in /web/domain/adconsolutions/htdocs/conexionescolar/frmnoticiasedi.php on 
line 18

Warning: fread(): supplied argument is not a valid File-Handle resource in 
/web/domain/adconsolutions/htdocs/conexionescolar/frmnoticiasedi.php on line 18

Anybody knows why? It's the same vars, the same text boxes, etc. The only thing that 
changes comes after that condition...

TIA.
--
Un gran saludo/Big regards...
   Arturo Barajas
   Sistemas PPG SJR
   +52 (427) 271-9100, ext. 448

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




Re: [PHP] eregi problems

2002-07-04 Thread Marek Kilimajer

If the regexp matches, it is a valid email, so you need ! in front of it.

dan radom wrote:

>I've got a form that's posted to a php page where I'm attempting to validate a field 
>contains a valid email address.  The eregi below seems to be totally ignored...
>
>  if (eregi("^[a-z0-9\._-]+@[a-z0-9\._-]+$", $emp_email)) {
>  echo "please enter a valid email address";
>  exit;
>  }
>
>
>$emp_email is being posted to the form.  Any ideas why this is being ignored?
>
>dan
>
>  
>



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




Re: [PHP] Moving a file with 'rename'?

2002-07-04 Thread Marek Kilimajer

None that I know of. You need to use copy & unlink

Tim Stoop wrote:

>Marek Kilimajer wrote:
>
>  
>
>>rename can "move" the file only on the same partition, it is realy just
>>_rename_, not full _move_
>>
>>
>
>So there is no full-features move in PHP?
>
>  
>



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




Re: [PHP] Button can't see form!

2002-07-04 Thread Marek Kilimajer

I dont think forms can be nested. In fact I'm pretty sure.

Mark Colvin wrote:

>I use the following line in some of my php scripts to navigate between
>pages:
>
> value='New' onClick="this.form.action='newproduct.php?mode=new';
>this.form.submit()">
>
>The problem I have is with a page I build dynamically. The whole page is
>encased in  tags. In between these tags there are sections
>echoed as a result of a databasse query. Each of these sections is a form.
>After all of the sections have been created, there is a button at the bottom
>of the page that is similar to that above. The button is outwith the form
>tags of the sections but within the form tags of the whole page i.e.
>
>
>
>
>
>
>  dynamic content
>
>
>  dynamic content
>
>
>  dynamic content
>
>
>
> value='New' onClick="this.form.action='newproduct.php?mode=new';
>this.form.submit()">
>
>
>
>Clicking on the button has no effect. On all my other pages this button
>behaves as it should. Why?
>
>
>
>This e-mail is intended for the recipient only and
>may contain confidential information. If you are
>not the intended recipient then you should reply
>to the sender and take no further ation based
>upon the content of the message.
>Internet e-mails are not necessarily secure and
>CCM Limited does not accept any responsibility
>for changes made to this message. 
>Although checks have been made to ensure this
>message and any attchments are free from viruses
>the recipient should ensure that this is the case.
>
>
>  
>



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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Liam Gibbs

> Are you able to do an nslookup of these domains from the server?

Those, of course, were just example email addresses (I'd replaced
them before sending out this email so it would be more clear).
If I use a real email address I get the same error "unrouteable mail
domain"

I am able to nslookup the addresses before hand so I don't
understand why the mail delivery is not working...

thx,
Liam

> -Original Message-
> From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 03, 2002 12:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Exim sendmail faults
> 
> I apologize; this may be more a question for the
> people in php-install. But I'm having some problems
> with my mail stuff in PHP.
> 
> I have Exim version 3.12 installed, but I'm not
> getting any mails sent out by PHP. I *do* get this
> error mail, however:
> 
> This is automatically emailed back to me:
> 
> This message was created automatically by mail
> delivery software.
> 
> A message that you sent could not be delivered to
> one or more of its recipients. The following
> address(es) failed:
> 
>   [EMAIL PROTECTED]:
>  unrouteable mail domain "theemailaddress.com"
> 
> This is in the error log files:
> 
> 2002-07-02 03:26:13 17PI3B-0003sM-00 <=
> [EMAIL PROTECTED] U=root
> P=local S=2
> 95
> 2002-07-02 03:26:13 17PI3B-0003sM-00 **
> [EMAIL PROTECTED]:
> unrouteable mail d
> omain "anotheremailaddress.com"
> 2002-07-02 03:26:13 17PI3B-0003sO-00 <= <>
> R=17PI3B-0003sM-00 U=mail
> P=local S=1
> 063
> 2002-07-02 03:26:13 17PI3B-0003sM-00 Error message
> sent to
> [EMAIL PROTECTED]
> 2002-07-02 03:26:13 17PI3B-0003sM-00 Completed
> 2002-07-02 03:26:13 17PI3B-0003sO-00 => root
> <[EMAIL PROTECTED]>
> D=localuser
>  T=local_delivery
> 2002-07-02 03:26:13 17PI3B-0003sO-00 Completed
> 
> Any thoughts? I know all these e-mail addresses and ip
> addresses are valid (they're either mine or of
> acquaintances), but the server seems to fight me on
> this one.
> 
> __
> Do You Yahoo!?
> Sign up for SBC Yahoo! Dial - First Month Free
> http://sbc.yahoo.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> This message is intended for the sole use of the individual and entity to
> whom it is addressed, and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law.  If you are
> not the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message.  If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you very
> much.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




Re: [PHP] Button can't see form!

2002-07-04 Thread Analysis & Solutions

Folks:

On Thu, Jul 04, 2002 at 11:05:38AM -0400, Analysis & Solutions wrote:
> On Thu, Jul 04, 2002 at 01:44:00PM +0100, Mark Colvin wrote:
> > 
> >   > value='New' onClick="this.form.action='newproduct.php?mode=new';
> > this.form.submit()">
> 
> And then folks with Java'sCrap turned off won't use your site.
> 
> Why people go to such lengths to destroy the elegance of HTML I just don't 
> know...

Mark asked me off list how to write that in HTML...

 
  
   
  
 

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Jason Wong

On Thursday 04 July 2002 23:47, Liam Gibbs wrote:
> > Are you able to do an nslookup of these domains from the server?
>
> Those, of course, were just example email addresses (I'd replaced
> them before sending out this email so it would be more clear).
> If I use a real email address I get the same error "unrouteable mail
> domain"
>
> I am able to nslookup the addresses before hand so I don't
> understand why the mail delivery is not working...

Generally, with email problems it is best to show the actual domains, makes 
troubleshooting easier.

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

/*
Just because you like my stuff doesn't mean I owe you anything.
-- Bob Dylan
*/


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




RE: [PHP] resizing images comming out of blobs

2002-07-04 Thread Barajas, Arturo

> From: andy [mailto:[EMAIL PROTECTED]]

> Hi there,

Hey, Andy.

> I am wondering how to resize an image which is stored in a 
> mysql blob field.
> With files this workes just fine, but how to do this with the 
> image comming from blob? Has anybody done this already?

Incidentally, I've done this just yesterday.

First download the image, write it to the directory and then proceed as you will. It 
uses ImageMagick, 'cause my ISP still doesn't install GD 2.x.

Here it goes (I use the ADODB library using MySQL), and in fact, if someone can 
optimize it, it would be welcome :^)

$rsColegio = $conn->Execute("SELECT * FROM ConEsc_Colegio WHERE Colegio_Id='" . 
$rs->Fields("Colegio_Id") . "'") or die("Algo paso en los colegios...");
if (stristr($rsColegio->Fields("Colegio_Imagen_Tipo"), "gif") != "")
$fileext = ".gif";
elseif (stristr($rsColegio->Fields("Colegio_Imagen_Tipo"), "jpeg") != "")
$fileext = ".jpg";
elseif (stristr($rsColegio->Fields("Colegio_Imagen_Tipo"), "jpg") != "")
$fileext = ".jpg";
else
$fileext = "";
if ($fileext != "") {
$image_tmpfilename = "images/tmp_" . $rsColegio->Fields("Colegio_Id") . 
$fileext;
$image_filename = "images/" . $rsColegio->Fields("Colegio_Id") . $fileext;
$file = fopen("$image_tmpfilename", "w") or die("No fue posible abrir el 
archivo");
if (!$file)
echo "No se pudo abrir el archivo.\n";
else {
fputs($file, $rsColegio->Fields("Colegio_Imagen"));
fclose($file);
}
$aSize = getimagesize($image_tmpfilename);
$iWidth = $aSize[0];
$iHeight = $aSize[1];
if (($iWidth >= 120) || ($iHeight >= 85)) {
if ($iWidth > $iHeight)
$fPercent = $iWidth / 120;
else
$fPercent = $iHeight / 85;
$newWidth = $iWidth / $fPercent;
$newHeight = $iHeight / $fPercent;
system("convert -antialias -sample " . $newWidth . "x" . $newHeight . 
" $image_tmpfilename $image_filename"); 
}
else
copy($image_tmpfilename, $image_filename);
unlink($image_tmpfilename);
}
else
$image_filename = "images/sinlogo.jpg";

Hope that helps.
--
Un gran saludo/Big regards...
   Arturo Barajas
   Sistemas PPG SJR
   +52 (427) 271-9100, ext. 448

> -Original Message-
> Sent: Jueves, 04 de Julio de 2002 11:25 a.m.
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP] resizing images comming out of blobs
> 
> 
> 
> 
> Thank you for any help on that,
> 
> andy
> 
> 
> 
> -- 
> 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] Exim sendmail faults

2002-07-04 Thread Liam Gibbs

Jason Wong wrote:
> On Thursday 04 July 2002 23:47, Liam Gibbs wrote:
> > > Are you able to do an nslookup of these domains from the server?
> >
> > Those, of course, were just example email addresses (I'd replaced
> > them before sending out this email so it would be more clear).
> > If I use a real email address I get the same error "unrouteable mail
> > domain"
> >
> > I am able to nslookup the addresses before hand so I don't
> > understand why the mail delivery is not working...
> 
> Generally, with email problems it is best to show the actual domains, makes
> troubleshooting easier.

Ok, fair enough.

Here are the full errors I get when I try to mail "[EMAIL PROTECTED]"
(BTW, I'm doing it as root but I get the same errors no matter who
I'm logged in as or if I do it through PHP):

Returned email:

>From MAILER-DAEMON Thu Jul 04 06:57:34 2002
Envelope-to: [EMAIL PROTECTED]
X-Failed-Recipients: [EMAIL PROTECTED]
From: Mail Delivery System <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Mail delivery failed: returning message to sender
Date: Thu, 04 Jul 2002 06:57:34 -0400

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. The following address(es) failed:

  [EMAIL PROTECTED]:
unrouteable mail domain "sympatico.ca"

-- This is a copy of the message, including all the headers. --

Return-path: <[EMAIL PROTECTED]>
Received: from root by www with local (Exim 3.12 #1 (Debian))
id 17Q4Io-0004Fx-00
for <[EMAIL PROTECTED]>; Thu, 04 Jul 2002 06:57:34 -0400
To: [EMAIL PROTECTED]
Subject: test
Message-Id: 
From: root <[EMAIL PROTECTED]>
Date: Thu, 04 Jul 2002 06:57:34 -0400

this is a test

&


Exim log:

2002-07-04 06:57:34 17Q4Io-0004Fx-00 <= [EMAIL PROTECTED] U=root
P=local S=3
08
2002-07-04 06:57:34 17Q4Io-0004Fx-00 ** [EMAIL PROTECTED]:
unrouteable mail d
omain "sympatico.ca"
2002-07-04 06:57:34 17Q4Io-0004Fz-00 <= <> R=17Q4Io-0004Fx-00 U=mail
P=local S=1
076
2002-07-04 06:57:34 17Q4Io-0004Fx-00 Error message sent to
[EMAIL PROTECTED]
2002-07-04 06:57:34 17Q4Io-0004Fx-00 Completed
2002-07-04 06:57:35 17Q4Io-0004Fz-00 => root <[EMAIL PROTECTED]>
D=localuser
 T=local_delivery
2002-07-04 06:57:35 17Q4Io-0004Fz-00 Completed


nslookup attempt:

www:~# nslookup sympatico.ca
Server:  localhost
Address:  127.0.0.1

Non-authoritative answer:
Name:sympatico.ca
Address:  206.47.72.104

www:~#


-- 
 Blessed are they who can laugh at themselves for  
 they shall never cease to be amused.

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




[PHP] returning first paragraph from a string

2002-07-04 Thread Lowell Allen

I'm having difficulty returning the first paragraph of a string called
$summary. (Usually this string will only be one paragraph, but it might
contain more than one paragraph. Current data has one occurrence of a
two-paragraph $summary.)

Here's how I process when I want multiple paragraph display. This
successfully generates the necessary HTML:

$summary = trim($summary);
$summary = ereg_replace("\r", "", $summary);
$summary = ereg_replace("\n\n", "", $summary);
$summary = ereg_replace("\n", "", $summary);

Here's what I thought would work to give me the first paragraph only:

$summary = trim($summary);
$summary = ereg_replace("\r", "", $summary);
$summary = preg_replace("/^(.*)\n/", "\1", $summary);

But for occurrences of $summary with two paragraphs, the above returns the
second paragraph (without the first).

The only way I can return the first paragraph for a two paragraph $summary
is with:

$summary = trim($summary);
$summary = ereg_replace("\r", "", $summary);
$summary = preg_replace("/(.*)$/", "\1", $summary);

This gives me the first paragraph as desired (although I don't understand
why!), but returns nothing for occurrences of $summary having only one
paragraph.

I also tried this:

$summary = trim($summary);
$summary = ereg_replace("\r", "", $summary);
$summary = ereg_replace("\n\n", "", $summary);
$summary = preg_replace("#(.*)#", "\1", $summary);

This also returns only the second paragraph. Can anyone point out what I'm
doing wrong, or suggest another approach?

TIA

--
Lowell Allen


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




Re: [PHP] AdRotator for PHP?

2002-07-04 Thread Liam Gibbs

> I'm wondering if anyone has found or ended up
> writing something similar to
> the MSWC AdRotator object in ASP, but for PHP?  Or
> is there already a module
> on apache.org that I missed?

(Figre I should pull my weight on this list here.)

Hmm. Not sure exactly what MSWC AdRotator is, but
here's one I developed. Is it what you want? It checks
a specific directory and grabs a random file from that
directory, then displays it.

if($file = GetRandomPicture($BannerAdsDirectory)) {
$seriescode = substr($file, 0, 2);
print("   \n");
}

function GetRandomPicture($sourcedirectory) {
if($directory = @opendir($sourcedirectory)) {
while($file = @readdir($directory)) {
if(($file != ".") && ($file != ".."))
$files[count($files)] = $file;
}
$randomfile = rand(0, count($files) - 1);
$returnvalue = $files[$randomfile];
} else {
$returnvalue = NULL;
}

return $returnvalue;
}

If anyone can improve on it, let me know. Thanks to
the two guys who posted the links, though. I'll be
sure to check them out once I get a couple of minutes
of free time.

Liam

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




[PHP] Annoying syntax problem with RTRIM

2002-07-04 Thread René Fournier

echo rtrim($feat,", ");

On my local Apache-OSX web server (PHP 4.1.2), this command works fine.
(The reason I use it is that sometimes $feat contains a comma and a 
space at the end of the string, which I want to remove (if it's there) 
before echoing.)

When this same script is run on my ISP (PHP 4.0.6), I get the following 
error message:

Warning:  Wrong parameter count for rtrim() in 
/u/htdocs/smarts/jupiter/callisto/include/create.inc on line 
216


Any ideas why?

Thanks.

...Rene

---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada


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




Re: [PHP] Annoying syntax problem with RTRIM

2002-07-04 Thread Jason Wong

On Friday 05 July 2002 00:41, René Fournier wrote:
> echo rtrim($feat,", ");
>
> On my local Apache-OSX web server (PHP 4.1.2), this command works fine.
> (The reason I use it is that sometimes $feat contains a comma and a
> space at the end of the string, which I want to remove (if it's there)
> before echoing.)
>
> When this same script is run on my ISP (PHP 4.0.6), I get the following
> error message:
>
> Warning:  Wrong parameter count for rtrim() in
> /u/htdocs/smarts/jupiter/callisto/include/create.inc on line
> 216
>
>
> Any ideas why?

RTFM! 

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

/*
The heart is wiser than the intellect.
*/


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




Re: [PHP] Annoying syntax problem with RTRIM

2002-07-04 Thread René Fournier

I did. It didn't help. (That's why I posted this message.)

On Thursday, July 4, 2002, at 10:47  AM, Jason Wong wrote:

> On Friday 05 July 2002 00:41, René Fournier wrote:
>> echo rtrim($feat,", ");
>>
>> On my local Apache-OSX web server (PHP 4.1.2), this command works fine.
>> (The reason I use it is that sometimes $feat contains a comma and a
>> space at the end of the string, which I want to remove (if it's there)
>> before echoing.)
>>
>> When this same script is run on my ISP (PHP 4.0.6), I get the following
>> error message:
>>
>> Warning:  Wrong parameter count for rtrim() in
>> /u/htdocs/smarts/jupiter/callisto/include/create.inc on line
>> 216
>>
>>
>> Any ideas why?
>
> RTFM!
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> The heart is wiser than the intellect.
> */
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada


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




Re: [PHP] returning first paragraph from a string

2002-07-04 Thread Analysis & Solutions

On Thu, Jul 04, 2002 at 12:41:10PM -0400, Lowell Allen wrote:

> $summary = preg_replace("/^(.*)\n/", "\1", $summary);

How's this?

  $summary = preg_replace('/^(.*)(\r?\n){2,}.*/', '\\1', $summary);

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] returning more than 1 value from function

2002-07-04 Thread andy

hi there,

i am wondering if it is possible to return more than 1 value from a
function?

something like

test(){
return $value1, $value2
}

Thanx for any help,

Andy



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




Re: [PHP] Annoying syntax problem with RTRIM

2002-07-04 Thread Analysis & Solutions


On Thu, Jul 04, 2002 at 11:00:55AM -0600, René Fournier wrote:
>
> I did. It didn't help. (That's why I posted this message.)

Suggestions to RTFM generally mean that there's something plainly visible 
in the manual that states what your problem is.  Did you go back to the 
manual after Jason's email?  Probably not, because it says:

"Note: The second parameter was added in PHP 4.1.0"

In your original message you said:

> >On Friday 05 July 2002 00:41, René Fournier wrote:
> >>
> >>When this same script is run on my ISP (PHP 4.0.6), I get the following
> >>error message:
> >>
> >>Warning:  Wrong parameter count for rtrim() in


A:  No.
Q:  Is top posting okay?

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Chris Hewitt

Liam,

I was going to ask you whether a normal user on your computer could send 
mail (OK, root counts). As the answer is no, it is not a problem with 
your php setup.

sympatico.ca has several MX entries, the first of which is 
smtp26.bellglobal.com and I can ping that from here. I also get a 
response by telnetting to port 25. I conclude that I could send email to 
that address (whether the user would be accepted I don't know).

As you presently cannot from your computer, I guess its an Exim 
configuration issue (which I know nothing about), but have you 
configured it up for your computer, domain etc.?

Hope this helps.
Chris

Liam Gibbs wrote:

>
>Ok, fair enough.
>
>Here are the full errors I get when I try to mail "[EMAIL PROTECTED]"
>(BTW, I'm doing it as root but I get the same errors no matter who
>I'm logged in as or if I do it through PHP):
>



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




Re: [PHP] returning more than 1 value from function

2002-07-04 Thread Analysis & Solutions

On Thu, Jul 04, 2002 at 07:16:39PM +0200, andy wrote:
> 
> i am wondering if it is possible to return more than 1 value from a
> function?
> 
> test(){
> return $value1, $value2
> }

You can return an array.  Or, you can global the variables and then set 
them to the values you want.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Liam Gibbs

Chris Hewitt wrote:
> I was going to ask you whether a normal user on your computer could send
> mail (OK, root counts). As the answer is no, it is not a problem with
> your php setup.
> 
> sympatico.ca has several MX entries, the first of which is
> smtp26.bellglobal.com and I can ping that from here. I also get a
> response by telnetting to port 25. I conclude that I could send email to
> that address (whether the user would be accepted I don't know).
> 
> As you presently cannot from your computer, I guess its an Exim
> configuration issue (which I know nothing about), but have you
> configured it up for your computer, domain etc.?

Ok, perhaps I should explain the server set up a bit more...
This will end up being off topic for PHP I think but perhaps
there is someone who may be able to help me (I will also post
this information on the Exim mailing list I just discovered).

sympatico.ca is a large internet provider which I have an
ADSL connection through. Any sympatico.ca servers don't belong
to me but to the provider.

Off this ADSL connection is a BSD box which does my firewalling, 
etc. Behind that box is the web server which is called 
www.cell.dhs.org (cell.dhs.org being my domain). On this 
server is a Debian Linux box which runs Apache with PHP, 
the Exim mail server, etc.

So, any idea what I could be missing from my configuration
that would let me ping addresses nslookup them but not
send mail to them?

Any other questions/information needed?

thx for the help!

> Liam Gibbs wrote:
> 
> >
> >Ok, fair enough.
> >
> >Here are the full errors I get when I try to mail "[EMAIL PROTECTED]"
> >(BTW, I'm doing it as root but I get the same errors no matter who
> >I'm logged in as or if I do it through PHP):

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




Re: [PHP] returning more than 1 value from function

2002-07-04 Thread Chris Wesley

On Thu, 4 Jul 2002, andy wrote:

> i am wondering if it is possible to return more than 1 value from a
> function?

You can pass your arguments by reference.



The result will be that $var1 == "foo" and $var2 == "bar".

You can mix it up too ... if you want the function to return a value (say,
true or false) AND modify arguments, modify only a subset of the
arguments, etc.

(see http://www.php.net/manual/en/functions.arguments.php)

g.luck,
~Chris /"\
   \ / Microsoft Security Specialist:
X  The moron in Oxymoron.
   / \ http://www.thebackrow.net


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




Re: [PHP] returning more than 1 value from function

2002-07-04 Thread Chris Wesley

Sorry ... busy morning ... I misplaced the & for the reference.  They
should be on the arguments on the function definiton, not the function
call.



Sorry if I caused any confusion.

~Chris /"\
   \ / Microsoft Security Specialist:
X  The moron in Oxymoron.
   / \ http://www.thebackrow.net

On Thu, 4 Jul 2002, Chris Wesley wrote:

> On Thu, 4 Jul 2002, andy wrote:
>
> > i am wondering if it is possible to return more than 1 value from a
> > function?
>
> You can pass your arguments by reference.
>
>  function test( $arg1, $arg2 ){
>   $arg1 = "foo";
>   $arg2 = "bar";
> }
>
> $var1 = "";
> $var2 = "";
>
> test( &$var1, &$var2 );  // Note the "&" before the arguments.
> ?>
>
> The result will be that $var1 == "foo" and $var2 == "bar".
>
> You can mix it up too ... if you want the function to return a value (say,
> true or false) AND modify arguments, modify only a subset of the
> arguments, etc.
>
> (see http://www.php.net/manual/en/functions.arguments.php)
>
>   g.luck,
> ~Chris /"\
>\ / Microsoft Security Specialist:
> X  The moron in Oxymoron.
>/ \ http://www.thebackrow.net
>
>


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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Miles Thompson

Liam,

Unfortunately I discarded the earlier messages, so I don't know what your 
error is.
Do you have a fixed IP or do you have something like the Mpowered service 
where you're behind sympatico's NAT server?

Can you use exim to send mail from the console? Is sympatcio allowing this?

You may have to configure exim to use sympatico's SMTP server. (It's been 
so long since I've done that I forget how, and it was a real trial and 
error approach.)

This probably isn't much help - Miles Thompson

PS You may want to post this on the nslug.ca list; some mail guru's read 
it. /mt

At 01:58 PM 7/4/2002 -0400, Liam Gibbs wrote:
>Chris Hewitt wrote:
> > I was going to ask you whether a normal user on your computer could send
> > mail (OK, root counts). As the answer is no, it is not a problem with
> > your php setup.
> >
> > sympatico.ca has several MX entries, the first of which is
> > smtp26.bellglobal.com and I can ping that from here. I also get a
> > response by telnetting to port 25. I conclude that I could send email to
> > that address (whether the user would be accepted I don't know).
> >
> > As you presently cannot from your computer, I guess its an Exim
> > configuration issue (which I know nothing about), but have you
> > configured it up for your computer, domain etc.?
>
>Ok, perhaps I should explain the server set up a bit more...
>This will end up being off topic for PHP I think but perhaps
>there is someone who may be able to help me (I will also post
>this information on the Exim mailing list I just discovered).
>
>sympatico.ca is a large internet provider which I have an
>ADSL connection through. Any sympatico.ca servers don't belong
>to me but to the provider.
>
>Off this ADSL connection is a BSD box which does my firewalling,
>etc. Behind that box is the web server which is called
>www.cell.dhs.org (cell.dhs.org being my domain). On this
>server is a Debian Linux box which runs Apache with PHP,
>the Exim mail server, etc.
>
>So, any idea what I could be missing from my configuration
>that would let me ping addresses nslookup them but not
>send mail to them?
>
>Any other questions/information needed?
>
>thx for the help!
>
> > Liam Gibbs wrote:
> >
> > >
> > >Ok, fair enough.
> > >
> > >Here are the full errors I get when I try to mail "[EMAIL PROTECTED]"
> > >(BTW, I'm doing it as root but I get the same errors no matter who
> > >I'm logged in as or if I do it through PHP):
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Liam Gibbs

Miles Thompson wrote:
> Unfortunately I discarded the earlier messages, so I don't know what your
> error is.

When I try to send an email I get:
unrouteable mail domain "anydomain.ca"

I can resend you the full error messages if you want.

> Do you have a fixed IP or do you have something like the Mpowered service
> where you're behind sympatico's NAT server?

I have a fixed IP address. My BSD box is using NAT to port forward
to the web server which sits behind it.

> Can you use exim to send mail from the console? Is sympatcio allowing this?

Sympatico allows it but I can't do it (I used to have another
box that did this but it got hacked and pretty much destroyed...)

> You may have to configure exim to use sympatico's SMTP server. (It's been
> so long since I've done that I forget how, and it was a real trial and
> error approach.)

I don't think I have to use their SMTP server. My old one (which used
Sendmail itself rather than Exim) was set up to act as it's own
SMTP server and worked well. I wish it hadn't been hacked *cries*

> This probably isn't much help - Miles Thompson

That's ok, at least you're trying. I've posted on other mail
lists and got nothing in return at all!

> PS You may want to post this on the nslug.ca list; some mail guru's read
> it. /mt

Cool, I'll check it.

ttyl.

> At 01:58 PM 7/4/2002 -0400, Liam Gibbs wrote:
> >Chris Hewitt wrote:
> > > I was going to ask you whether a normal user on your computer could send
> > > mail (OK, root counts). As the answer is no, it is not a problem with
> > > your php setup.
> > >
> > > sympatico.ca has several MX entries, the first of which is
> > > smtp26.bellglobal.com and I can ping that from here. I also get a
> > > response by telnetting to port 25. I conclude that I could send email to
> > > that address (whether the user would be accepted I don't know).
> > >
> > > As you presently cannot from your computer, I guess its an Exim
> > > configuration issue (which I know nothing about), but have you
> > > configured it up for your computer, domain etc.?
> >
> >Ok, perhaps I should explain the server set up a bit more...
> >This will end up being off topic for PHP I think but perhaps
> >there is someone who may be able to help me (I will also post
> >this information on the Exim mailing list I just discovered).
> >
> >sympatico.ca is a large internet provider which I have an
> >ADSL connection through. Any sympatico.ca servers don't belong
> >to me but to the provider.
> >
> >Off this ADSL connection is a BSD box which does my firewalling,
> >etc. Behind that box is the web server which is called
> >www.cell.dhs.org (cell.dhs.org being my domain). On this
> >server is a Debian Linux box which runs Apache with PHP,
> >the Exim mail server, etc.
> >
> >So, any idea what I could be missing from my configuration
> >that would let me ping addresses nslookup them but not
> >send mail to them?
> >
> >Any other questions/information needed?
> >
> >thx for the help!
> >
> > > Liam Gibbs wrote:
> > >
> > > >
> > > >Ok, fair enough.
> > > >
> > > >Here are the full errors I get when I try to mail "[EMAIL PROTECTED]"
> > > >(BTW, I'm doing it as root but I get the same errors no matter who
> > > >I'm logged in as or if I do it through PHP):

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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Miles Thompson

Liam,

Is "anydomain.ca" in exim's configuration file? Where did that come from?

And, you probably know much more about this than I do, but did you try 
those little validation exercises in exim's setup guide? I assume exim 
let's you send mail to yourself on the same box.

This ain't much help - Miles

At 02:21 PM 7/4/2002 -0400, Liam Gibbs wrote:
>Miles Thompson wrote:
> > Unfortunately I discarded the earlier messages, so I don't know what your
> > error is.
>
>When I try to send an email I get:
>unrouteable mail domain "anydomain.ca"
>
>I can resend you the full error messages if you want.
>
> > Do you have a fixed IP or do you have something like the Mpowered service
> > where you're behind sympatico's NAT server?
>
>I have a fixed IP address. My BSD box is using NAT to port forward
>to the web server which sits behind it.
>
> > Can you use exim to send mail from the console? Is sympatcio allowing this?
>
>Sympatico allows it but I can't do it (I used to have another
>box that did this but it got hacked and pretty much destroyed...)





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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Liam Gibbs

Miles Thompson wrote:
> 
> Liam,
> 
> Is "anydomain.ca" in exim's configuration file? Where did that come from?

I put "anydomain.ca" because if I try to mail any domain it fails. I was
using "sympatico.ca" when I was doing my testing.

I don't think I have any domains expilicitly in the exim configuration
file (I thought I had it configured to send to any domain
but I'll have to look into this a bit more before giving
a complete answer).

> And, you probably know much more about this than I do, but did you try
> those little validation exercises in exim's setup guide? 

No, I didn't even know they were there. Can you point me to the
web page they are on?

> I assume exim
> let's you send mail to yourself on the same box.

Yes, if I mail to a user on that box it works but I suspect that
that is because exim is smart enough to just stuff it directly
to that user's box rather than sending it out for a world trip.

> This ain't much help - Miles

Sure it is! If I take 100 small steps I'll get the equivalent of 
one big step!

ttyl.

> At 02:21 PM 7/4/2002 -0400, Liam Gibbs wrote:
> >Miles Thompson wrote:
> > > Unfortunately I discarded the earlier messages, so I don't know what your
> > > error is.
> >
> >When I try to send an email I get:
> >unrouteable mail domain "anydomain.ca"
> >
> >I can resend you the full error messages if you want.
> >
> > > Do you have a fixed IP or do you have something like the Mpowered service
> > > where you're behind sympatico's NAT server?
> >
> >I have a fixed IP address. My BSD box is using NAT to port forward
> >to the web server which sits behind it.
> >
> > > Can you use exim to send mail from the console? Is sympatcio allowing this?
> >
> >Sympatico allows it but I can't do it (I used to have another
> >box that did this but it got hacked and pretty much destroyed...)
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
 Blessed are they who can laugh at themselves for  
 they shall never cease to be amused.

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




[PHP] Re: returning more than 1 value from function

2002-07-04 Thread val petruchek

If you don't like arrays you can use objects:

function multireturn()
{
$result->first = "Ticket #1";
$result->second = "Ticket #2";

return $result;
}

--
Sincerely, val petruchek
"Andy" <[EMAIL PROTECTED]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi there,
>
> i am wondering if it is possible to return more than 1 value from a
> function?
>
> something like
>
> test(){
> return $value1, $value2
> }
>
> Thanx for any help,
>
> Andy
>
>



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




[PHP] PHP and XML Resources

2002-07-04 Thread CM

Can anyone recommend a good book or web page on php and xml?
The "Professional PHP4 XML" book by wrox looks good but I haven't read any
reviews on it.



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




[PHP] Re: Paradox Tables with PHP (Still the Same old Question)...

2002-07-04 Thread Kondwani Spike Mkandawire

Thanks I figured it out it was to do with configurations...
I was searching the wrong directory (do I ever feel dumb?!)...

Spike...
"Kondwani Spike Mkandawire" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hallo Folks
>
> I have come across this problem many times...  But still haven't
> seen anyone give a reasonably coherent solution...  I am trying
> to get my script to read Paradox Tables...  Its a no go so far...
> I do believe that this can be achieved via. odbc...  I have tried
> the configurations but have fallen short each time...  I keep getting
> the following Error:
>
>   Warning: SQL error: [Microsoft][ODBC Paradox
> Driver] The Microsoft Jet database engine could
> not find the object 'Test.db'. Make sure the object
> exists and that you spell its name and the path
> name correctly.,
>
> There has to be someone in this Forum who has successfully worked
> with Paradox Tables in conjunction with php...  Do I have to
> download another version of ODBC...  My Scripts have no
> issues reading MSAccess tables the problem is when it gets
> to Paradox...
>
>
> Please Help...
>
> Spike...
>
>



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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Chris Hewitt

Liam Gibbs wrote:

>Miles Thompson wrote:
>
>>Can you use exim to send mail from the console? Is sympatcio allowing this?
>>
>Sympatico allows it but I can't do it (I used to have another
>box that did this but it got hacked and pretty much destroyed...)
>
One quick test is to set up an email client (Netscape whatever) to talk 
to sympatico's smtp server directly (leaving out your exim server). If 
you can send mail from this then permissions to send are OK, and we look 
around the Exim configuration.

>>You may have to configure exim to use sympatico's SMTP server. (It's been
>>so long since I've done that I forget how, and it was a real trial and
>>error approach.)
>>
>I don't think I have to use their SMTP server. My old one (which used
>Sendmail itself rather than Exim) was set up to act as it's own
>SMTP server and worked well. I wish it hadn't been hacked *cries*
>
True, but you will need one that allows you to connect. As I'm on a 
dialup line here, I use my isp's servers in case I'm not on line 
(receiving) and to save me the time in connecting directly to the 
recipient (sending). As you are behind a firewall, your host name will 
probably not be resolvable and that may have a problem. I suggest you 
try setting your isp's smtp server as the smart-host (sendmail term, 
don't know what exim calls it) and give it a try. If you used to use 
sendmail, do you still have the working sendmail.cf file? If so that 
will give you most of the information you need.

Hope this helps.
Chris


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




[PHP] FTP routine

2002-07-04 Thread Jose Arce

Hi, i'm making a script to donwload files from a ftp server to the server 
hosting the script, but i don't know how to download all the files from a 
directory. I'm using the file system functions to conect to the ftp server, 
because the ftp functions in php does not always work, and, actually  they 
suck

@fputs($conexion,"RETR file.zip\r\n");
echo @fgets($conexion,256);
echo "" ;

I think that works, but i don't know how to retrive all the files from a 
directory. Also (ppff!! thats a lot of questions) some people say i can 
resume these downloads when i use fsockopen...is that true?. Oh yes, i 
almost forgot, when downloading large files, the script dies, is there a 
chance to let the script die, but the process can go on, and when it's 
finished send a email or something telling me that it transfer the files?

Thx :D

PD: English is not my languaje, sorry ñ_ñ


_
MSN. Más Útil cada Día. http://www.msn.es/intmap/


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




Re: [PHP] Exim sendmail faults

2002-07-04 Thread Liam Gibbs

Chris Hewitt wrote:
> >>Can you use exim to send mail from the console? Is sympatcio allowing this?
> >>
> >Sympatico allows it but I can't do it (I used to have another
> >box that did this but it got hacked and pretty much destroyed...)
> >
> One quick test is to set up an email client (Netscape whatever) to talk
> to sympatico's smtp server directly (leaving out your exim server). If
> you can send mail from this then permissions to send are OK, and we look
> around the Exim configuration.

I have several Windows machines behind the firewall too which
are able to do this so it must be Exim's configuration.

> >>You may have to configure exim to use sympatico's SMTP server. (It's been
> >>so long since I've done that I forget how, and it was a real trial and
> >>error approach.)
> >>
> >I don't think I have to use their SMTP server. My old one (which used
> >Sendmail itself rather than Exim) was set up to act as it's own
> >SMTP server and worked well. I wish it hadn't been hacked *cries*
> >
> True, but you will need one that allows you to connect. As I'm on a
> dialup line here, I use my isp's servers in case I'm not on line
> (receiving) and to save me the time in connecting directly to the
> recipient (sending). As you are behind a firewall, your host name will
> probably not be resolvable and that may have a problem. 

I think my host does resolve properly because if you type
www.cell.dhs.org
into a web browser from an external machine it brings up the default
web page on my server.

> I suggest you
> try setting your isp's smtp server as the smart-host (sendmail term,
> don't know what exim calls it) and give it a try. 

Ok, I'll try that out when I get home.

> If you used to use
> sendmail, do you still have the working sendmail.cf file? If so that
> will give you most of the information you need.

I may still have it. I'll have to check.

thx for the help!

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




Re: [PHP] FTP routine

2002-07-04 Thread Danny Shepherd

Not really a PHP question - more an FTP protocol question - try reading the
FTP RFC at http://www.ietf.org/rfc/rfc959.txt

However, in a nutshell, to get all of the files in a directory -

1. get a listing of that directory (read the RFC for instructions) and store
the filenames in an array.
2. go through the array using a foreach - to 'RETR' each file.

HTH

Danny.


- Original Message -
From: "Jose Arce" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 04, 2002 8:33 PM
Subject: [PHP] FTP routine


> Hi, i'm making a script to donwload files from a ftp server to the server
> hosting the script, but i don't know how to download all the files from a
> directory. I'm using the file system functions to conect to the ftp
server,
> because the ftp functions in php does not always work, and, actually  they
> suck
>
> @fputs($conexion,"RETR file.zip\r\n");
> echo @fgets($conexion,256);
> echo "" ;
>
> I think that works, but i don't know how to retrive all the files from a
> directory. Also (ppff!! thats a lot of questions) some people say i can
> resume these downloads when i use fsockopen...is that true?. Oh yes, i
> almost forgot, when downloading large files, the script dies, is there a
> chance to let the script die, but the process can go on, and when it's
> finished send a email or something telling me that it transfer the files?
>
> Thx :D
>
> PD: English is not my languaje, sorry ñ_ñ
>
>
> _
> MSN. Más Útil cada Día. http://www.msn.es/intmap/
>
>
> --
> 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] Exim sendmail faults

2002-07-04 Thread Chris Hewitt

Liam Gibbs wrote:

>Chris Hewitt wrote:
>
>>One quick test is to set up an email client (Netscape whatever) to talk
>>to sympatico's smtp server directly (leaving out your exim server). If
>>you can send mail from this then permissions to send are OK, and we look
>>around the Exim configuration.
>>
>
>I have several Windows machines behind the firewall too which
>are able to do this so it must be Exim's configuration.
>
OK so routing and mail permissions are OK.

>
>I think my host does resolve properly because if you type
>www.cell.dhs.org
>into a web browser from an external machine it brings up the default
>web page on my server.
>
Yep. Hey, it the same as mine (when I'm on)!

>>If you used to use
>>sendmail, do you still have the working sendmail.cf file? If so that
>>will give you most of the information you need.
>>
>I may still have it. I'll have to check.
>
If so, maybe you want to go back to sendmail (not that I'm knocking 
exim). Some of the guys on the redhat-install-list are good email setup 
people if you don't get joy on the exim list.

>
>thx for the help!
>
You are welcome to my small bit of knowledge. Sorry to everyone else 
that this has got quite OT.

Chris



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




Re: [PHP] Annoying syntax problem with RTRIM

2002-07-04 Thread René Fournier

Actually I did see the "4.1.0", but mis-read it thinking "4.0.1"  (I 
did read the manual, just not carefully enough. (Thank you, Mr. Wong, 
for your helpful reply.))

Anyways, I came up with a workaround until my ISP upgrades PHP:

$str = rtrim($str);
if (substr($str,-1) == ",") { $str = substr($str,0,-1); }

Seems to work okay.

...Rene

On Thursday, July 4, 2002, at 01:45  PM, Paul Roberts wrote:

> string rtrim ( string str [, string charlist])
>
> Note: The second parameter was added in PHP 4.1.0
> 
> ^hint
> get them to upgrade php for you.
>
> Paul Roberts
> [EMAIL PROTECTED]
> 
> - Original Message -
> From: "René Fournier" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 04, 2002 6:00 PM
> Subject: Re: [PHP] Annoying syntax problem with RTRIM
>
>
> I did. It didn't help. (That's why I posted this message.)
>
> On Thursday, July 4, 2002, at 10:47  AM, Jason Wong wrote:
>
>> On Friday 05 July 2002 00:41, René Fournier wrote:
>>> echo rtrim($feat,", ");
>>>
>>> On my local Apache-OSX web server (PHP 4.1.2), this command works 
>>> fine.
>>> (The reason I use it is that sometimes $feat contains a comma and a
>>> space at the end of the string, which I want to remove (if it's there)
>>> before echoing.)
>>>
>>> When this same script is run on my ISP (PHP 4.0.6), I get the 
>>> following
>>> error message:
>>>
>>> Warning:  Wrong parameter count for rtrim() in
>>> /u/htdocs/smarts/jupiter/callisto/include/create.inc on line
>>> 216
>>>
>>>
>>> Any ideas why?
>>
>> RTFM!
>>
>> --
>> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>> Open Source Software Systems Integrators
>> * Web Design & Hosting * Internet & Intranet Applications Development *
>>
>> /*
>> The heart is wiser than the intellect.
>> */
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>
---
René Fournier,
[EMAIL PROTECTED]

Toll-free +1.888.886.2754
Tel +1.403.291.3601
Fax +1.403.250.5228
www.smartslitters.com

SmartSlitters International
#33, 1339 - 40th Ave NE
Calgary AB  T2E 8N6
Canada
>
>
> --
> 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




  1   2   >