Re: [PHP] List Etiquette

2004-09-21 Thread Octavian Rasnita
No, there is no way for customizing the headers Outlook Express use to put
in the email messages.
I wish there was, because I don't like them also...

Teddy

- Original Message - 
From: - Edwin - [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 20, 2004 2:51 PM
Subject: Re: [PHP] List Etiquette


 Hi,

 On Mon, 20 Sep 2004 04:01:47 +0300
 Octavian Rasnita [EMAIL PROTECTED] wrote:
  My email client (Outlook Express) puts a lot of information
  at the top of the message automaticly, like:
 
  The signature,
  --- original message ---
  The From line
  - The to line
  - The date line
  - The subject line.

 There should be a way to customize that, no?


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



[PHP] transfer coding

2004-09-21 Thread QT
Dear Sirs,

I gave a post problem and can't solve last a couple of weeks. Todays I come
some point but need to ask some thing.

I have a destination server and configured to receive some datas. Owner of
the server gives the same name of the different data. His idea is that let
the internet explorer encode same name data and send to his server with
following code;

tr
  tdData 1:/td
  tdinput type=text name=data /td
/tr
tr
  tdData 2:/td
  tdinput type=text name=data /td
/tr
tr
  tdData 3:/td
  tdinput type=text name=data /td
/tr

As you see, three field has the same name as data

When I use this html with internet explorer, I have no problem to post data.
But when I use following post method, I can not send data. I think I need to
do something more for message transfer coding such as use some charecter
between same data to let destination server understand. I try to find some
solution from HTTP Messages - RFC2616 but no result.

Any idea?

$str = data=$data1|$data2|$data3;

$p = POST /httppp/servlet/ppp HTTP/1.0\r\n;
  $p.= Host: 152.31.228.206\r\n;
  $p.= Content-type: application/x-www-form-urlencoded\r\n;
  //$p .= \r\n; //erorr
  $p.= Content-length: $len\r\n;
  $p.= \r\n;
  $p.= $str\r\n;
 // $p.= \r\n;
$server = 152.31.228.206;
$connection_timeout = 10;
$fp = fsockopen ($server, 80, $errno, $errstr, $connection_timeout);

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



[PHP] HTML Frames and PHP Sessions

2004-09-21 Thread Nick Patsaros
Are PHP sessions compatible with frames in HTML?  I'm trying to pass a
user name through a session and my individual frames aren't receiving
the variable.  It worked prior to migrating to frames so I don't think
it's my PHP that is the problem.  Is there a target function somehow
or some way to pass it down from the _top frame to an individual frame
or frames?

Any help is appreciated and I offer thanks in advance.

--Nick

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



Re: [PHP] php5 and php4?

2004-09-21 Thread Zeev Suraski
At 08:29 21/09/2004, Minuk Choi wrote:
I've been meaning to ask this... but I always thought I could find the 
answer online(I didn't).  Back when PHP 5.0.1 was released, PHP 
4.something else was released.

What was the main reasoning behind this move?  Is it because PHP5 is more 
OOP(similar to java)?
PHP 4 is currently in maintenance mode.  Generally it only means that there 
will be bugfix releases for it, without any new features.  It might be 
possible that we'll release a PHP 4 version with a couple of new features 
at some point for people who don't upgrade, but they won't be major.

The reason for releasing these releases based on the 4 tree is to allow 
users who don't wish to upgrade (which at the very least requires some QA 
to make sure nothing went wrong, and in some cases requires some code 
adjustments) the ability to stick with the old codebase, and take a very 
low risk with a bugfix release.

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


Re: [PHP] problem with header-dispotition in IE

2004-09-21 Thread Marek Kilimajer
adwinwijaya wrote:
The error that I got just IE cannot download download.php from
mysite.com .. IE was not able to open this site and bla bla bla. No
hint in the error.
I think the problem that I faced is with SSL.
I try http://www.wazzup.co.nz/tutorials/protect_pdf/index.php
and it didnt work on my web
Why IE cannot work with SSL mode to download file ?
Is there any solution ?
Are you using session? Then you need to use
session_cache_limiter('private_no_expire');
before starting the session.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Parsing a File

2004-09-21 Thread Harlequin
Hi all.

I've been through the PHP manual and wonder which file option will best suit 
my needs.

I basically want to take a file that the user uploads and parse it into a 
variable or string so I can insert it into a field in my database.

Do I use:

File()
file_get_contents

Or something else...?



-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
- 

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



Re: [PHP] HTML Frames and PHP Sessions

2004-09-21 Thread Marek Kilimajer
Nick Patsaros wrote:
Are PHP sessions compatible with frames in HTML?  I'm trying to pass a
user name through a session and my individual frames aren't receiving
the variable.  It worked prior to migrating to frames so I don't think
it's my PHP that is the problem.  Is there a target function somehow
or some way to pass it down from the _top frame to an individual frame
or frames?
Sessions work with frames. It has to be something else.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] transfer coding

2004-09-21 Thread Marek Kilimajer
QT wrote:
When I use this html with internet explorer, I have no problem to post data.
But when I use following post method, I can not send data. I think I need to
do something more for message transfer coding such as use some charecter
between same data to let destination server understand. I try to find some
solution from HTTP Messages - RFC2616 but no result.
Any idea?
$str = data=$data1|$data2|$data3;
Try $str = data=$data1data=$data2data=$data3;
$p = POST /httppp/servlet/ppp HTTP/1.0\r\n;
  $p.= Host: 152.31.228.206\r\n;
  $p.= Content-type: application/x-www-form-urlencoded\r\n;
  //$p .= \r\n; //erorr
  $p.= Content-length: $len\r\n;
  $p.= \r\n;
  $p.= $str\r\n;
 // $p.= \r\n;
$server = 152.31.228.206;
$connection_timeout = 10;
$fp = fsockopen ($server, 80, $errno, $errstr, $connection_timeout);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] file creation date

2004-09-21 Thread Joerg P
hello,
is it possible, to get the creation date of a file? So even if it's 
modified, to get the date it was created the first time?

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


Re: [PHP] Parsing a File

2004-09-21 Thread Marek Kilimajer
Harlequin wrote:
Hi all.
I've been through the PHP manual and wonder which file option will best suit 
my needs.

I basically want to take a file that the user uploads and parse it into a 
variable or string so I can insert it into a field in my database.

Do I use:
File()
creates an array
file_get_contents
is best suited.
However, the best solution is to store the file on the filesystem and 
keep only the filename in the database.

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


[PHP] Lock or critical section

2004-09-21 Thread Jean-Yves
Hi,

Is there a documented way to create in PHP a critical section: I want a 
piece of code to not be executed in the same time several times?

Thanks in advance !

Kind regards,

Jean-Yves
http://www.j2s.net
--

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



Re: [PHP] Lock or critical section

2004-09-21 Thread Skippy
Quoting Jean-Yves [EMAIL PROTECTED]:
 Is there a documented way to create in PHP a critical section: I want a 
 piece of code to not be executed in the same time several times?

Give us a set of criteria and we'll see about it.

-- 
Romanian Web Developers - http://ROWD.ORG

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



Re: [PHP] Lock or critical section

2004-09-21 Thread Marek Kilimajer
Jean-Yves wrote:
Hi,
Is there a documented way to create in PHP a critical section: I want a 
piece of code to not be executed in the same time several times?
www.php.net/flock
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: transfer coding

2004-09-21 Thread M. Sokolewicz
Qt wrote:
Dear Sirs,
I gave a post problem and can't solve last a couple of weeks. Todays I come
some point but need to ask some thing.
I have a destination server and configured to receive some datas. Owner of
the server gives the same name of the different data. His idea is that let
the internet explorer encode same name data and send to his server with
following code;
tr
  tdData 1:/td
  tdinput type=text name=data /td
/tr
tr
  tdData 2:/td
  tdinput type=text name=data /td
/tr
tr
  tdData 3:/td
  tdinput type=text name=data /td
/tr
As you see, three field has the same name as data
When I use this html with internet explorer, I have no problem to post data.
But when I use following post method, I can not send data. I think I need to
do something more for message transfer coding such as use some charecter
between same data to let destination server understand. I try to find some
solution from HTTP Messages - RFC2616 but no result.
Any idea?
$str = data=$data1|$data2|$data3;
$p = POST /httppp/servlet/ppp HTTP/1.0\r\n;
  $p.= Host: 152.31.228.206\r\n;
  $p.= Content-type: application/x-www-form-urlencoded\r\n;
  //$p .= \r\n; //erorr
  $p.= Content-length: $len\r\n;
  $p.= \r\n;
  $p.= $str\r\n;
 // $p.= \r\n;
$server = 152.31.228.206;
$connection_timeout = 10;
$fp = fsockopen ($server, 80, $errno, $errstr, $connection_timeout);
actually, specifying the same name for all 3 just makes PHP overwrite 
the string each time it notices a new one. So you'll only recieve one of 
those 3 data fields. Easiest to get around that is to call them each 
data[]. That will cause PHP to interpret it as an array, and you'll 
have all your data stored in $_POST['data'][0], $_POST['data'][1] and 
$_POST['data'][2].

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


Re: [PHP] Re: transfer coding

2004-09-21 Thread Marek Kilimajer
M. Sokolewicz wrote:
$p = POST /httppp/servlet/ppp HTTP/1.0\r\n;
actually, specifying the same name for all 3 just makes PHP overwrite 
the string each time it notices a new one. 
It's posted to jsp, not php.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Weird characters output

2004-09-21 Thread Christophe Chisogne
Wouter van Vliet wrote:
characters are being replaced by weird characters. EG: the ' single
quote is being replaced by a question mark
First check you use iso-8859-1 (latin-1) as encoding everywhere,
unless you really want to use unicode (utf-8 encoding):
- in html pages generated from php
  meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
- as mysql default encoding (see mysql doc)
- as apache default encoding for html pages served (see previous post)
The single quote (') is probably not the standard ascii one,
but the dumb Micro$oft 'smart quote', which uses a code
defined in windows charset 1252, but not in Latin1 (iso-8859-1),
ie in range \x80-\x9f (128-159). See [6] -- search for cp1252
Problem come from not respecting standards (latin-1 encoding),
by example when a user fills a html form by cutpaste from M$-word :(
To avoid this, all user supplied datas must be validated,
by first removing/translating invalid chars.
Solution is to convert invalid chars to valid ones.
On a unix/linux/bsd box, perhaps man tr and info recode can help.
Or the cp1252 to Unicode table [5], with interesting bits below
(invalid latin1 chars). This can help you write conversion functions,
like I did for cp1252 to utf8 html (unicode) in [6] with strtr.
0x800x20AC  #EURO SIGN
0x81#UNDEFINED
0x820x201A  #SINGLE LOW-9 QUOTATION MARK
0x830x0192  #LATIN SMALL LETTER F WITH HOOK
0x840x201E  #DOUBLE LOW-9 QUOTATION MARK
0x850x2026  #HORIZONTAL ELLIPSIS
0x860x2020  #DAGGER
0x870x2021  #DOUBLE DAGGER
0x880x02C6  #MODIFIER LETTER CIRCUMFLEX ACCENT
0x890x2030  #PER MILLE SIGN
0x8A0x0160  #LATIN CAPITAL LETTER S WITH CARON
0x8B0x2039  #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
0x8C0x0152  #LATIN CAPITAL LIGATURE OE
0x8D#UNDEFINED
0x8E0x017D  #LATIN CAPITAL LETTER Z WITH CARON
0x8F#UNDEFINED
0x90#UNDEFINED
0x910x2018  #LEFT SINGLE QUOTATION MARK
0x920x2019  #RIGHT SINGLE QUOTATION MARK
0x930x201C  #LEFT DOUBLE QUOTATION MARK
0x940x201D  #RIGHT DOUBLE QUOTATION MARK
0x950x2022  #BULLET
0x960x2013  #EN DASH
0x970x2014  #EM DASH
0x980x02DC  #SMALL TILDE
0x990x2122  #TRADE MARK SIGN
0x9A0x0161  #LATIN SMALL LETTER S WITH CARON
0x9B0x203A  #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
0x9C0x0153  #LATIN SMALL LIGATURE OE
0x9D#UNDEFINED
0x9E0x017E  #LATIN SMALL LETTER Z WITH CARON
0x9F0x0178  #LATIN CAPITAL LETTER Y WITH DIAERESIS
Some references:
Code Pages Supported by Windows
[1] http://www.microsoft.com/globaldev/reference/wincp.mspx
Microsoft Windows Codepage : 1252 (Latin I)
[2] http://www.microsoft.com/globaldev/reference/sbcs/1252.htm
Latin 1 (1252)
[3] http://www.microsoft.com/typography/unicode/1252.htm
Latin 1 (1252) Graphic representation
[4] http://www.microsoft.com/typography/unicode/1252.gif
cp1252 to Unicode table
[5] ftp://ftp.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT
[6] strtr comments
http://www.php.net/manual/en/function.strtr.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Correct context

2004-09-21 Thread Burhan Khalid
Ed Curtis wrote:
Before I go screwing this code up I thought I would ask for the
formatting. How would you write the following in PHP?
if $entry not equal to Copy Change
OR
Banner Change
OR
Price Change
AND
$row['photo_check'] not equal to 
$valid_values = array(Copy Change,Banner Change,Price Change);
if (!in_array($entry,$valid_values)  !empty($row['photo_check']))
{
  //do something
}
Please, RTM on basic syntax and conditional statements.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: **[SPAM]** [PHP] file creation date

2004-09-21 Thread Jay Blanchard
[snip]
is it possible, to get the creation date of a file? So even if it's 
modified, to get the date it was created the first time?
[/snip]

Reading http://www.php.net/stat I don't think so.

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



[PHP] Re: HTML Frames and PHP Sessions

2004-09-21 Thread Thomas Seifert
On Tue, 21 Sep 2004 04:02:47 -0400, Nick Patsaros wrote:

 Are PHP sessions compatible with frames in HTML?  I'm trying to pass a
 user name through a session and my individual frames aren't receiving
 the variable.  It worked prior to migrating to frames so I don't think
 it's my PHP that is the problem.  Is there a target function somehow
 or some way to pass it down from the _top frame to an individual frame
 or frames?
 
 Any help is appreciated and I offer thanks in advance.

probably you are loading the other frames *before* the given frame sets
the username.


thomas

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



Re: [PHP] RE: **[SPAM]** [PHP] file creation date

2004-09-21 Thread Marek Kilimajer
Jay Blanchard wrote:
[snip]
is it possible, to get the creation date of a file? So even if it's 
modified, to get the date it was created the first time?
[/snip]

Reading http://www.php.net/stat I don't think so.
Unix filesystems don't store file creation time. And there is no 
function to retrieve creation time in windows. You might be able to 
parse the output of dir command.

To Jay: Could you please remove **[SPAM]** when replying? Your mail 
client doesn't send references headers and that spam string breaks 
threading completely.

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


RE: [PHP] RE: file creation date

2004-09-21 Thread Jay Blanchard
[snip]
To Jay: Could you please remove **[SPAM]** when replying? Your mail 
client doesn't send references headers and that spam string breaks 
threading completely.
[/snip]

Will do...gotta' get the network dude to remove that

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



Re: [PHP] Lock or critical section

2004-09-21 Thread Jean-Yves
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Marek Kilimajer) wrote:

 Jean-Yves wrote:
  Hi,
  
  Is there a documented way to create in PHP a critical section: I want a 
  piece of code to not be executed in the same time several times?
 
 www.php.net/flock

Yes Marek, that's what I'm looking for. I can use that mechanism.

Thank-you.

Kind regards.

Jean-Yves
http://www.j2s.net
--

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



Re: [PHP] Lock or critical section

2004-09-21 Thread Jean-Yves
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Skippy) wrote:

 Quoting Jean-Yves [EMAIL PROTECTED]:
  Is there a documented way to create in PHP a critical section: I want a 
  piece of code to not be executed in the same time several times?
 
 Give us a set of criteria and we'll see about it.

I want to do something like that :

LOCK

code

UNLOCK

The first user locks and runs the code. If another user tries to run the 
code before the lock is off, he is blocked.

Perhaps I can use the flock mechanism!

Thanks.

Kind regards, 

Jean-Yves
http://www.j2s.net
--

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



[PHP] Install Headaches

2004-09-21 Thread bbonkosk
Hello All,

I've had this problem for a little while now.  
I am building PHP as an Apache shared Module, so my configure looks something like 
this:
./configure --with-mysql=.. --with-pgsql=.. --with-gd --with-apxs=..

This works fine, builds fine, but when I run make install, it freezes.
HOST php-5.0.1 # make install
Installing PHP SAPI module:   apache
This is the point it freezes

My only workaround has been to remove the whole Apache install, and then re-build a 
fresh apache, a fresh PHP and then run make install which works fine.
There has got to be a better way, and/or something I am missing here.  Any ideas?

Thanks!
-Brad

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



[PHP] unexpected $ error

2004-09-21 Thread luke
hi,

i get the following error when trying to run this code (see below):

Parse error: parse error, unexpected $ in /full path form.php on line 59

i have checked for unclosed braces - none - and tried uploading the files in
ascii format just in case but get the same same error.

i have searched many forums but still haven't solved it.

the include file just looks like this:

?php

/*
Title: xx Database Connection String
Author: Luke Mackenzie
Date: 18/09/04
*/

@mysql_connect(xx,x,xxx)
or die(Could not connect to MYSQL server);

?

this is driving me nuts so if anyone can help, i'd be really grateful.

thanks,

lukemack.

code follows..

?php

/*
TITLE: Inmarsat Form handling script
AUTHOR: Luke Mackenzie
DATE: 18/09/04

*/


// if the submit buttons has been pressed
if (isset($_POST['submit]))
{

//connect to the server and select the database

include mysql.connect.php;// include the connection details

@mysql_select_db(inmarsat_comp) or die (Could not select Database);



// retrieve the posted information from the form

$firstname = $_POST[first_name];
$lastname = $_POST[last_name];
$jobtitle = $_POST[job_title];
$company = $_POST[company];
$address1 = $_POST[address1];
$address2 = $_POST[address2];
$address3 = $_POST[address3];
$city = $_POST[city];
$county = $_POST[state];
$postcode = $_POST[postcode];
$telcode = $_POST[telephone_cc];
$telnumber = $_POST[telephone_no];
$faxcode = $_POST[fax_cc];
$faxnumber = $_POST[fax_no];
$email = $_POST[email_address];
foreach($_POST[markets1] AS $enterprise);
$distribute = $_POST[OKToDistr];
$market = $_POST[OKToMarket];



//insert the form information into the database

$query = INSERT INTO inmarsat_comp SET firstname=$firstname,
lastname=$lastname;;

$result =mysql_query($query); // run the query
}
//display an appropriate message
if ($result) echo pForm Data Successfully inserted!/p;
else echo p There was a problem inserting the form Data!/p;

mysql_close();


?

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



RE: [PHP] unexpected $ error

2004-09-21 Thread Jay Blanchard
[snip]
[snip]
// if the submit buttons has been pressed
if (isset($_POST['submit]))
{
[/snip]

Missing the second single-quote in $_POST['submit']

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



Re: [PHP] unexpected $ error

2004-09-21 Thread bbonkosk
if (isset($_POST['submit]))

(missing close apostrophe here...)
if (isset($_POST['submit']))
- not sure if this is THE problem, but A problem for sure.
-Brad

- Original Message -
From: [EMAIL PROTECTED]
Date: Tuesday, September 21, 2004 8:36 am
Subject: [PHP] unexpected $ error

 hi,
 
 i get the following error when trying to run this code (see below):
 
 Parse error: parse error, unexpected $ in /full path form.php on 
 line 59
 
 i have checked for unclosed braces - none - and tried uploading 
 the files in
 ascii format just in case but get the same same error.
 
 i have searched many forums but still haven't solved it.
 
 the include file just looks like this:
 
 ?php
 
 /*
 Title: xx Database Connection String
 Author: Luke Mackenzie
 Date: 18/09/04
 */
 
 @mysql_connect(xx,x,xxx)
 or die(Could not connect to MYSQL server);
 
 ?
 
 this is driving me nuts so if anyone can help, i'd be really grateful.
 
 thanks,
 
 lukemack.
 
 code follows..
 
 ?php
 
 /*
 TITLE: Inmarsat Form handling script
 AUTHOR: Luke Mackenzie
 DATE: 18/09/04
 
 */
 
 
 // if the submit buttons has been pressed
 if (isset($_POST['submit]))
 {
 
 //connect to the server and select the database
 
 include mysql.connect.php;// include the connection details
 
 @mysql_select_db(inmarsat_comp) or die (Could not select 
 Database);
 
 
 // retrieve the posted information from the form
 
 $firstname = $_POST[first_name];
 $lastname = $_POST[last_name];
 $jobtitle = $_POST[job_title];
 $company = $_POST[company];
 $address1 = $_POST[address1];
 $address2 = $_POST[address2];
 $address3 = $_POST[address3];
 $city = $_POST[city];
 $county = $_POST[state];
 $postcode = $_POST[postcode];
 $telcode = $_POST[telephone_cc];
 $telnumber = $_POST[telephone_no];
 $faxcode = $_POST[fax_cc];
 $faxnumber = $_POST[fax_no];
 $email = $_POST[email_address];
 foreach($_POST[markets1] AS $enterprise);
 $distribute = $_POST[OKToDistr];
 $market = $_POST[OKToMarket];
 
 
 
 //insert the form information into the database
 
 $query = INSERT INTO inmarsat_comp SET firstname=$firstname,
 lastname=$lastname;;
 
 $result =mysql_query($query); // run the query
 }
 //display an appropriate message
 if ($result) echo pForm Data Successfully inserted!/p;
 else echo p There was a problem inserting the form Data!/p;
 
 mysql_close();
 
 
 ?
 
 -- 
 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] unexpected $ error

2004-09-21 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote:
hi,
i get the following error when trying to run this code (see below):
Parse error: parse error, unexpected $ in /full path form.php on line 59
// if the submit buttons has been pressed
if (isset($_POST['submit]))
missing single quote
if (isset($_POST['submit']))
// more code
foreach($_POST[markets1] AS $enterprise);
The foreach loop is pointless.
$distribute = $_POST[OKToDistr];
$market = $_POST[OKToMarket];

//insert the form information into the database
$query = INSERT INTO inmarsat_comp SET firstname=$firstname,
lastname=$lastname;;
Unescaped double quotes in double quoted string. Change them to sigle 
quotes and you are done.

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


Re: [PHP] Fork PHP script X at a time.

2004-09-21 Thread John Wards
Not sure if anyone is interested in what I have come up with, its busy
running just now but it seems to be performing ok.

$do =0;
$ok =0;
$count=0;

while($do!=1){
if($ok==0){
$sql = SELECT * FROM locations WHERE parent = '0' AND doing=0 and 
done !=1 ORDER BY num DESC LIMIT 0 , 1;
$res = mysql_query($sql) or die ($sql.mysql_error());
while($_data = mysql_fetch_array($res)){
$id = $county_data[id];
$sql2 = UPDATE locations SET doing = 1 WHERE id= '$id' AND 
siteid=1 AND parent = '0';
$res3 = mysql_query($sql2);
exec(/usr/local/bin/php fork.php .$data[id].  /dev/null 
);
}
}
$sql = SELECT * FROM locations WHERE parent = '0' AND doing=1 AND done=0;
$res = mysql_query($sql);
$oknumber = mysql_num_rows($res);
if($oknumber == 5) $ok=1;
else $ok=0;

$sql = SELECT * FROM locations WHERE parent = '0' AND done=0;
$res2 = mysql_query($sql);
$donumber = mysql_num_rows($res2);
if($donumber==0) $do=1;
}

In my fork.php script I set it to done=1 and doing = 0 once it has
finished.

This is pretty rough and ready and as my shell account won't let me do a
top i can't tell what sort of drain my loop is having on the system,
but hopefully it will be ok.

Just thought it might be an idea to post up this solution in-case
someone else has the same problem.

John
On Mon, 2004-09-20 at 16:36, John Wards wrote:
 Hi, I have a bit of a cold today so I probably would have figured this
 out for myself eventually but hey ;-)
 
 Right I have a script that I need to run around 90 times thru a cron job
 but passing a different i.d. to it each time.
 
 I have experimented with running all 90 at once and its a no go as it
 just makes the server run to slow and the session cookies I use time out
 (I am doing some libcurl things).
 
 Also running them in a loop one at a time is no use because it takes
 about 8 hours.
 
 What I would like to do is fork off say 5-10 at a time and when one is
 done start another one in its place, as they all take different length
 of times to compleate.
 
 Any clues at where to start? Here is my fork all 90+ code...
 
 
 $sql = SELECT * FROM locations WHERE parent = '0';
 $res = mysql_query($sql) or die ($sql.mysql_error());
 while($data = mysql_fetch_array($res)){
   exec(/usr/local/bin/php fork.php .$_data[id].  /dev/null );
 }
 
 Cheers
 John Wards

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



Re: [PHP] Re: HTML Frames and PHP Sessions

2004-09-21 Thread Nick Patsaros
I think I figured it out.  I was calling the session_start() in the
frames window instead of in each individual frame.  Silly mistake,
thanks for the help.

--Nick


On Tue, 21 Sep 2004 13:45:08 +0200, Thomas Seifert
[EMAIL PROTECTED] wrote:
 
 
 On Tue, 21 Sep 2004 04:02:47 -0400, Nick Patsaros wrote:
 
  Are PHP sessions compatible with frames in HTML?  I'm trying to pass a
  user name through a session and my individual frames aren't receiving
  the variable.  It worked prior to migrating to frames so I don't think
  it's my PHP that is the problem.  Is there a target function somehow
  or some way to pass it down from the _top frame to an individual frame
  or frames?
 
  Any help is appreciated and I offer thanks in advance.
 
 probably you are loading the other frames *before* the given frame sets
 the username.
 
 
 thomas
 
 
 
 --
 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] php parses but no data inserted

2004-09-21 Thread luke
hi there,

the following code runs but no message is displayed from the if then else
statement at the end of the script. also, nothing is written to the database.
i have checked the insert statement and the login credentials are correct.does
anyone know what might be causing this?

thanks,

lukemack.


?php

/*
TITLE: Inmarsat Form handling script
AUTHOR: Luke Mackenzie
DATE: 18/09/04

*/
error_reporting(E_ALL);

// if the submit buttons has been pressed
if (isset($_POST['submit'])){


//connect to the server and select the database


include mysql.connect.php;// include the connection details


@mysql_select_db(inmarsat_comp) or die (Could not select Database);



// retrieve the posted information from the form

$firstname = $_POST[first_name];
$lastname = $_POST[last_name];
$jobtitle = $_POST[job_title];
$company = $_POST[company];
$address1 = $_POST[address1];
$address2 = $_POST[address2];
$address3 = $_POST[address3];
$city = $_POST[city];
$county = $_POST[state];
$postcode = $_POST[postcode];
$telcode = $_POST[telephone_cc];
$telnumber = $_POST[telephone_no];
$faxcode = $_POST[fax_cc];
$faxnumber = $_POST[fax_no];
$email = $_POST[email_address];
foreach($_POST[markets1] AS $enterprise);
$distribute = $_POST[OKToDistr];
$market = $_POST[OKToMarket];



//insert info into query string

$query = INSERT INTO inmarsat_comp SET firstname='$firstname',
lastname='$lastname';

//run the query

$result = mysql_query($query); 


if ($result) echo pForm Data Successfully inserted!/p;
else echo p There was a problem inserting the form Data!/p;

mysql_close();
}

?

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



[PHP] How do I send XML attributes via Soap?

2004-09-21 Thread Yoed Anis
Hi,

I'm having trouble sending a request containing XML attributes in a soap
request.

I don't know how to go about doing it.

Previously to pass XML as a soap request from my client to the server I
would go throw the following steps:

(1) Create the XML string. (i.e xmlstr = XML propertiesproperty id =
10/property/properties XML;)

(2) Than I would make it an xml object:
$xml = simplexml_load_string($xmlstr);

(3) Next convert it to an xml complex type for the server
$xml1 = new SoapVar($xml, SOAP_ENC_OBJECT, xml, http://thenamespace); 

(4) Send the request:
$client-SoapCall(new SoapParam($xml1, ));

However when I do a $client-__getLastRequest(), I get:
 PropertiesProperty/Property/Properties

The Property field is coming up blank in the request with no attributes.

How would I go about sending it so the attributes are there?
Any help would be appreciated. I'm really stumped on this one.

Best,
Yoed

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



Re: [PHP] php parses but no data inserted

2004-09-21 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote:
hi there,
the following code runs but no message is displayed from the if then else
statement at the end of the script. also, nothing is written to the database.
i have checked the insert statement and the login credentials are correct.does
anyone know what might be causing this?

// if the submit buttons has been pressed
if (isset($_POST['submit'])){
Is the submit button name/value pair being posted?
Add else clause to the condition and echo something.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php parses but no data inserted

2004-09-21 Thread John Nichel
[EMAIL PROTECTED] wrote:
hi there,
the following code runs but no message is displayed from the if then else
statement at the end of the script. also, nothing is written to the database.
i have checked the insert statement and the login credentials are correct.does
anyone know what might be causing this?
thanks,
lukemack.
?php
/*
TITLE: Inmarsat Form handling script
AUTHOR: Luke Mackenzie
DATE: 18/09/04
*/
error_reporting(E_ALL);
// if the submit buttons has been pressed
if (isset($_POST['submit'])){
snip
Do you have a form element named 'submit' on the page that submits to 
this script?  Right after the if statement you can echo something out 
just to see if it's working

if (isset($_POST['submit'])){
echo ( It worked );
If you don't see the output, then your if statement is returning false.
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php parses but no data inserted

2004-09-21 Thread Jason Wong
On Tuesday 21 September 2004 21:37, [EMAIL PROTECTED] wrote:

 error_reporting(E_ALL);
  ini_set('display_errors', 1);

for good measure.

 @mysql_select_db(inmarsat_comp) or die (Could not select Database);

Lose the '@' whilst developing and always use mysql_error().

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Go climb a gravity well!
*/

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



Re: [PHP] password-protecting with PHP, help plz

2004-09-21 Thread AceZero2790
Thanks for the input, but unfortunately I have no idea how to do that, though 
I do have a MySQL server for my site. I'm still trying to learn basic PHP, I 
haven't moved on to PHP and MySQL connections and stuff yet.

-Andrew


RE: [PHP] password-protecting with PHP, help plz

2004-09-21 Thread Dan Joseph
Hi,

 Thanks for the input, but unfortunately I have no idea how to do that,
 though
 I do have a MySQL server for my site. I'm still trying to learn basic PHP,
 I
 haven't moved on to PHP and MySQL connections and stuff yet.

If you're talking about authentication, there are two methods.
htaccess at the OS level (linux/unix), using Windows IIS to set a password
on a directory or fiels, or you can utilize Sessions.

What exactly are you trying to accomplish?

-Dan Joseph

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



Re: [PHP] Fork PHP script X at a time.

2004-09-21 Thread John Wards
On Tue, 2004-09-21 at 13:58, John Wards wrote:
 Not sure if anyone is interested in what I have come up with, its busy
 running just now but it seems to be performing ok.

Again adding to this thread for future reference.

Its just compleated all 90 threads in 1 hour 50 minutes and that was
running 5 at a time.

Very sucessful bit of code, I'm quite cuffed ;-)

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



[PHP] Book recommendation

2004-09-21 Thread Al
How can get Edit/Mail  Newsgroups/Composition/defaults for Html to work?
Edit/Mail  Newsgroups/Send Format/Send in HTML is checked.
All newsgroups and emails default to plain small text.
Is this a bug, or am I missing something?
Thanks..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Book recommendation

2004-09-21 Thread John Nichel
Al wrote:
How can get Edit/Mail  Newsgroups/Composition/defaults for Html to work?
Edit/Mail  Newsgroups/Send Format/Send in HTML is checked.
All newsgroups and emails default to plain small text.
Is this a bug, or am I missing something?
Thanks..
Huh?
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Lock or critical section

2004-09-21 Thread Curt Zirzow
* Thus wrote Jean-Yves:
 Hi,
 
 Is there a documented way to create in PHP a critical section: I want a 
 piece of code to not be executed in the same time several times?

http://php.net/semma


Curt
-- 
The above comments may offend you. flame at will.

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



Re: [PHP] Book recommendation

2004-09-21 Thread John Holmes
From: Al [EMAIL PROTECTED]
How can get Edit/Mail  Newsgroups/Composition/defaults for Html to 
work?

Edit/Mail  Newsgroups/Send Format/Send in HTML is checked.
All newsgroups and emails default to plain small text.
Is this a bug, or am I missing something?
I think we're all missing something here, like what you're talking about. 
What's this got to do with Book recommendation??

I'm consulting my crystal ball, though, and it says that you're trying to 
send HTML messages to a newsgroup or mailing list (hopefully the PHP one), 
right? And you're wondering why it comes across as plain text, right? And 
your great-grandmother had white..err, wait, wrong crystal ball.

Anyhow... plain text is the preferred method of sending to newsgroups and 
mailing lists, especially this one. HTML is usually stripped (along with 
attachments) before it's posted. HTML messages are become bloated with all 
of the markup and can present security/privacy issues depending upon the 
code and the viewers email client.

Bottom line: use plain text.
---John Holmes... 

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


[PHP] inserting timestamp into mysql field

2004-09-21 Thread luke
Subject: inserting timestamp into mysql field

hi there,

i need to insert a current timestamp into a mysql field when a form is posted.
can anyone suggest a simple way of doing this? i would like to set a variable
in my php script to add into the insert statement. it needs to be in the
format 00-00-00 00:00:00.

Many thanks,

Luke Mackenzie.

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



Re: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Marek Kilimajer
[EMAIL PROTECTED] wrote:
Subject: inserting timestamp into mysql field
hi there,
i need to insert a current timestamp into a mysql field when a form is posted.
can anyone suggest a simple way of doing this? i would like to set a variable
in my php script to add into the insert statement. it needs to be in the
format 00-00-00 00:00:00.
insert table set .., date_added = NOW()
mysql question by the way...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Chris Dowell
Not really a MySQL question - the answer happens to be MySQL, but the 
question asks how to do it in PHP

This might still be necessary if the OP is using something like 
DB_DataObject, as you can't really use NOW() in that situation

Try strftime [ http://uk.php.net/strftime - RTFM :) ] - a good format 
string would be %Y-%m-%d %H:%M:%S which will produce -00-00 00:00:00

Marek Kilimajer wrote:
[EMAIL PROTECTED] wrote:
Subject: inserting timestamp into mysql field
hi there,
i need to insert a current timestamp into a mysql field when a form is 
posted.
can anyone suggest a simple way of doing this? i would like to set a 
variable
in my php script to add into the insert statement. it needs to be in the
format 00-00-00 00:00:00.

insert table set .., date_added = NOW()
mysql question by the way...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Chris Gregors
If you are working with a timestamp in some other format, this works
well:

$ts = date(Y-m-d H:i:s,strtotime($sring_with_timestamp));

If you want to create a timestamp at the execution time, this works
well:

$ts = date(Y-m-d H:i:s);

Both will generate mysql compatiable date/time stamps.
Then do the sql insert/update of your record.

-Original Message-
From: Chris Dowell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 10:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] inserting timestamp into mysql field


Not really a MySQL question - the answer happens to be MySQL, but the 
question asks how to do it in PHP

This might still be necessary if the OP is using something like 
DB_DataObject, as you can't really use NOW() in that situation

Try strftime [ http://uk.php.net/strftime - RTFM :) ] - a good format 
string would be %Y-%m-%d %H:%M:%S which will produce -00-00
00:00:00

Marek Kilimajer wrote:

 [EMAIL PROTECTED] wrote:
 
 Subject: inserting timestamp into mysql field

 hi there,

 i need to insert a current timestamp into a mysql field when a form
is 
 posted.
 can anyone suggest a simple way of doing this? i would like to set a 
 variable
 in my php script to add into the insert statement. it needs to be in
the
 format 00-00-00 00:00:00.
 
 
 insert table set .., date_added = NOW()
 
 mysql question by the way...
 

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




smime.p7s
Description: S/MIME cryptographic signature


[PHP] Question on using png file in ezPdf class

2004-09-21 Thread Chris Bruce
Hello,
I am using the PDF creation classes from http://www.ros.co.nz/pdf
Everything is working great with the exception of not being able to use 
a PNG image with the ezImage extension. JPG works but is not as crisp 
as the image that I want to place is a logo. All file paths and 
spellings are correct, the resulting PDF just has a whitespace where 
the logo should be when I try to use a PNG.

Has anyone who has used this class encountered a similar problem?
Thanks.
--
Chris Bruce
[EMAIL PROTECTED]
Idextrus E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189 South Office
705.361.0331 North Office

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.


Re: [PHP] Book recommendation

2004-09-21 Thread Al
John Nichel wrote:
Al wrote:
How can get Edit/Mail  Newsgroups/Composition/defaults for Html to 
work?

Edit/Mail  Newsgroups/Send Format/Send in HTML is checked.
All newsgroups and emails default to plain small text.
Is this a bug, or am I missing something?
Thanks..
Huh?
Sorry everyone.  I was composing 2 messages, one for here and one for a Mozilla 
group, at the time and screwed up.  I immediately canceled this one; but, it 
apparently registered at you reader anyhow.

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


Re: [PHP] Question on using png file in ezPdf class

2004-09-21 Thread Jason Davidson
Possibly you need to compile php with-png ??  im not sure of this, im
just taking a stab in the dark..
Jason

Chris Bruce [EMAIL PROTECTED] wrote: 
 
 Hello,
 
 I am using the PDF creation classes from http://www.ros.co.nz/pdf
 
 Everything is working great with the exception of not being able to use 
 a PNG image with the ezImage extension. JPG works but is not as crisp 
 as the image that I want to place is a logo. All file paths and 
 spellings are correct, the resulting PDF just has a whitespace where 
 the logo should be when I try to use a PNG.
 
 Has anyone who has used this class encountered a similar problem?
 
 Thanks.
 
 --
 
 Chris Bruce
 [EMAIL PROTECTED]
 
 Idextrus E-Business Architects
 http://www.idextrus.com
 3282 Wilmar Cres.
 Mississauga, ON
 L5L4B2
 CA
 905.828.9189 South Office
 705.361.0331 North Office
 
 
 This e-mail and its contents are privileged, confidential and
 subject to copyright.  If you are not the intended recipient,
 please delete this e-mail immediately.  Any unauthorized use
 or disclosure of the information herein is prohibited.
 

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



Re: [PHP] Extrange behavior with Header('Location')

2004-09-21 Thread Jordi Canals
On Mon, 20 Sep 2004 20:23:53 -0700 (PDT), Chris Shiflett
[EMAIL PROTECTED] wrote:

 
  header('Location: '. html_entity_decode($url));
 
  I would like to know if there is a better way to do it
 
 This should work fine. However, I would prefer to keep the data in its
 original format and only use htmlentities() when I plan to display it
 within HTML, leaving it unaltered otherwise.
 

Many thanks to all.

Just, the result returned by the fuinction is mainly used to creatre
links in the pages, only in some very special cases will be used with
the header function. Just I use the amp; entity in links because I
want all my pages being validated by the W3C validator service.

Thanks again,
Jordi Canals

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



Re: [PHP] Extrange behavior with Header('Location')

2004-09-21 Thread Paul Waring
 Just, the result returned by the fuinction is mainly used to creatre
 links in the pages, only in some very special cases will be used with
 the header function. Just I use the amp; entity in links because I
 want all my pages being validated by the W3C validator service.

As well as that, you should send absolute URIs when you're using
headers, so instead of:

header('Location: ' . $url);

you should use

header('Location: http://www.mysite.com' . $url);

if you want to adhere to the HTTP standard.

Paul

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



Re: [PHP] Question on using png file in ezPdf class

2004-09-21 Thread Chris Bruce
Don't think that is it, but for the record, it is compiled with-png. 
Thanks for the stab though :)

--
Chris Bruce
[EMAIL PROTECTED]
Idextrus E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189 South Office
705.361.0331 North Office

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
On Sep 21, 2004, at 12:32 PM, Jason Davidson wrote:
Possibly you need to compile php with-png ??  im not sure of this, im
just taking a stab in the dark..
Jason
Chris Bruce [EMAIL PROTECTED] wrote:
Hello,
I am using the PDF creation classes from http://www.ros.co.nz/pdf
Everything is working great with the exception of not being able to 
use
a PNG image with the ezImage extension. JPG works but is not as crisp
as the image that I want to place is a logo. All file paths and
spellings are correct, the resulting PDF just has a whitespace where
the logo should be when I try to use a PNG.

Has anyone who has used this class encountered a similar problem?
Thanks.
--
Chris Bruce
[EMAIL PROTECTED]
Idextrus E-Business Architects
http://www.idextrus.com
3282 Wilmar Cres.
Mississauga, ON
L5L4B2
CA
905.828.9189 South Office
705.361.0331 North Office

This e-mail and its contents are privileged, confidential and
subject to copyright.  If you are not the intended recipient,
please delete this e-mail immediately.  Any unauthorized use
or disclosure of the information herein is prohibited.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] custom 404 page

2004-09-21 Thread Gerben
I would like to know which headers I have to send on my own 404page?
I read somewhere I have to send the header HTTP 302 Found

I also want to know which header I have to send when I redirect from my 
404page?
do I need HTTP 201? 

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



RE: [PHP] custom 404 page

2004-09-21 Thread Jay Blanchard
[snip]
I would like to know which headers I have to send on my own 404page?
I read somewhere I have to send the header HTTP 302 Found

I also want to know which header I have to send when I redirect from my 
404page?
do I need HTTP 201? 
[/snip]

Have you checked the http://www.w3c.org ?

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



Re: [PHP] custom 404 page

2004-09-21 Thread John Nichel
Gerben wrote:
I would like to know which headers I have to send on my own 404page?
I read somewhere I have to send the header HTTP 302 Found
I also want to know which header I have to send when I redirect from my 
404page?
do I need HTTP 201? 

http://www.onlamp.com/pub/a/onlamp/2003/02/13/davidsklar.html
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] deleting directories

2004-09-21 Thread Afan Pasalic
I have directory with huge number of directories (names by date artwork 
requested and client id number) with clients artwork.
by accident, directory was opened by FrontPage and now in each directory 
is created _vti_cnf directory with copy of the artwork.
i have to delete all those '_vti_cnf' directories.

Since I don't have root access to server (shared hosting) I made a php 
script:

$path = getcwd();
echo Current Directory: $pathhr;
function list_directory($path)
{
if ($dir = opendir($path))
{
while($file = readdir($dir))
{
if($file != '.' and $file != '..')
{
echo b$file/b;
if($file == '_vti_cnf')
{
rmdir($path./.$file);
}
else
{
if(is_dir($file)) list_directory($file);
}
}
}
}
closedir($dir);
}
list_directory($path);
But, it doesn't work. Im getting this Warnings:
Warning: rmdir(20040301-040434-1411/_vti_cnf): Directory not empty in 
c:\ap\artwork\ap.php on line 19

Is there any other function that allows me to delete even not-empty 
directories?

Or somebody has better idea?
Thanks.
Afan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] deleting directories

2004-09-21 Thread Jesse Castro
rm -r directoryname will recursively remove the directory and
everything in it

-Original Message-
From: Afan Pasalic [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 21, 2004 12:31 PM
To: php-general
Subject: [PHP] deleting directories


I have directory with huge number of directories (names by date artwork 
requested and client id number) with clients artwork.
by accident, directory was opened by FrontPage and now in each directory

is created _vti_cnf directory with copy of the artwork.
i have to delete all those '_vti_cnf' directories.

Since I don't have root access to server (shared hosting) I made a php 
script:

$path = getcwd();
echo Current Directory: $pathhr;
function list_directory($path)
{
if ($dir = opendir($path))
{
while($file = readdir($dir))
{
if($file != '.' and $file != '..')
{
echo b$file/b;
if($file == '_vti_cnf')
{
rmdir($path./.$file);
}
else
{
if(is_dir($file)) list_directory($file);
}
}
}
}
closedir($dir);
}

list_directory($path);

But, it doesn't work. I'm getting this Warnings:
Warning: rmdir(20040301-040434-1411/_vti_cnf): Directory not empty in 
c:\ap\artwork\ap.php on line 19

Is there any other function that allows me to delete even not-empty 
directories?

Or somebody has better idea?

Thanks.

Afan

-- 
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] php5 and php4?

2004-09-21 Thread Minuk Choi
But then, don't you run the risk of having 2 different architectures, that 
is, PHP5(possibly PHP6) and PHP 4.something may evolve down to include 
different features or even different behaviors?


- Original Message - 
From: Thomas Goyne [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 1:45 AM
Subject: Re: [PHP] php5 and php4?


On Tue, 21 Sep 2004 01:29:06 -0400, Minuk Choi [EMAIL PROTECTED] 
wrote:

I've been meaning to ask this... but I always thought I could find the 
answer online(I didn't).  Back when PHP 5.0.1 was released, PHP 
4.something else was released.

What was the main reasoning behind this move?  Is it because PHP5 is 
more OOP(similar to java)?
PHP 4 is still being maintained for two reasons:
1) PHP 5 breaks bc (although only in minor ways)
2) Very few people upgrade to a new major version until at least the first 
point release (5.1).  One of the magical things about open source software 
is that as long as someone still wants something updated, it will continue 
to be, so php4 will probably be maintained until around when php6 is 
released.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
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] deleting directories

2004-09-21 Thread John Nichel
Afan Pasalic wrote:
I have directory with huge number of directories (names by date artwork 
requested and client id number) with clients artwork.
by accident, directory was opened by FrontPage and now in each directory 
is created _vti_cnf directory with copy of the artwork.
i have to delete all those '_vti_cnf' directories.

Since I don't have root access to server (shared hosting) I made a php 
script:
script snip
But, it doesn't work. Im getting this Warnings:
Warning: rmdir(20040301-040434-1411/_vti_cnf): Directory not empty in 
c:\ap\artwork\ap.php on line 19

Is there any other function that allows me to delete even not-empty 
directories?

Or somebody has better idea?
Thanks.
Afan
According to the documentation (http://us4.php.net/rmdir), the directory 
must be empty.  You can use the Windows system command to delete a 
non-empty directory with either exec() or by using backticks.  Sorry, 
but I don't remember what the Windows command is (del?).

--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] deleting directories

2004-09-21 Thread Afan Pasalic
Thanks Jesse, but I don't have an access to server. Just FTP. That's why 
I have to use php script.

Jesse Castro wrote:
rm -r directoryname will recursively remove the directory and
everything in it
-Original Message-
From: Afan Pasalic [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 21, 2004 12:31 PM
To: php-general
Subject: [PHP] deleting directories

I have directory with huge number of directories (names by date artwork 
requested and client id number) with clients artwork.
by accident, directory was opened by FrontPage and now in each directory

is created _vti_cnf directory with copy of the artwork.
i have to delete all those '_vti_cnf' directories.
Since I don't have root access to server (shared hosting) I made a php 
script:

$path = getcwd();
echo Current Directory: $pathhr;
function list_directory($path)
{
if ($dir = opendir($path))
{
while($file = readdir($dir))
{
if($file != '.' and $file != '..')
{
echo b$file/b;
if($file == '_vti_cnf')
{
rmdir($path./.$file);
}
else
{
if(is_dir($file)) list_directory($file);
}
}
}
}
closedir($dir);
}
list_directory($path);
But, it doesn't work. I'm getting this Warnings:
Warning: rmdir(20040301-040434-1411/_vti_cnf): Directory not empty in 
c:\ap\artwork\ap.php on line 19

Is there any other function that allows me to delete even not-empty 
directories?

Or somebody has better idea?
Thanks.
Afan
 

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


Re: [PHP] deleting directories

2004-09-21 Thread John Nichel
Jesse Castro wrote:
rm -r directoryname will recursively remove the directory and
everything in it
snip
He's on a Windows system, that won't work.  As a side note, on *nix 
based systems, rm -rf dir would be better suited so that it doesn't 
prompt for conformation on each file/directory.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] deleting directories

2004-09-21 Thread Afan Pasalic
directories are on Linux server and Windows System Commands will not 
work there.
I forgot to make a note:
warning shows c:\ap\artwork\ap.php because I test it locally, n windows 
machine. but directories are on Linux box
sorry for misleading you guys.


John Nichel wrote:
Afan Pasalic wrote:
I have directory with huge number of directories (names by date 
artwork requested and client id number) with clients artwork.
by accident, directory was opened by FrontPage and now in each 
directory is created _vti_cnf directory with copy of the artwork.
i have to delete all those '_vti_cnf' directories.

Since I don't have root access to server (shared hosting) I made a 
php script:
script snip
But, it doesn't work. Im getting this Warnings:
Warning: rmdir(20040301-040434-1411/_vti_cnf): Directory not empty in 
c:\ap\artwork\ap.php on line 19

Is there any other function that allows me to delete even not-empty 
directories?

Or somebody has better idea?
Thanks.
Afan
According to the documentation (http://us4.php.net/rmdir), the 
directory must be empty.  You can use the Windows system command to 
delete a non-empty directory with either exec() or by using 
backticks.  Sorry, but I don't remember what the Windows command is 
(del?).

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


[PHP] [Fwd: Destinatario No exitente]

2004-09-21 Thread Afan Pasalic
Every time I send a email to php-list I get the email below. Can 
somebody take this email out of list?
Thank you.

Afan
 Original Message 
Subject:Destinatario No exitente
Date:   Tue, 21 Sep 2004 13:47:02 -0400
From:   Mailer Iguanahosting.com [EMAIL PROTECTED]
To: Afan Pasalic [EMAIL PROTECTED]

El Destinatario que ud. intento contactar ya no existe en nuestros 
servidores.

Si desea mas informacion escriba a informacion @ iguanahosting.com.
Disculpe los inconvenientes.

http://www.iguanahosting.com http://www.iguanahosting.comLider
Lider http://www.iguanahosting.comLider de Hospedaje web en Latinoamerica.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] deleting directories

2004-09-21 Thread John Nichel
Afan Pasalic wrote:
directories are on Linux server and Windows System Commands will not 
work there.
I forgot to make a note:
warning shows c:\ap\artwork\ap.php because I test it locally, n windows 
machine. but directories are on Linux box
sorry for misleading you guys.
Then that's a bit easier...for me.
$command = rm -rf  . $directory_name;
exec ( $command );
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] deleting directories

2004-09-21 Thread Afan Pasalic
Sorry John, but I forgot to write that detail: I test locally on Win 
machine, but directories are on Linux server.

Afan
John Nichel wrote:
Jesse Castro wrote:
rm -r directoryname will recursively remove the directory and
everything in it
snip
He's on a Windows system, that won't work.  As a side note, on *nix 
based systems, rm -rf dir would be better suited so that it doesn't 
prompt for conformation on each file/directory.

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


Re: [PHP] deleting directories

2004-09-21 Thread Jasper Howard
its pretty easy to make your function recursive, all you need to do is
test if the current file is a directory (if (is_dir($file)){run
function} else if (eregi('/_vti_cnf/',$file))), then delete all files
as long as they are located in a _vti_cnf directory. And I'm sure
I've done something wrong that won't please someone on the list, but
hopefully this baic idea works and someone will be able to improve on
it.


On Tue, 21 Sep 2004 12:50:09 -0500, Afan Pasalic [EMAIL PROTECTED] wrote:
 Sorry John, but I forgot to write that detail: I test locally on Win
 machine, but directories are on Linux server.
 
 Afan
 
 
 
 
 John Nichel wrote:
 
  Jesse Castro wrote:
 
  rm -r directoryname will recursively remove the directory and
  everything in it
 
  snip
 
  He's on a Windows system, that won't work.  As a side note, on *nix
  based systems, rm -rf dir would be better suited so that it doesn't
  prompt for conformation on each file/directory.
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 

Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
---

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



[PHP] simplexml and xpath

2004-09-21 Thread Matthew Sims

So I've just recently fallen in love with simplexml. But from what I've
read, is it true that xpath doesn't really work properly?

I'm using an XML file that has a section like this:

item
titleTitle/title
linkLink/link
descriptionDesc/description
dc:subjectSubject/dc:subject
dc:date2004-09-20T18:15:00+00:00/dc:date
/item

My sample of my PHP code is:

?php
$library = simplexml_load_file('file.rss');
foreach ($library-item as $item) {
  echo $item-xpath('dc:date');
}
?

I just want to get the date. Am I doing xpath incorrectly or does xpath
not currently work properly in PHP5?

-- 
--Matthew Sims
--http://killermookie.org

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



RE: [PHP] List Etiquette

2004-09-21 Thread Michael Sims
Octavian Rasnita wrote:
 No, there is no way for customizing the headers Outlook Express use
 to put in the email messages.
 I wish there was, because I don't like them also...

Although I haven't used it personally, OE-QuoteFix may help:

http://home.in.tum.de/~jain/software/oe-quotefix/

I do have experience with Outlook-QuoteFix by the same author and it works well.

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



Re: [PHP] Infinate looping

2004-09-21 Thread Chris Dowell
Are you by any chance doing something like this?
while (1)
{
 $dbh = mysql_connect(x, x, x);
 mysql_query(...);
 sleep(10);
}
If so, you could run into that maxclients problem very quickly because 
you're not closing those mysql connections (they'll time out eventually, 
and there are persistent connection options in php.ini), but as you're 
only running one thread, you should never really have more than one 
connection open at a time - a well-placed mysql_close() may do wonders

Of course, that's just a guess as to how your script might be executing
If it really matters to you, you can get a cron job to execute (I think) 
every second, which would probably be a better solution

Or http://uk.php.net/manual/en/features.persistent-connections.php might 
have some useful info - I don't know because I haven't taken the time to 
read it :)

Cheers
Chris
Stephen Craton wrote:
i haven't paid a lot of attention to your setup. are you running this 
through your web server or via the php-cli?
   

Basically I have a file that connects to a database, before the loop, and
then checks the database for new messages. If there are, it displays them
accordingly
 

if via php through the 
web server i suspect you're running into a maxclients problem (your 
client connections aren't closing fast enough so you're using up all 
the client connections).
   

I was thinking this could be the case. Is there any way not to use up
maxclients? I'm just running one loop, though it may be infinite.
 

if you're running this through your web server, a much more efficient 
approach would be via a php-cli or perl application. either of these 
should be able to run as continuous tasks without causing other 
problems.
   

I would run through command line but I'm not sure how. This is a chat script
anyway, and I'm not sure if I have command line abilities on my production
server.
Also, I was thinking of maybe using a socket server. Are socket servers
allowed by mainstream web hosts or do you need certain privileges to open a
socket and connect to them?
Thanks,
Stephen Craton

 

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


Re: [PHP] password-protecting with PHP, help plz

2004-09-21 Thread Chris Dowell
And after that - go and try to find out a little on your own - contrary 
to a common misconception, it's not the sole purpose of members of this 
list to write all your code for you.

The old favourites RTFM and STFW would serve you well here - there are 
thousands of PHP tutorials that will tell you how to write complex if 
statements, and the PHP Manual has an entire section devoted to handling 
authentication with PHP here: 
http://uk.php.net/manual/en/features.http-auth.php

Hope this helps
Cheers
Chris
John Nichel wrote:
Burhan Khalid wrote:
[snip]
And here is the action page, testing2.php.
if ($_POST['user'] == 'Andrew')  ($_POST['pass'] == 'pass') {
echo Welcome, Andrew.; }
And (shocker!) I got a blank page. So I turned out display errors 
and got this:

Parse error: syntax error, unexpected T_BOOLEAN_AND in 
c:\TSW\pages\testing2.php on line 3

PLEASE ... read the manual on basic syntax.

And read here too.
http://us4.php.net/manual/en/language.control-structures.php#control-structures.if 


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


Re: [PHP] empty variable

2004-09-21 Thread Chris Dowell
Just to clear up, there is no isempty() function - the correct function 
is empty() and its details can be found here: http://uk.php.net/empty

Cheers
Chris
-{ Rene Brehmer }- wrote:
At 01:54 20-09-2004, Chris Mach wrote:
What is the best way to determine if a variable is empty?
I have a feeling there is a better way than the way I'm doing it now...
if ($variable == )

there's 2:
if (isset($variable))
or
if (isempty($variable))
what's most appropriate depends on how the variable is set or not
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] List Etiquette

2004-09-21 Thread John Nichel
While the thread still lives, let me add a pet peeve of mine.  People 
who reply to all.  Just reply to the list...if you have to click reply 
to all to get the list address in there, fine, but take a few seconds to 
remove all other addresses.

Thank you for your time.  We now return you to your regularly scheduled 
flaming.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] generating a mysql script

2004-09-21 Thread Chris Dowell
If course, if you don't have shell access, phpMyAdmin is all you'll ever 
need

http://www.phpmyadmin.net
Cheers
Chris
Brian V Bonini wrote:
On Mon, 2004-09-20 at 19:37, Stut wrote:
 

On Mon, 20 Sep 2004 16:20:21 -0700, AMC [EMAIL PROTECTED] wrote:
   

Is there a tool that will generate a script that can be run to rebuild a
mysql database? I need to move my database to a different server
 

No need to use PHP which also makes this OT but... 

Dump the data to a compressed file:
shell mysqldump --quick db_name | gzip  db_name.contents.gz
Load it up into new machines db.
shell mysqladmin create db_name
shell gunzip  db_name.contents.gz | mysql db_name
You could also directly transfer it:
shell mysqladmin -h 'other hostname' create db_name
shell mysqldump --opt db_name \
   | mysql -h 'other hostname' db_name
 

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


[PHP] Image Text

2004-09-21 Thread b2
Hi

I'm trying to create images with a bit of text pasted on top
using the code bolow
My problem is that the text color either are lost (lighter colors) or print
in a different color
it seems that it's mix the text color and the background color
Is there away around this
?
$im1=backgroundimage.jpg;
Header(Content-type: image/jpeg);
[EMAIL PROTECTED]($im1);
$red = ImageColorAllocate($src,255,0,0);
$blue = ImageColorAllocate($src,0,0,255);
$text1='Line 1';
$text2='Line 2';
imagettftext($src, 5, 0, 0, 4, $blue, arial.ttf, $text1);
imagettftext($src, 5, 0, 0, 26, $red, arial.ttf, $text2);
imagejpeg ($src);
?

also
where can I find different fonts that I can use in
imageloadfont ()

thanks

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



[PHP] Image Text

2004-09-21 Thread b2
Hi

I'm trying to create images with a bit of text pasted on top
using the code bolow
My problem is that the text color either are lost (lighter colors) or print
in a different color
it seems that it's mix the text color and the background color
Is there away around this
?
$im1=backgroundimage.jpg;
Header(Content-type: image/jpeg);
[EMAIL PROTECTED]($im1);
$red = ImageColorAllocate($src,255,0,0);
$blue = ImageColorAllocate($src,0,0,255);
$text1='Line 1';
$text2='Line 2';
imagettftext($src, 5, 0, 0, 4, $blue, arial.ttf, $text1);
imagettftext($src, 5, 0, 0, 26, $red, arial.ttf, $text2);
imagejpeg ($src);
?

also
where can I find different fonts that I can use in
imageloadfont ()

thanks

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



Re: [PHP] List Etiquette

2004-09-21 Thread Greg Donald
On Tue, 21 Sep 2004 15:02:27 -0400, John Nichel [EMAIL PROTECTED] wrote:
 While the thread still lives, let me add a pet peeve of mine.  People
 who reply to all.  Just reply to the list...if you have to click reply
 to all to get the list address in there, fine, but take a few seconds to
 remove all other addresses.

I admit it, I'm guilty.. but sometimes I want to make sure I reach the
intended vict..  err, I mean recipient.

What would be nice is if a reply-to header listing php-general was
included with each message.  As it stands right now I do have to hit
reply-to-all then edit the To: and Cc: fields as you described.

GMail handles this issue just swell though.  When I get duplicate
emails it only shows me one of them.  I've gone looking for the other
email when I first noticed it happening, and it's nowhere to be found.


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



[PHP] Recommendations for php email list managers?

2004-09-21 Thread Mattias Thorslund
Hi,
I'm trying to set up a list manager on a hosted site.  PHPlist 
(phplist.com) seemed promising but I read on their forums that it takes 
some users hours and hours to send a couple thousand emails.  Without 
terminal access, I suspect the PHP sending page will time out long 
before most of my emails have been sent.

Does anyone have suggestions for a quicker mailer?  I'd like to be able 
to import users in bulk, and I'd like to let users sign up and 
unsubscribe automatically.  PHPlist does all that but... I don't want to 
set it all up and then find out I can't send my newsletter.  It's 
supposed to be an announcement-only list, BTW.

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


[PHP] Any idea how to automatically post to http authentication?

2004-09-21 Thread j kensler
I'm trying to create a php page that automatically posts data to
several other webpages (to log in). However one of the pages is using
some sort of CGI HTTP authentication. Is there any way that I can see
what the names of the fields are (such as user or username or
whatever). And also is there any way that I can post the data that the
HTTP authentication needs via PHP?

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



[PHP] using foreach() to capture multiple selections

2004-09-21 Thread Luke Mackenzie
Subject: using foreach() to capture multiple selections

hi,

i would like to to put multiple selections from a form list into a single
variable using foreach but am unsure how to do so.

can someone advise how to adapt the following code?

?php

print You are interested in: ;

foreach($myGoals as $value)

{

print $value ;

}

?

 

- 
lukem  - quality custom t-shirts 
browse - www.lukem.co.uk 
contact- [EMAIL PROTECTED] 

need a new website? get over to 
http://www.lukem-sites.co.uk http://www.lukem-sites.co.uk/  

 


Re: [PHP] Re: mysql_connect does not connect

2004-09-21 Thread Chris Dowell
Sam,
You're correct - the manual does leave a little bit of a grey area about 
which extension you should use for 4.1.0  MySQL version  4.1.3

However, as you're using 5.0.1 this really shouldn't confuse you to 
quite the extent which it has.

Sam Hobbs wrote:
Curt Zirzow [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 

RTFM.
mysql:
This MySQL extension doesn't support full functionality of MySQL
versions greater than 4.1.0. For that, use MySQLi.
mysqli:
The mysqli extension is designed to work with the version 4.1.3 or
above of MySQL.
   

What the manual says (as quoted) is either not relevant or is not clear.
 

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


Re: [PHP] Image Text

2004-09-21 Thread Greg Donald
On Tue, 21 Sep 2004 19:37:45 +0100, b2 [EMAIL PROTECTED] wrote:
 I'm trying to create images with a bit of text pasted on top
 using the code bolow
 My problem is that the text color either are lost (lighter colors) or print
 in a different color
 it seems that it's mix the text color and the background color
 Is there away around this
 ?
 $im1=backgroundimage.jpg;
 Header(Content-type: image/jpeg);
 [EMAIL PROTECTED]($im1);
 $red = ImageColorAllocate($src,255,0,0);
 $blue = ImageColorAllocate($src,0,0,255);

Try imagecolorresolve() instead here.

 also
 where can I find different fonts that I can use in
 imageloadfont ()

Depends on your system.

c:\windows\fonts
/usr/share/fonts/truetype

is where I've used fonts from previously.


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Any idea how to automatically post to http authentication?

2004-09-21 Thread Greg Donald
On Tue, 21 Sep 2004 14:24:08 -0500, j kensler [EMAIL PROTECTED] wrote:
 I'm trying to create a php page that automatically posts data to
 several other webpages (to log in). However one of the pages is using
 some sort of CGI HTTP authentication. Is there any way that I can see
 what the names of the fields are (such as user or username or
 whatever). And also is there any way that I can post the data that the
 HTTP authentication needs via PHP?

I don't know if you have looked there yet, but PEAR seems to have
quite a few HTTP packages:

http://pear.php.net/packages.php?catpid=11catname=HTTP

Also, you might try curl:

http://pear.php.net/package/Net_Curl


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] List Etiquette

2004-09-21 Thread Andre Dubuc
On Tuesday 21 September 2004 03:02 pm, John Nichel wrote:
 While the thread still lives, let me add a pet peeve of mine.  People
 who reply to all.  Just reply to the list...if you have to click reply
 to all to get the list address in there, fine, but take a few seconds to
 remove all other addresses.

Arrgh! I use Kmail. I click 'Reply' and I get your personal address (instead 
of the correct 'To:' address. Bummer! Gotta spend some energy wiping the 
current 'To:' addrress, type in letter 'p', click auto-complete for correct 
address, and click again. Sigh . . . way too much work for me.

Maybe it's time to say bye-bye to this thread . . .

Andre

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



Re: [PHP] using foreach() to capture multiple selections

2004-09-21 Thread Greg Donald
On Tue, 21 Sep 2004 20:26:04 +0100, Luke Mackenzie [EMAIL PROTECTED] wrote:
 i would like to to put multiple selections from a form list into a single
 variable using foreach but am unsure how to do so.
 
 can someone advise how to adapt the following code?

?php

print You are interested in: ;

print select multiple name=\select_field[]\;

foreach($myGoals as $key = $value)
{
  print option value=\$key\$value/option;
}

print /select;

?

untested..


-- 
Greg Donald
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] using foreach() to capture multiple selections

2004-09-21 Thread John Holmes
From: Luke Mackenzie [EMAIL PROTECTED]
i would like to to put multiple selections from a form list into a single
variable using foreach but am unsure how to do so.
can someone advise how to adapt the following code?
print You are interested in: ;
foreach($myGoals as $value)
{
print $value ;
}
$var = implode(' ',$myGoals);
or
foreach($myGoals as $value)
{ $var .= $value . ' '; }
First method is easier. 

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


Re: [PHP] mysql_connect does not connect

2004-09-21 Thread Chris Dowell
[snippy]
Sam Hobbs wrote:
Um.. you do realize you have more problems than php not being able
to connect to the database.
   

This is the type of unproductive comment that causes problems. The only 
reason you are saying this is because you are desperate to make me wrong. 
You have exhausted reasonable comments and must resort to unreasonable ones. 
That sure is a problem here. 

[/snippy]
On the contrary, Sam - yours is a comment that is more likely to cause 
problems - the inevitable backlash of hatred directed at you is 
founded solely in your mistaken assumption that you alone are correct.

If that's truly the case, then why are you asking a bunch of 
feeble-minded jerks like ourselves for help? We have difficulty enough 
tying our shoelaces.

Since you *have*, misguidedly or otherwise, chosen to come to this list 
for help, you could have the decency to thank everyone for their 
suggestions. You asked for our help and we're trying to supply it - if 
you've tried something already, even if we're just completely and 
utterly wrong, we've still taken time out of our day, solving our 
problems to pay our bills in order to help you solve yours.

Will you at least have the courtesy to explain how you fixed the problem 
- that way we can avoid having this conversation again when someone else 
has the same issue.

Cheers
Chris
p.s. I noticed that you also shouted down Rasmus in a post on the PHP 
Internals list. You say you're primarily a C++ programmer - would you 
try and tell Bjorn Stroustroup to shut up?


I particularly like this, from that list:
[snippy]
This is possible and if so then I agree that it is not a php problem and 
there is not much more for php to do than to give a hint somewhere.

[/do you know, some days I feel like a hairdresser]
Especially given your reaction when Rasmus suggested exactly that
[snippy once more]
Rasmus Lerdorf [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 

I am not sure why you assume this to be a PHP problem.
   

I thought I was being reasonable. I thought I was clear about saying I was 
not sure it is a PHP problem. I was trying to help by helping diagnose a 
problem. If it is not a problem then you could say so in a more reasonable 
manner. If you always react to people this way when they are trying to help 
then you will have an inferior product since you discourage people from 
helping.

I am not assuming; that is why I am asking this question. You really can say 
the same thing except without the emotions. You can simply state the fact 
that as far as you know it is not a PHP problem. It really, really helps to 
keep in mind that it is better to simply state facts. That keeps things less 
emotional and generally keeps things at a more reasonable level.

[/no more snippy]
p.p.s I realise I haven't helped at all, but you're funny and I'm glad 
of the light relief you inadvertently provide.

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


Re: [PHP] using foreach() to capture multiple selections

2004-09-21 Thread Matthew Sims

 i would like to to put multiple selections from a form list into a single
 variable using foreach but am unsure how to do so.

 can someone advise how to adapt the following code?

 ?php

 print You are interested in: ;

 foreach($myGoals as $value)

 {

 print $value ;

 }

 ?

Not to do all the work for you but do you mean:


You are interested in:

form method=post action=phpPage.php

?php foreach ($myGoals as $value): ?
  input type=radio name=goals value=?php echo $value; ??php
echo $value; ?
?php endforeach; ?

/form


-- 
--Matthew Sims
--http://killermookie.org

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



[PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Manuel Lemos
Hello,
On 09/21/2004 04:17 PM, Mattias Thorslund wrote:
I'm trying to set up a list manager on a hosted site.  PHPlist 
(phplist.com) seemed promising but I read on their forums that it takes 
some users hours and hours to send a couple thousand emails.  Without 
terminal access, I suspect the PHP sending page will time out long 
before most of my emails have been sent.

Does anyone have suggestions for a quicker mailer?  I'd like to be able 
to import users in bulk, and I'd like to let users sign up and 
unsubscribe automatically.  PHPlist does all that but... I don't want to 
set it all up and then find out I can't send my newsletter.  It's 
supposed to be an announcement-only list, BTW.
Depending on your host operating system and local mailer, there are ways 
to tell to just queue the messages and deliver them later when possible, 
freeing your PHP much faster to queue messages to different recipients. 
Just let me know which OS and local mailer system (sendmail, qmail, 
postfix, exim, IIS, Exchange, etc.) do you use so I can advise.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] using foreach() to capture multiple selections

2004-09-21 Thread Jason Wong
On Wednesday 22 September 2004 03:26, Luke Mackenzie wrote:
 Subject: using foreach() to capture multiple selections

 i would like to to put multiple selections from a form list into a single
 variable using foreach but am unsure how to do so.

manual  PHP and HTML

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
One monk said to the other, The fish has flopped out of the net! How will it
live? The other said, When you have gotten out of the net, I'll tell you.
*/

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



Re: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Andrew Kreps
On Tue, 21 Sep 2004 16:25:37 +0100, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 i need to insert a current timestamp into a mysql field when a form is posted.
 can anyone suggest a simple way of doing this?

Here's the MySQL answer: If you have a (data type) timestamp field in
your table, you don't need to do anything.  MySQL will automatically
fill it in on insert, and update it when you run an update query.

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



Re: [PHP] List Etiquette

2004-09-21 Thread John Holmes
From: Andre Dubuc [EMAIL PROTECTED]
I click 'Reply' and I get your personal address (instead
of the correct 'To:' address.
Oh, for the love of god, jub or whoever, can we not turn this into a 
who-the-list-should-reply-to thread?!?!? Been there, 
done-beat-the-dead-horse-about that...

---John Holmes... 

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


[PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Matthew Weier O'Phinney
* Mattias Thorslund [EMAIL PROTECTED]:
 I'm trying to set up a list manager on a hosted site.  PHPlist 
 (phplist.com) seemed promising but I read on their forums that it takes 
 some users hours and hours to send a couple thousand emails.  Without 
 terminal access, I suspect the PHP sending page will time out long 
 before most of my emails have been sent.

You're comparing apples to oranges here. The amount of time it takes to
send the mails isn't based on PHPList but on:

1) The MTA being used to send the mails and
   1a) how that MTA is configured
2) Available bandwidth

To give an example, where I work, we have a bulk mailer we've developed.
The management interface is PHP, but mails are sent via a perl
application. The perl application sends the mails via Postfix.

Now, selecting the addresses to mail and sending the mails from the perl
process takes very little time; it can do that in minutes per tens of
thousands. 

If we didn't limit Postfix, it can send around 100,000 mails
in 1.5 - 3 hours -- but that takes up several T1s, and the *available*
bandwidth is only 1.5 T1s -- which pushes it to around 4-5 hours 
(Point 2, above).

However, if we consistently use 1.5 T1s, that puts us into a different
price bracket at our ISP... so we limit Postfix to a certain number of
simultaneous processes... and now that same 100,000 mails takes 10
hours (Point 1a, above).

Now, these are examples with Postfix; those numbers might be different
using Sendmail (which can be similarly optimized) or Exim (which tends
to optimize for lower volumes of mail), etc. (Point 1, above.)

So, you can see, the mailer is less dependent on the frontend (PHPlist,
to use your example) than on the underlying server architecture.

 Does anyone have suggestions for a quicker mailer?  I'd like to be able 
 to import users in bulk, and I'd like to let users sign up and 
 unsubscribe automatically.  PHPlist does all that but... I don't want to 
 set it all up and then find out I can't send my newsletter.  It's 
 supposed to be an announcement-only list, BTW.

If you can, I'd suggest something where the mails are sent by a cronjob
or a listener daemon of some sort -- this way, you don't have to wait
for the process to finish on your browser, and you won't have to worry
about how long any given mailing is taking. 

I don't know of any packages to recommend -- as I said, the system I
work with we home-brewed (and it's not publicly available).

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] php5 and php4?

2004-09-21 Thread Matthew Weier O'Phinney
* Minuk Choi [EMAIL PROTECTED]:
 But then, don't you run the risk of having 2 different architectures, that 
 is, PHP5(possibly PHP6) and PHP 4.something may evolve down to include 
 different features or even different behaviors?

PHP4 is in *maintenance* mode -- that means no new features. PHP5 may
introduce new features, and PHP6 definitely will, but at this point PHP4
will only experience bugfixes and security updates.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



[PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Manuel Lemos
Hello,
On 09/21/2004 05:03 PM, Matthew Weier O'Phinney wrote:
To give an example, where I work, we have a bulk mailer we've developed.
The management interface is PHP, but mails are sent via a perl
application. The perl application sends the mails via Postfix.
I wonder why aren't you using PHP to send the messages via Postfix.
Anyway, he did not say that he was using a platform that can run 
Postfix. If he is using Windows 2000 or later with IIS/Exchange, he can 
actually queue messages much faster than piping to postfix.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Anyone using SPL Iterators?

2004-09-21 Thread John Holmes
I've been looking around for some SPL 
(http://www.php.net/manual/en/ref.spl.php) examples and uses, but have only 
found one good article on Sitepoint 
(http://www.sitepoint.com/article/php5-standard-library/).

Is anyone using SPL iterators out there? Any examples you'd like to share 
that you find useful? Iterating through databases or large files, etc? Just 
curious what people are using this for before I write some stuff myself. :)

--
---John Holmes...
php|architect - The Magazine for PHP Professionals - www.phparch.com 

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


Re: [PHP] using foreach() to capture multiple selections

2004-09-21 Thread Janet Valade
Luke Mackenzie wrote:
Subject: using foreach() to capture multiple selections
hi,
i would like to to put multiple selections from a form list into a single
variable using foreach but am unsure how to do so.
can someone advise how to adapt the following code?
?php
print You are interested in: ;
foreach($myGoals as $value)
{
print $value ;
}
?
I'm not totally sure what you are looking for. It looks like you have 
values in an array $myGoals. I'm assuming you collected the form values 
in the array, so you have $myGoals[0], $myGoals[1], etc. Are you saying 
you want all the values in MyGoals added to a single variable as a 
string? If so, look at the function implode. 
www.php.net/manual/en/function.implode.php

Or, you can have a statement in your forrach loop something like:
$string .= $value. ;
Janet

 

- 
lukem  - quality custom t-shirts 
browse - www.lukem.co.uk 
contact- [EMAIL PROTECTED] 

need a new website? get over to 
http://www.lukem-sites.co.uk http://www.lukem-sites.co.uk/  

 

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


Re: [PHP] List Etiquette

2004-09-21 Thread John Nichel
John Holmes wrote:
From: Andre Dubuc [EMAIL PROTECTED]
I click 'Reply' and I get your personal address (instead
of the correct 'To:' address.

Oh, for the love of god, jub or whoever, can we not turn this into a 
who-the-list-should-reply-to thread?!?!? Been there, 
done-beat-the-dead-horse-about that...

---John Holmes...
I was kind of hoping to steer it towards the other dead horse...ya know, 
the one about modifying the headers to add a 'Reply-To'.  That one 
always gets people worked up. ;)

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Mattias Thorslund
Manuel Lemos wrote:
Hello,
On 09/21/2004 04:17 PM, Mattias Thorslund wrote:
I'm trying to set up a list manager on a hosted site.  PHPlist 
(phplist.com) seemed promising but I read on their forums that it 
takes some users hours and hours to send a couple thousand emails.  
Without terminal access, I suspect the PHP sending page will time out 
long before most of my emails have been sent.

Does anyone have suggestions for a quicker mailer?  I'd like to be 
able to import users in bulk, and I'd like to let users sign up and 
unsubscribe automatically.  PHPlist does all that but... I don't want 
to set it all up and then find out I can't send my newsletter.  It's 
supposed to be an announcement-only list, BTW.

Depending on your host operating system and local mailer, there are 
ways to tell to just queue the messages and deliver them later when 
possible, freeing your PHP much faster to queue messages to different 
recipients. Just let me know which OS and local mailer system 
(sendmail, qmail, postfix, exim, IIS, Exchange, etc.) do you use so I 
can advise.

I'm aftaid I have very limited information about the server 
configuration. I'll have to ask my host since I can't find the info on 
their web site. 

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


Re: [PHP] Re: Recommendations for php email list managers?

2004-09-21 Thread Mattias Thorslund
Matthew Weier O'Phinney wrote:
* Mattias Thorslund [EMAIL PROTECTED]:
 

I'm trying to set up a list manager on a hosted site.  PHPlist 
(phplist.com) seemed promising but I read on their forums that it takes 
some users hours and hours to send a couple thousand emails.  Without 
terminal access, I suspect the PHP sending page will time out long 
before most of my emails have been sent.
   

You're comparing apples to oranges here. The amount of time it takes to
send the mails isn't based on PHPList but on:
1) The MTA being used to send the mails and
  1a) how that MTA is configured
2) Available bandwidth
 

[snip]
So, you can see, the mailer is less dependent on the frontend (PHPlist,
to use your example) than on the underlying server architecture.
 

Thanks for explaining. I'll have to ask my hosting provider about the 
details.

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


[PHP] alternative to mysql_field_name()

2004-09-21 Thread Luke
hi there,

i am currently using the following code to loop through the results of a
sql query and extract the field names ($export contains the query
results from the database). the script goes on to place the results in
an excel file.

for ($i = 0; $i  $fields; $i++) {
$header .= mysql_field_name($export, $i) . \t;
} 

however, i'd like to add more meaningful names as the field name
headings in the excel file. can anyone suggest how i can write a list of
tab separated headings into $header?

the rest of the script can be found here:
http://www.phpfreaks.com/tutorials/114/3.php

many thanks,

luke.


---
need a new website? get over to 
http://www.lukem-sites.co.uk 

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



  1   2   >