RE: [PHP] .htpasswd login

2004-05-28 Thread Jami
Your looking for this:

$_SERVER['PHP_AUTH_USER']
When running under Apache as module doing HTTP authentication this
variable is set to the username provided by the user. 

See Reserved Variables: http://www.php.net/reserved.variables


Jami Moore
LightSPARK Digital Designs
http://www.lightsparkdigital.com/



 -Original Message-
 From: Daniel Baughman [mailto:[EMAIL PROTECTED] 
 Sent: Friday, May 28, 2004 12:56 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] .htpasswd login
 
 
 I have some sites that I would like to view the user name 
 that someone provided to the basic authentication mechanism 
 in apache.
 
 Does php/apache provide a means for this?
 

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



[PHP] How can I filter options?

2004-05-28 Thread dunj
Hi, every one.
I am now caught in a difficulty.
I create a form to query the database. There are two 'select' items in the  
form.
For example, I refer to the first 'select' item as $province and the  
second as $city.
When I select a item of $province, I wish $city contains only the cities  
of the selected
province.
I think I should use the java script, but I don't know how to use it.
Thanks in advance.

--
-
David Oilfield
Tel:010-83557528-263
Mobile:13521805655
China Lottery Online Co. Ltd.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Aspect Oriented Programming PHP

2004-05-28 Thread Bert Slagter
Michael Lauzon wrote:
Since PHP5 is going to feature OOP (Object Oriented Programming), will that mean PHP6 
will feature AOP (Aspect Oriented Programming)...so far it seems AOP is only being 
used for Java at the moment; but hopefully general programming and scripting languages 
will start using them as well?!

Michael Lauzon, Founder
The Quill Society
http://www.quillsociety.org/
[EMAIL PROTECTED]
The __get, __set and __call functions are distand cousins of AOP: they 
offer the possibility to react on the fact that some method is called, 
regardless which one. It models the aspect 'any method called, what to do?'.

But note that there are no 'native AOP' languages right now, Java only 
has some obscure extensions/mutations that partly implement the AOP 
paradigm (like AspectJ, JBoss and Hyper/J).

But it would be nice though if optional AOP support would find its way 
into PHP one day :).

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


[PHP] aquestion about php extensions

2004-05-28 Thread php
Hello,

i compile c file with vc++ (php extension).
is there any possibility to execute php script in this extension?
[php code will be in one string]
---
...
//this is mod.c code
ZEND_FUNCTION(my_function) 
{ 

for(i=0;i5;i++) { 
  zend_execute_php_script(  //is any function for php execution?
echo \text\;
 while (1){
break;
 }
 
 echo 1+5;

  br
  ); 
} 
}
...

then i call it:
?
 dl( mod.dll );
 my_function();

 ?

and got output in page:
-
text
6
-

Thanx!

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



[PHP] Identifying spam text

2004-05-28 Thread Merlin
Hi there,
I am running a community site in php, where members can be contacted through a 
web form. Yesterday a guy contacted about 50 of those members with a spam text.

Now I am trying to find a way to identify spam text via php. This looks like a 
common task to me, so I hope that I have not to invent the wheel twice. Maybe 
someone knows a good script to do this?

Basicly it looks like that the text has to be checked against certain key words 
and if they reach a certain amount of hits it is spam text.
Has anybody a good idea on how to start on this?

Thank you for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: How can I filter options?

2004-05-28 Thread Merlin
Hello Dunj,
first query the db for all provinces. Then let the user select his province and 
make the select field an automated jump field 
(onselct=document.location.href='xxsite')
Then query the db again with the province and display the cities.

However think about it how many cities you might have to display. I think it is 
easier to query the db directly for the city name and let the person select the 
city in question.

good luck,
Merlin
Dunj wrote:
Hi, every one.
I am now caught in a difficulty.
I create a form to query the database. There are two 'select' items in 
the  form.
For example, I refer to the first 'select' item as $province and the  
second as $city.
When I select a item of $province, I wish $city contains only the 
cities  of the selected
province.
I think I should use the java script, but I don't know how to use it.
Thanks in advance.

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


Re: [PHP] Newbie Question: Variables on the fly

2004-05-28 Thread PHP4web
ok let say that you have 2 or more variables with same name but there are
difference in numbering And Values like this :

$var1 = 1 ;
$var2 =  12 ;
// etc ..

now you must now how much of number of this varibles before you deal with it
or you must store it on array to know how to count it in the fly like this :

$var[var1] = 1;
$var[var2] = 12;
// etc ..
$var_count  = count($var); // give you the count

now you can deal with vars like this :

$i = 1;
do {
$NewVar[NewVar.$i] = $var[var.$i] * $WhatEver ;
$i++;
}
while ($i = $var_count );

And finally you can extract vars by extract() to make them in normal shape
if you get my point

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, May 28, 2004 8:01 AM
Subject: RE: [PHP] Newbie Question: Variables on the fly


 Thanks for the reply Denis,

 Let me elaborate a bit.

 I have a php page which I want to pass a series of variables via a url
string.

 eg

 myPage.php?dataPoint1=10dataPoint2=20dataPoint3=30

 The thing is I won;t know until runtime how many dataPoints there will be
 so I have also included 1 additional url variable

 eg

 myPage.php?totalDataPoints=3dataPoint1=10dataPoint2=20dataPoint3=30

  From there I want to take those data points and do several things with
 each of them.  The keep things simple lets say I want to multiply each by
3
 and then divide it by 2 and put it into a new variable (under the same
 naming system).

 eg

 $xtemp=$HTTP_GET_VARS[totalDataPoints];

 do {
  A line here which will take each dataPoint and multiply by 3 and
 divide by 2 and assign it to a new variable with the same numbering system
 (eg $myNewVar1=$HTTP_GET_VARS[dataPoint1]*3/2;
  $xtemp--;
 } while ($xtemp0);

 Make any more sense?

 Thanks.


 At 01:24 AM 28/05/2004, Dennis Seavers wrote:
 Maybe others will catch on to your intention, but I think you need to
 provide a bit more information.  For example, what variables do you want
to
 create (drawn from a file source, or create on the fly)?  Where will they
 come from (a database, perhaps)?  You could create a script that creates
 variables from scratch, following a (hopefully) finite mathematical
 formula.  Or you could manipulate data that already exists, turning this
 data into some kind of variables.
 
 Ultimately, you'll have to give a better of sense of the end result you'd
 like.
 
 Dennis Seavers
 
 
   [Original Message]
   From: [EMAIL PROTECTED]
   To: PHP List [EMAIL PROTECTED]
   Date: 05/27/2004 9:17:11 PM
   Subject: [PHP] Newbie Question: Variables on the fly
  
   Hello,
  
   I'm sure this is a newbie question but I don't know the syntax.
  
   I want to create a series of variables within a php script at runtime
 with
   a for loop.
  
   eg
  
   myVar1
   myVar2
   myVar3
   etc
  
   What is the proper syntax to do this?
  
   Thanks,
  
   Tim
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

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




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



[PHP] Re: Identifying spam text

2004-05-28 Thread Merlin
ok.. I came up with something by myself. Here is the code in case someone is 
interested in a spam filter.

Regards, Merlin
###
# Check for spam
$stmt=
SELECT
keyword,
weight
FROM
Table
;
$row = db_get_row2($stmt);
$result = execute_stmt($stmt, $link);
while ($row = db_get_row($result)){
$keyword[]  = $row-keyword;
$weight[]   = $row-weight;
};  
$num_results = db_numrows($result); 
$mystring = $message;
for ($i=0;$i$num_results;$i++){
$findme  = $keyword[$i];
$pos = strpos($mystring, $findme);
if ($pos !== false){ // this seems to be spam!
$spam_level += $weight[$i];
$triggered_keywords .= $keyword[$i].', ';
}
}
if ($spam_level = 4){ // this seems to be spam!
// do whatever
}
###
Merlin wrote:
Hi there,
I am running a community site in php, where members can be contacted 
through a web form. Yesterday a guy contacted about 50 of those members 
with a spam text.

Now I am trying to find a way to identify spam text via php. This looks 
like a common task to me, so I hope that I have not to invent the wheel 
twice. Maybe someone knows a good script to do this?

Basicly it looks like that the text has to be checked against certain 
key words and if they reach a certain amount of hits it is spam text.
Has anybody a good idea on how to start on this?

Thank you for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Playing with globals

2004-05-28 Thread Ciprian Trofin
Hi All,

My system: Windows NT 5.0 build 2195 / Apache/1.3.23 - PHP 4.1.1

Here is a nice snippet:
___
?
function test() {
 $GLOBALS['test'] = 1;
 $test = 2; }

test();
echo $test;
?
__

the result: 1 (however, I expected to see 2)




If I change to:
?
function test() {
 global $test;
 $GLOBALS['test'] = 1;
 $test = 2; }

test();
echo $test;
?
___

the result: 2

I understand the concept o local and global variables, but isn't $GLOBALS
supposed to work as an alternative to global statement ? 


--
Best regards,
  Ciprian

 Teamwork is essential. It allows you to blame someone else.

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



Re: [PHP] Identifying spam text

2004-05-28 Thread Steve Edberg
At 9:31 AM +0200 5/28/04, Merlin wrote:
Hi there,
I am running a community site in php, where members can be contacted 
through a web form. Yesterday a guy contacted about 50 of those 
members with a spam text.

Now I am trying to find a way to identify spam text via php. This 
looks like a common task to me, so I hope that I have not to invent 
the wheel twice. Maybe someone knows a good script to do this?

Basicly it looks like that the text has to be checked against 
certain key words and if they reach a certain amount of hits it is 
spam text.
Has anybody a good idea on how to start on this?

Thank you for any hint,

I suppose the difficulty here depends on how narrow this 'community' 
is. If it's small and narrowly focussed, you could probably get away 
with using PHP's string searching or regexp features to search for 
'bad' words, or search for a few terms that must show up in messages, 
or both.

For more general use, you might be able to use a filter like SpamAssassin -
http://www.spamassassin.org/index.html
It looks like it has sufficient flexibility  APIs to use it for 
general text analysis purposes, not just as a mail filter. My 
employer uses it on their central mail servers, and it does a pretty 
good job of rating incoming mail for its 'spamesque' qualities.

SpamBayes is another filter -
http://spambayes.sourceforge.net/
Spamassassin is written in Perl, SpamBayes in Python, so you wouldn't 
have a pure-PHP solution, though, if that was really important to you 
-

steve
--
+--- my people are the people of the dessert, ---+
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
+ said t e lawrence, picking up his fork +
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Playing with globals

2004-05-28 Thread Steve Edberg
At 11:52 AM +0300 5/28/04, Ciprian Trofin wrote:
Hi All,
My system: Windows NT 5.0 build 2195 / Apache/1.3.23 - PHP 4.1.1
Here is a nice snippet:
___
?
function test() {
 $GLOBALS['test'] = 1;
 $test = 2; }
test();
echo $test;
?
__
the result: 1 (however, I expected to see 2)

If I change to:
?
function test() {
 global $test;
 $GLOBALS['test'] = 1;
 $test = 2; }
test();
echo $test;
?
___
the result: 2
I understand the concept o local and global variables, but isn't $GLOBALS
supposed to work as an alternative to global statement ?

Not exactly. It allows to you access variables in the global context, 
but it doesn't make the variable itself global; only the 'global' 
declaration does that.

steve
--
+--- my people are the people of the dessert, ---+
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
+ said t e lawrence, picking up his fork +
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Newbie Question: Variables on the fly

2004-05-28 Thread Steve Edberg
At 2:01 AM -0300 5/28/04, [EMAIL PROTECTED] wrote:
Thanks for the reply Denis,
Let me elaborate a bit.
I have a php page which I want to pass a series of variables via a url string.
eg
myPage.php?dataPoint1=10dataPoint2=20dataPoint3=30
The thing is I won;t know until runtime how many dataPoints there 
will be so I have also included 1 additional url variable

eg
myPage.php?totalDataPoints=3dataPoint1=10dataPoint2=20dataPoint3=30
From there I want to take those data points and do several things 
with each of them.  The keep things simple lets say I want to 
multiply each by 3 and then divide it by 2 and put it into a new 
variable (under the same naming system).

eg
$xtemp=$HTTP_GET_VARS[totalDataPoints];
do {
A line here which will take each dataPoint and multiply by 3 
and divide by 2 and assign it to a new variable with the same 
numbering system (eg $myNewVar1=$HTTP_GET_VARS[dataPoint1]*3/2;
$xtemp--;
} while ($xtemp0);

Make any more sense?
Thanks.

Strictly speaking, your original question referred to what PHP calls 
'variable variables':

http://us3.php.net/manual/en/language.variables.variable.php
However, most of what you can do with them can be done more simply 
with arrays. In your example above, use

myPage.php?dataPoint[]=10dataPoint[]=20dataPoint[]=30
and you get an array
$dataPoint[0]=10
$dataPoint[1]=20
$dataPoint[2]=30
The number of data points is count($dataPoint). See
http://us3.php.net/manual/en/language.variables.external.php
for more info on this technique.
steve edberg


At 01:24 AM 28/05/2004, Dennis Seavers [EMAIL PROTECTED] wrote:
Maybe others will catch on to your intention, but I think you need to
provide a bit more information.  For example, what variables do you want to
create (drawn from a file source, or create on the fly)?  Where will they
come from (a database, perhaps)?  You could create a script that creates
variables from scratch, following a (hopefully) finite mathematical
formula.  Or you could manipulate data that already exists, turning this
data into some kind of variables.
Ultimately, you'll have to give a better of sense of the end result you'd
like.
Dennis Seavers

 [Original Message]
 From: [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Date: 05/27/2004 9:17:11 PM
  Subject: [PHP] Newbie Question: Variables on the fly
 Hello,
 I'm sure this is a newbie question but I don't know the syntax.
 I want to create a series of variables within a php script at runtime
with
 a for loop.
 eg
 myVar1
 myVar2
 myVar3
 etc
 What is the proper syntax to do this?
 Thanks,
  Tim


--
+--- my people are the people of the dessert, ---+
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
+ said t e lawrence, picking up his fork +
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Update Multiple Records From Form

2004-05-28 Thread Ford, Mike [LSS]
On 28 May 2004 04:47, Albert Padley wrote:

 I feel I'm so close.
 
 I have a form with multiple database records with a checkbox to
 indicate which records to update set up like so:
 
 $name = ed[ . $row['id'] . ];
 
 input type=\checkbox\ name=\ . $name . \ value=\Y\
 
 Each text input is set up like so:
 
 input type=\text\ name=\fname[]\ value=\ . $row['fname'] . \
 
 On the processing page I am doing this:
 
 foreach($ed as $id=$val){
   $query = UPDATE ref_events_reg
SETfname = '$fname'
   WHERE id = '{$id}';
 
 I am looping through the correct records, but every field is being
 updated to Array. 
 
 What tweak do I need to make?

I'd make two tweaks, actually.  First and most obviously, you're not selecting *which* 
fname field to pass to your update query, so this needs to be:

$query = UPDATE ref_events_reg
 SET fname = '{$fname[$id]}'
 WHERE id = '{$id}';

(By putting just $fname there, you are telling PHP to insert the string representation 
of the whole array -- and the string representation of any array is, er, exactly 
Array! ;)

This change may give you a clue to my other tweak -- I'd explicitly set the indexes of 
all the fname[] fields to be sure they sync correctly to the related check box, thus:

input type=\checkbox\ name=\ed[{$row['id']}]\ value=\Y\
input type=\text\ name=\fname[{$row['id']}]\ value=\{$row['fname']}\

Cheers!

Mike

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

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



[PHP] Communication

2004-05-28 Thread Jakes
I'm looking at distributing PHP applications to desktops, using SQLite as
the database.
All information that is updated in the application will be local on the
machine, until
published to the webserver.

My question is, what would be the best way to update the  webserver sitting
at a service provider.
What should I use for the communication? SOAP, Sockets, XML ???

Thanks

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



[PHP] Changing variable names in a while loop

2004-05-28 Thread I.A. Gray
Hi all,

Easy question (I hope).  My brain seems not be working today, so could
someone help me with this one?

I have a while loop outputting part of an html form which inputs track
information for CDs:

 $countything = 1;
  while ($countything !=31) {
  echo 
  tr
td$countything./td
tdinput name='fcomposer$countything' type='text'
id='fcomposer$countything' size='20' maxlength='60'//td
tdinput name='fsubheading$countything' type='text'
id='fsubheading$countything' size='20' maxlength='80' //td
tdinput name='fmovementno$countything' type='text'
id='fmovementno$countything' size='3' maxlength='3' //td
tdinput name='ftracktitle$countything' type='text'
id='ftracktitle$countything' size='20' maxlength='60' //td
tdinput name='ftracksubtitle$countything' type='text'
id='ftracksubtitle$countything' size='20' maxlength='80' //td
tdinput name='ftracklength$countything' type='text'
id='ftracklength$countything' size='5' maxlength='8' //td
tdinput name='fextrainfo$countything' type='text'
id='fextrainfo$countything' size='20' maxlength='80' //td
  /tr\n;
$countything++;
}


How can I get the value to change in each form?  The name and id for each
input field will change from (for example) fcomposer1 to fcomposer30 but how
do I change the value for each input to show the variables taken from the
database which will be $composer1 to $composer30 ? Obviously if I put in
$composer$countything that will just output the value of $composer followed
by the value for $countything, but I want it to output the value for
$composer1 if $countything=1 or $composer10 if $countything=10 .  Is there
something I can do with variable variables?  I couldn't see any examples in
the PHP manual.

Many thanks,

Ian Gray

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



[PHP] zlib compatibility

2004-05-28 Thread Francis Mak
Hi,

What I am trying to do:

- in VB, compress a string
- save it as a file
- use php to open it, then gzuncompress it

I am using a vb wrapper in:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42297ln
gWId=1

I am sure that the above program works, since it can uncompress the
file.  Acutally this program is only an interface using the zlib

I used the above demo, compressed a string then saved it as a file.
When I tried to use php to gzuncompress it, I got data error.  What is the
problem?  aren't they both using the zlib?

I also tried  gzinflate, still the same 'gzinflate(): data error in...'
below is the php code:

$handle = fopen(/tmp/tmpCompress.txt, r);
$contents = fread($handle, filesize(/tmp/tmpCompress.txt));
fclose($handle);
echo(gzuncompress ($contents));
I also tried to use binary read in php(i.e. rb), but still got stucked in
gzuncompress.

just another question, what is the difference between gzuncompress and
gzdeflate  ??

Thank you very much!!

Francis Mak

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



[PHP] Send HTML/plain text email using PHP

2004-05-28 Thread Matt MacLeod
I've been having a little trouble configuring a script to send a 
multipart email using PHP.

The script send the message, but when I recieve the email it doesn't 
display the HTML version and I have to tell my mail client to displlay 
the plain text version (Mail on OS X 10.3.3).

Here's the script:
$headers .= FROM: [EMAIL PROTECTED];
$headers .= Reply-To: [EMAIL PROTECTED];
$nonhtml = strip_tags($emailsend);
// This is the important part!
// This content type identifies the content of the message.
// The boundary delimits the plain text and html sections.
// The value of the boundary can be anything - you can even use the 
same one we used here
$headers .= Content-Type: multipart/alternative; 
boundary=\=_NextPart_000_002C_01BFABBF.4A7D6BA0\\n\n;
$headers .= X-Priority: 1\r\n;
$headers .= X-MSMail-Priority: High\r\n;
$headers .= X-Mailer: PHP/ . phpversion().\r\n;
$headers .= X-Sender: [EMAIL PROTECTED];
$headers .= Return-Path: [EMAIL PROTECTED];
// Now begin your message, starting with the delimiter we specified in 
the boundary
// Notice that two extra dashes (--) are added to the delimiters when
// They are actually being used.
$message = '--=_NextPart_000_002C_01BFABBF.4A7D6BA0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

';
$message .= $nonhtml;
$message .='
';
// Now begin your HTML message, starting with the delimiter
// Also notice that we add another content-type line which
// lets the mail client know to render it in HTML
$message .= '--=_NextPart_000_002C_01BFABBF.4A7D6BA0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
';
$message .= $emailsend.'
--=_NextPart_000_002C_01BFABBF.4A7D6BA0--';
// Now send the mail.
// The additional header, -f [EMAIL PROTECTED] is only required by
// some configurations.
echo $message;
$v = '[EMAIL PROTECTED]';
mail($v, Test, $message ,$headers,-f [EMAIL PROTECTED]);

Any ideas would be gratefully received!
Thanks,
Matt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Changing variable names in a while loop

2004-05-28 Thread Torsten Roehr
I.A. Gray [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 Easy question (I hope).  My brain seems not be working today, so could
 someone help me with this one?

 I have a while loop outputting part of an html form which inputs track
 information for CDs:

  $countything = 1;
   while ($countything !=31) {
   echo 
   tr
 td$countything./td
 tdinput name='fcomposer$countything' type='text'
 id='fcomposer$countything' size='20' maxlength='60'//td
 tdinput name='fsubheading$countything' type='text'
 id='fsubheading$countything' size='20' maxlength='80' //td
 tdinput name='fmovementno$countything' type='text'
 id='fmovementno$countything' size='3' maxlength='3' //td
 tdinput name='ftracktitle$countything' type='text'
 id='ftracktitle$countything' size='20' maxlength='60' //td
 tdinput name='ftracksubtitle$countything' type='text'
 id='ftracksubtitle$countything' size='20' maxlength='80' //td
 tdinput name='ftracklength$countything' type='text'
 id='ftracklength$countything' size='5' maxlength='8' //td
 tdinput name='fextrainfo$countything' type='text'
 id='fextrainfo$countything' size='20' maxlength='80' //td
   /tr\n;
 $countything++;
 }


 How can I get the value to change in each form?  The name and id for each
 input field will change from (for example) fcomposer1 to fcomposer30 but
how
 do I change the value for each input to show the variables taken from the
 database which will be $composer1 to $composer30 ? Obviously if I put in
 $composer$countything that will just output the value of $composer
followed
 by the value for $countything, but I want it to output the value for
 $composer1 if $countything=1 or $composer10 if $countything=10 .  Is there
 something I can do with variable variables?  I couldn't see any examples
in
 the PHP manual.

What you want is this:
$temp = 'composer' . $countything;
Then use ${$temp} - it will efectively be $composer1.

Take a look here:
http://de2.php.net/manual/en/language.variables.variable.php

Regards, Torsten Roehr

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



[PHP] Re: Send HTML/plain text email using PHP

2004-05-28 Thread Torsten Roehr
Maybe you could use a ready-made package such as PEAR's Mail_Mime:
http://pear.php.net/package/Mail_Mime

Regards,

Torsten Roehr

Matt Macleod [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I've been having a little trouble configuring a script to send a
 multipart email using PHP.

 The script send the message, but when I recieve the email it doesn't
 display the HTML version and I have to tell my mail client to displlay
 the plain text version (Mail on OS X 10.3.3).

 Here's the script:

 $headers .= FROM: [EMAIL PROTECTED];
 $headers .= Reply-To: [EMAIL PROTECTED];
 $nonhtml = strip_tags($emailsend);
 // This is the important part!
 // This content type identifies the content of the message.
 // The boundary delimits the plain text and html sections.
 // The value of the boundary can be anything - you can even use the
 same one we used here
 $headers .= Content-Type: multipart/alternative;
 boundary=\=_NextPart_000_002C_01BFABBF.4A7D6BA0\\n\n;
 $headers .= X-Priority: 1\r\n;
 $headers .= X-MSMail-Priority: High\r\n;
 $headers .= X-Mailer: PHP/ . phpversion().\r\n;
 $headers .= X-Sender: [EMAIL PROTECTED];
 $headers .= Return-Path: [EMAIL PROTECTED];
 // Now begin your message, starting with the delimiter we specified in
 the boundary
 // Notice that two extra dashes (--) are added to the delimiters when
 // They are actually being used.
 $message = '--=_NextPart_000_002C_01BFABBF.4A7D6BA0
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit

 ';
 $message .= $nonhtml;

 $message .='
 ';


 // Now begin your HTML message, starting with the delimiter
 // Also notice that we add another content-type line which
 // lets the mail client know to render it in HTML
 $message .= '--=_NextPart_000_002C_01BFABBF.4A7D6BA0
 Content-Type: text/html; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 ';
 $message .= $emailsend.'

 --=_NextPart_000_002C_01BFABBF.4A7D6BA0--';

 // Now send the mail.
 // The additional header, -f [EMAIL PROTECTED] is only required by
 // some configurations.

 echo $message;
 $v = '[EMAIL PROTECTED]';

 mail($v, Test, $message ,$headers,-f [EMAIL PROTECTED]);



 Any ideas would be gratefully received!

 Thanks,
 Matt

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



RE: [PHP] Re: Changing variable names in a while loop

2004-05-28 Thread I.A. Gray
Thanks, Torsten. That clears things up quite a bit.  I do find the PHP
manual a little heavy going sometimes.  Does this mean then that I have to
do this:
$tempcomposer = 'composer' . $countything;
$tempsubheading = 'subheading' . $countything;
$tempmovementno = 'movementno' . $countything;

etc...

as I have about 8 variables to change?

Best wishes,

Ian Gray


-Original Message-
From: Torsten Roehr [mailto:[EMAIL PROTECTED]
Sent: 28 May 2004 12:30
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Changing variable names in a while loop


I.A. Gray [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 Easy question (I hope).  My brain seems not be working today, so could
 someone help me with this one?

 I have a while loop outputting part of an html form which inputs track
 information for CDs:

  $countything = 1;
   while ($countything !=31) {
   echo 
   tr
 td$countything./td
 tdinput name='fcomposer$countything' type='text'
 id='fcomposer$countything' size='20' maxlength='60'//td
 tdinput name='fsubheading$countything' type='text'
 id='fsubheading$countything' size='20' maxlength='80' //td
 tdinput name='fmovementno$countything' type='text'
 id='fmovementno$countything' size='3' maxlength='3' //td
 tdinput name='ftracktitle$countything' type='text'
 id='ftracktitle$countything' size='20' maxlength='60' //td
 tdinput name='ftracksubtitle$countything' type='text'
 id='ftracksubtitle$countything' size='20' maxlength='80' //td
 tdinput name='ftracklength$countything' type='text'
 id='ftracklength$countything' size='5' maxlength='8' //td
 tdinput name='fextrainfo$countything' type='text'
 id='fextrainfo$countything' size='20' maxlength='80' //td
   /tr\n;
 $countything++;
 }


 How can I get the value to change in each form?  The name and id for each
 input field will change from (for example) fcomposer1 to fcomposer30 but
how
 do I change the value for each input to show the variables taken from the
 database which will be $composer1 to $composer30 ? Obviously if I put in
 $composer$countything that will just output the value of $composer
followed
 by the value for $countything, but I want it to output the value for
 $composer1 if $countything=1 or $composer10 if $countything=10 .  Is there
 something I can do with variable variables?  I couldn't see any examples
in
 the PHP manual.

What you want is this:
$temp = 'composer' . $countything;
Then use ${$temp} - it will efectively be $composer1.

Take a look here:
http://de2.php.net/manual/en/language.variables.variable.php

Regards, Torsten Roehr

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

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



Re: [PHP] Re: Changing variable names in a while loop

2004-05-28 Thread Torsten Roehr
I.A. Gray [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Thanks, Torsten. That clears things up quite a bit.  I do find the PHP
 manual a little heavy going sometimes.  Does this mean then that I have to
 do this:
 $tempcomposer = 'composer' . $countything;
 $tempsubheading = 'subheading' . $countything;
 $tempmovementno = 'movementno' . $countything;

 etc...

 as I have about 8 variables to change?

I think so, yes. Just put them into your loop and then use ${$tempcomposer}
and so on to put the value into your input value attribute.

Regards, Torsten

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



[PHP] Mysql Problem

2004-05-28 Thread Ian Barnes
Hi,

I am generating a mysql statement and then printing it to a formatted field.
Here is my code:

$sql=SELECT * from tablename where name in ('Web','HTML','PHP') group by
name;
$mysql_rslt1 = mysql_query($sql, $mysql_bconn)
or die (Could not get data);
while ($rec1 = mysql_fetch_array ($mysql_rslt1)) {
echo some stuff here;
}

Now the problem is it will leave out the last line of the reply. So it would
leave out the 'PHP' line for the query above. Always the last line, and if
for some reason i only have 1 in my query, it displays nothing, although if
I do it manually using the mysql prompt, it works fine, and i get back the
info I want. All the other lines format properly and the info is correct,
just the last line doesnt display.

Any ideas ?

Ian

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



[PHP] Re: Mysql Problem

2004-05-28 Thread Torsten Roehr
Ian Barnes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I am generating a mysql statement and then printing it to a formatted
field.
 Here is my code:

 $sql=SELECT * from tablename where name in ('Web','HTML','PHP') group by
 name;

You are missing the closing quote here!

Please set your error reporting to E_ALL while developing:
ini_set('error_reporting', E_ALL);

Regards, Torsten Roehr


 $mysql_rslt1 = mysql_query($sql, $mysql_bconn)
 or die (Could not get data);
 while ($rec1 = mysql_fetch_array ($mysql_rslt1)) {
 echo some stuff here;
 }

 Now the problem is it will leave out the last line of the reply. So it
would
 leave out the 'PHP' line for the query above. Always the last line, and if
 for some reason i only have 1 in my query, it displays nothing, although
if
 I do it manually using the mysql prompt, it works fine, and i get back the
 info I want. All the other lines format properly and the info is correct,
 just the last line doesnt display.

 Any ideas ?

 Ian

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



RE: [PHP] Re: Mysql Problem

2004-05-28 Thread Ian Barnes
Hi,

Yes that was my mistake. But even with the code, it still doesnt display the
last one. If i didnt put a  it wouldnt work at all.

Thanks,
Ian

-Original Message-
From: Torsten Roehr [mailto:[EMAIL PROTECTED]
Sent: 28 May 2004 13:56
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Mysql Problem


Ian Barnes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I am generating a mysql statement and then printing it to a formatted
field.
 Here is my code:

 $sql=SELECT * from tablename where name in ('Web','HTML','PHP') group by
 name;

You are missing the closing quote here!

Please set your error reporting to E_ALL while developing:
ini_set('error_reporting', E_ALL);

Regards, Torsten Roehr


 $mysql_rslt1 = mysql_query($sql, $mysql_bconn)
 or die (Could not get data);
 while ($rec1 = mysql_fetch_array ($mysql_rslt1)) {
 echo some stuff here;
 }

 Now the problem is it will leave out the last line of the reply. So it
would
 leave out the 'PHP' line for the query above. Always the last line, and if
 for some reason i only have 1 in my query, it displays nothing, although
if
 I do it manually using the mysql prompt, it works fine, and i get back the
 info I want. All the other lines format properly and the info is correct,
 just the last line doesnt display.

 Any ideas ?

 Ian

--
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 as CGI becomes a zombie when loaded too often

2004-05-28 Thread Florian Effenberger
Sorry for posting this again and again, but I still experience this
problem and there seems to be no way for me to solve it. I've got
confirmation from others that this problem is not only mine, so please
take the time to read this.
I've tried Apache 1.3 and 2.0, both on Linux 2.4. I've tried using
suEXEC and not using suEXEC, and I even tried modules that stop script
execution at a specific load average (tested with 1.00!) or number of
processes (tested with 10!). But nothing seems to help in the
following case:
I run PHP as CGI because I don't want to have world-readable scripts
and mod_perchild is not ready yet. When I do a hard reload - i.e.
reloading the same script for about 10 seconds continously which
should open quite a lot of scripts - I can crash the server. PHP-CGI-
processes become zombies, I get a load average of about 90 (!) and it
can take up to 30 minutes until the system responds again. This
happens even with the simplest PHP scripts like a phpinfo call, but
Perl scripts make absolutely no problem.
The PHP developers say it's an Apache problem, the Apache developers
say it's a PHP problem. So *PLEASE* take the time to review this one
again - I'm helpless right now! :-( I know there must be a solution,
because some providers run PHP as CGI without problems, but I don't
know what it could be. :-(
Also see http://bugs.php.net/bug.php?id=28556edit=1
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: Changing variable names in a while loop

2004-05-28 Thread Ford, Mike [LSS]
On 28 May 2004 12:30, Torsten Roehr wrote:

 I.A. Gray [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hi all,
  
  Easy question (I hope).  My brain seems not be working today, so
  could someone help me with this one?

[...]

  How can I get the value to change in each form?  The name and id
  for each input field will change from (for example) fcomposer1 to
 fcomposer30 but
 how
  do I change the value for each input to show the variables taken
  from the database which will be $composer1 to $composer30 ?
  Obviously if I put in $composer$countything that will just output
  the value of $composer followed by the value for $countything, but
  I want it to output the value for $composer1 if $countything=1 or
  $composer10 if $countything=10 .  Is there something I can do with
  variable variables?  I couldn't see 
 any examples
 in
  the PHP manual.
 
 What you want is this:
 $temp = 'composer' . $countything;
 Then use ${$temp} - it will efectively be $composer1.

You can also write this as

  ${'composer'.$countything}

But I'd really, really suggest looking into using arrays for this -- it looks much 
more like an array-ish problem than a variable-variable-ish problem to me.  Using 
arrays, your input fields would look like:

  input name='fcomposer[$countything]' type='text' size='20' maxlength='60' /

and then your processing code can easily address $fcomposer[$countything] etc.

Cheers!

Mike

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

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



Re: [PHP] Identifying spam text

2004-05-28 Thread Scot L. Harris
On Fri, 2004-05-28 at 03:31, Merlin wrote:
 Hi there,
 
 I am running a community site in php, where members can be contacted through a 
 web form. Yesterday a guy contacted about 50 of those members with a spam text.
 
 Now I am trying to find a way to identify spam text via php. This looks like a 
 common task to me, so I hope that I have not to invent the wheel twice. Maybe 
 someone knows a good script to do this?
 
 Basicly it looks like that the text has to be checked against certain key words 
 and if they reach a certain amount of hits it is spam text.
 Has anybody a good idea on how to start on this?
 
 Thank you for any hint,
 
 Merlin

In your place I would utilize spamassassin to filter those outgoing
messages.  I use it on incoming email as filter with my email program. 
I pass each message to it and the return code tells me if it is spam or
not.  I then funnel messages marked as spam to a separate folder.

In your case you would take each outgoing message and run it through
spamassassin, evaluate the score assigned, and either pass it on or
redirect it for alternate processing.

Also by using spamassassin you can take advantage of its baysian
analysis.  You can train it so it recognizes the kind of traffic you
expect to see as ham and spam.  


-- 
Scot L. Harris [EMAIL PROTECTED]

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



Re: [PHP] Newbie Question: Variables on the fly

2004-05-28 Thread Curt Zirzow
* Thus wrote Steve Edberg ([EMAIL PROTECTED]):
 At 2:01 AM -0300 5/28/04, [EMAIL PROTECTED] wrote:
 
 However, most of what you can do with them can be done more simply 
 with arrays. In your example above, use
 
   myPage.php?dataPoint[]=10dataPoint[]=20dataPoint[]=30
 

I'd also suggest to add the index in the dataPoints, so you're not
relying on the browser or php to determain what order the array
will be built.

myPage.php?dataPoint[1]=10dataPoint[3]=20dataPoint[1]=30


Go Aggies!

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

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



[PHP] PHP doesn't work under SSL for Apache

2004-05-28 Thread Bryan Waters
I have an Apache 1.3.27 server configured with SSL, PHP and so on...

My problem is that PHP doesn't work under the SSL virtual host...it works
under other named virtual hosts and the main site, but it simply doesn't
work under the _default_:443 virtualhost for some reason...on any other
non-ssl page on the site, php works...(my virtualhost config is below...)
but under SLL i can get html but not php pages to return...

What am i missing?  If i didn't include enough information, my
apologies...it seemed overkill to include the entire conf file.

thx
-bryanw

VirtualHost _default_:443
DocumentRoot /home/mydomain/html
ServerName secure.mydomain.com
ServerAdmin [EMAIL PROTECTED]
ErrorLog /usr/local/apache/logs/error_Log
TransferLog /usr/local/apache/logs/access_log

  SSLEngine on
  SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
  SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
  Files ~ \.(cgi|shtml|phtml|php3?)$
 SSLOptions +StdEnvVars
  /Files
  Directory /usr/local/apache/cgi-bin
SSLOptions +StdEnvVars
 /Directory
SetEnvIf User-Agent .*MSIE.* \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/ssl_request_log \
  %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
/VirtualHost

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



Re: [PHP] Re: Send HTML/plain text email using PHP

2004-05-28 Thread Matt MacLeod
OK, I managed to find a script that appears to work (at least for me  
and a few other people, anyway).

The only thing is that if you look at the raw source of the email it  
comes out as nonsense.  eg:

CgoKRU1BSUwKCgoKCgoKCgoKCgpMb25kb24gMjEgTmV3c2xldHRlcgpGT1IgQUNUSU9OIElO 
IFRI
RSBDT01NVU5JVFkKCiZuYnNwOwpOZXdzbGV0dGVyIC0gSXNzdWUgMTggLSBNYXkgMjAwNAoK 
U29t
ZSBpbXBvcnRhbnQgZGF0ZXMgZm9yIHlvdXIgZGlhcnkgaW4gTG9uZG9uIDIxknMgVXBkYXRl 
IGJl
bG93IG9uIDQsIDUgYW5kIDYgSnVuZSBmb3Ig

I've looked at the raw source for other HTML/multipart emails in my in  
box and it displays the html code.

There's obviously somehting in there that I've missed. It's frustrating  
because it works fine when I receive the messages on my mac!!!


On 28 May 2004, at 12:32, Torsten Roehr wrote:
Maybe you could use a ready-made package such as PEAR's Mail_Mime:
http://pear.php.net/package/Mail_Mime
Regards,
Torsten Roehr
Matt Macleod [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I've been having a little trouble configuring a script to send a
multipart email using PHP.
The script send the message, but when I recieve the email it doesn't
display the HTML version and I have to tell my mail client to displlay
the plain text version (Mail on OS X 10.3.3).
Here's the script:
$headers .= FROM: [EMAIL PROTECTED];
$headers .= Reply-To: [EMAIL PROTECTED];
$nonhtml = strip_tags($emailsend);
// This is the important part!
// This content type identifies the content of the message.
// The boundary delimits the plain text and html sections.
// The value of the boundary can be anything - you can even use the
same one we used here
$headers .= Content-Type: multipart/alternative;
boundary=\=_NextPart_000_002C_01BFABBF.4A7D6BA0\\n\n;
$headers .= X-Priority: 1\r\n;
$headers .= X-MSMail-Priority: High\r\n;
$headers .= X-Mailer: PHP/ . phpversion().\r\n;
$headers .= X-Sender: [EMAIL PROTECTED];
$headers .= Return-Path: [EMAIL PROTECTED];
// Now begin your message, starting with the delimiter we specified in
the boundary
// Notice that two extra dashes (--) are added to the delimiters when
// They are actually being used.
$message = '--=_NextPart_000_002C_01BFABBF.4A7D6BA0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
';
$message .= $nonhtml;
$message .='
';
// Now begin your HTML message, starting with the delimiter
// Also notice that we add another content-type line which
// lets the mail client know to render it in HTML
$message .= '--=_NextPart_000_002C_01BFABBF.4A7D6BA0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
';
$message .= $emailsend.'
--=_NextPart_000_002C_01BFABBF.4A7D6BA0--';
// Now send the mail.
// The additional header, -f [EMAIL PROTECTED] is only required  
by
// some configurations.

echo $message;
$v = '[EMAIL PROTECTED]';
mail($v, Test, $message ,$headers,-f [EMAIL PROTECTED]);

Any ideas would be gratefully received!
Thanks,
Matt
--
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] PHP doesn't work under SSL for Apache

2004-05-28 Thread R'twick Niceorgaw
Quoting Bryan Waters [EMAIL PROTECTED]:

 I have an Apache 1.3.27 server configured with SSL, PHP and so on...
 
 My problem is that PHP doesn't work under the SSL virtual host...it works
 under other named virtual hosts and the main site, but it simply doesn't
 work under the _default_:443 virtualhost for some reason...on any other
 non-ssl page on the site, php works...(my virtualhost config is below...)
 but under SLL i can get html but not php pages to return...
 
 What am i missing?  If i didn't include enough information, my
 apologies...it seemed overkill to include the entire conf file.

I'm not sure but may be you need to include something like 
  php_admin php_engine on 
to the ssl vhost config section?
HTH
R'twick
-- 
This is a signature


This message was sent using IMP, the Internet Messaging Program.

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



[PHP] making selection in drop down

2004-05-28 Thread Alex Hogan
Hi All,
 

How can I force a selection on a drop down from a value in a database?

I have a drop down that contains locations.  These locations are
contained in a table.  When a search is completed the results are
displayed and I want to be able to use that same drop down and just
force the selection to the appropriate location.

 

alex hogan

 

 

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


Re: [PHP] Send HTML/plain text email using PHP

2004-05-28 Thread Curt Zirzow
* Thus wrote Matt MacLeod ([EMAIL PROTECTED]):
 ...
 
 $headers .= Reply-To: [EMAIL PROTECTED];
 $nonhtml = strip_tags($emailsend);
 // This is the important part!
 // This content type identifies the content of the message.
 // The boundary delimits the plain text and html sections.
 // The value of the boundary can be anything - you can even use the 
 same one we used here
 $headers .= Content-Type: multipart/alternative; 
 boundary=\=_NextPart_000_002C_01BFABBF.4A7D6BA0\\n\n;

You've just signified end of headers with the \n\n perhaps you
meant \r\n.

 $headers .= X-Priority: 1\r\n;
 $headers .= X-MSMail-Priority: High\r\n;
 $headers .= X-Mailer: PHP/ . phpversion().\r\n;
 $headers .= X-Sender: [EMAIL PROTECTED];
 $headers .= Return-Path: [EMAIL PROTECTED];

Adding Return-Path: is useless since it will be ignored.



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

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



Re: [PHP] making selection in drop down

2004-05-28 Thread Miguel J. Jiménez
Use HTML attribute selected in the option field you want to set as 
default...

Alex Hogan wrote:
Hi All,
How can I force a selection on a drop down from a value in a database?
I have a drop down that contains locations.  These locations are
contained in a table.  When a search is completed the results are
displayed and I want to be able to use that same drop down and just
force the selection to the appropriate location.

alex hogan


*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*


---
avast! Antivirus: Mensaje ENTRANTE limpio.
Base de datos de Virus (VPS): 0422-1, 27/05/2004
Fecha: 28/05/2004 16:43:03

 

--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
mjjimenez AT isotrol DOT com   ---   http://www.isotrol.com
ICQ# 12670750
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] making selection in drop down

2004-05-28 Thread Alex Hogan

 Use HTML attribute selected in the option field you want to 
 set as default...

Yes.., thank you.., however I am more interested in how to force that selection to a 
specific option tag in the dropdown from a search.  If I'm missing your point please 
excuse me.  I'm a little brain dead this morning.

If I have something like this what I'll want to do is to identify the point in the 
array where I can force the selected to be the default based on the previous search.

select name=sellocation class=body_text id=sellocation
option value=0 ?=$option[0]?Make Selection/option
?
$i = 1;
while($row = mssql_fetch_array($result))
{
$v = $row['loc_id'];
$n = $row['loc_city'];
echo option value=\$v\ $option[$i]$n/option;
}

?

Is there a better way of doing this?




alex hogan

*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



Re: [PHP] making selection in drop down

2004-05-28 Thread Torsten Roehr
Alex Hogan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

  Use HTML attribute selected in the option field you want to
  set as default...

 Yes.., thank you.., however I am more interested in how to force that
selection to a specific option tag in the dropdown from a search.  If I'm
missing your point please excuse me.  I'm a little brain dead this morning.

 If I have something like this what I'll want to do is to identify the
point in the array where I can force the selected to be the default based on
the previous search.

 select name=sellocation class=body_text id=sellocation
 option value=0 ?=$option[0]?Make Selection/option
 ?
 $i = 1;
 while($row = mssql_fetch_array($result))
 {
 $v = $row['loc_id'];
 $n = $row['loc_city'];
 echo option value=\$v\ $option[$i]$n/option;
 }

Try this:

while ($row = mssql_fetch_array($result)) {
$v = $row['loc_id'];
$n = $row['loc_city'];

echo option value=\$v\ ;

// if current loc_id is previously selected loc_id set selected
echo ($_POST['sellocation'] == $v) ? 'selected' : '';

echo $option[$i]$n/option;
}

Regards,

Torsten Roehr

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



Re: [PHP] making selection in drop down

2004-05-28 Thread Tristan . Pretty
I use a javascript to help me with bigger dropdowns...
script
function get_links() {
document.all[field_name].value='?echo$field_name; ?'
/script






Torsten Roehr [EMAIL PROTECTED] 
28/05/2004 16:12

To
[EMAIL PROTECTED]
cc

Subject
Re: [PHP] making selection in drop down






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

  Use HTML attribute selected in the option field you want to
  set as default...

 Yes.., thank you.., however I am more interested in how to force that
selection to a specific option tag in the dropdown from a search.  If I'm
missing your point please excuse me.  I'm a little brain dead this 
morning.

 If I have something like this what I'll want to do is to identify the
point in the array where I can force the selected to be the default based 
on
the previous search.

 select name=sellocation class=body_text id=sellocation
 option value=0 ?=$option[0]?Make Selection/option
 ?
 $i = 1;
 while($row = mssql_fetch_array($result))
 {
 $v = $row['loc_id'];
 $n = $row['loc_city'];
 echo option value=\$v\ $option[$i]$n/option;
 }

Try this:

while ($row = mssql_fetch_array($result)) {
$v = $row['loc_id'];
$n = $row['loc_city'];

echo option value=\$v\ ;

// if current loc_id is previously selected loc_id set selected
echo ($_POST['sellocation'] == $v) ? 'selected' : '';

echo $option[$i]$n/option;
}

Regards,

Torsten Roehr

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





*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***

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



[PHP] fsockopen() throwing errors

2004-05-28 Thread Phil Ewington - 43 Plc
Hi All,

How can I stop fsockopen() throwing an error and killing my script when it
cannot connect?

I have tried the following:

$this-_Socket = fsockopen($s_server, $this-_Port, $i_errno, $s_errstr,
$this-_Timeout);
if (!$this-_Socket)
{
... code to handle connection failure
}

and ...

if (!$this-_Socket = fsockopen($s_server, $this-_Port, $i_errno,
$s_errstr, $this-_Timeout))
{
... code to handle connection failure
}

I have also tried prefixing fsockopen() with @ but when it fails to connect
it kills my script by throwing an error. Any advise here will be much
appreciated as this code is mission critical.

TIA

- Phil.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 22/05/2004

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



[PHP] Unable to load pages with errors

2004-05-28 Thread peter a

I have stumbled on something that is new for me. Usually when I get a 
PHP error I print them on the page, but suddenly pages with errors don't 
load at all, in IE I get the usual The page cannot be displayed and in 
Lynx I get Alert!: Unable to access document.

I run PHP 4.3.2 and Apache 2.0.47 on RedHat 9.
Ideas anyone?
   /peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Unable to load pages with errors

2004-05-28 Thread Chris W. Parker
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 8:29 AM said:

 I have stumbled on something that is new for me. Usually when I get a
 PHP error I print them on the page, but suddenly pages with errors
 don't load at all, in IE I get the usual The page cannot be
 displayed and in Lynx I get Alert!: Unable to access document.

first of all turn off friendly http errors in internet explorer and that
should show you what error is happening. then you can go from there.



chris.

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



Re: [PHP] Unable to load pages with errors

2004-05-28 Thread peter a
Thanks, but that didn't take me anywhere. My browser still seems to hang 
itself or load a part of the page. I suppose it could be any of my 
http-processes that freezes up.. but I don't seems like it and I don't 
know why it would. Doesn't matter which browser I use either.
  /peter

Chris W. Parker wrote:
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 8:29 AM said:

I have stumbled on something that is new for me. Usually when I get a
PHP error I print them on the page, but suddenly pages with errors
don't load at all, in IE I get the usual The page cannot be
displayed and in Lynx I get Alert!: Unable to access document.

first of all turn off friendly http errors in internet explorer and that
should show you what error is happening. then you can go from there.

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


RE: [PHP] Unable to load pages with errors

2004-05-28 Thread Chris W. Parker
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 9:06 AM said:

 Thanks, but that didn't take me anywhere. My browser still seems to
 hang itself or load a part of the page. I suppose it could be any of
 my http-processes that freezes up.. but I don't seems like it and I
 don't know why it would. Doesn't matter which browser I use either.

is the page doing anything complicated that would cause it to take a
long time to finish (and subsequently load)?



c.

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



Re: [PHP] Unable to load pages with errors

2004-05-28 Thread peter a
Nothing complicated at all. It loops out some values from a MySQL 
database with not more than 20 entries. It's not that..
 /peter

Chris W. Parker wrote:
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 9:06 AM said:

Thanks, but that didn't take me anywhere. My browser still seems to
hang itself or load a part of the page. I suppose it could be any of
my http-processes that freezes up.. but I don't seems like it and I
don't know why it would. Doesn't matter which browser I use either.

is the page doing anything complicated that would cause it to take a
long time to finish (and subsequently load)?

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


RE: [PHP] Unable to load pages with errors

2004-05-28 Thread Chris W. Parker
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 9:12 AM said:

 Nothing complicated at all. It loops out some values from a MySQL
 database with not more than 20 entries. It's not that..

well unless it's a server thing (in which case i'd have no ideas towards
a solution) your next step is to strip the file until it starts working
again. or you can start from scratch checking the page at every step
until it stops working.



chris.

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



Re: [PHP] Unable to load pages with errors

2004-05-28 Thread peter a
It not just that page.. it is all pages the will generate some sort of 
PHP error. Instead of the usual error output I get nothing.
  /peter

Chris W. Parker wrote:
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 9:12 AM said:

Nothing complicated at all. It loops out some values from a MySQL
database with not more than 20 entries. It's not that..

well unless it's a server thing (in which case i'd have no ideas towards
a solution) your next step is to strip the file until it starts working
again. or you can start from scratch checking the page at every step
until it stops working.

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


Re: [PHP] Identifying spam text

2004-05-28 Thread jon
An easy thing to do might be to limit the number of submissions a single 
IP address can submit in a given period of time. That way, an occasional 
spam will get through, but its effect will be limited.

Also, if this web form has a standard url -- like you got it from a 
major script site like hotscripts or something -- just changing the url 
and some of the form names away from the default settings will go a long 
way towards thwarting a casual spam attacker. Mostly, these types of 
events seem related to targets of opportunity, so to speak.

-- jon
--
jon roig
web developer
phone: 888.230.7557
email: [EMAIL PROTECTED]
Merlin wrote:
Hi there,
I am running a community site in php, where members can be contacted 
through a web form. Yesterday a guy contacted about 50 of those members 
with a spam text.

Now I am trying to find a way to identify spam text via php. This looks 
like a common task to me, so I hope that I have not to invent the wheel 
twice. Maybe someone knows a good script to do this?

Basicly it looks like that the text has to be checked against certain 
key words and if they reach a certain amount of hits it is spam text.
Has anybody a good idea on how to start on this?

Thank you for any hint,
Merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Unable to load pages with errors

2004-05-28 Thread Chris W. Parker
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 9:17 AM said:

 It not just that page.. it is all pages the will generate some sort of
 PHP error. Instead of the usual error output I get nothing.

hmm... sounds like a php configuration thing. i.e. a server thing. in
which case i'm all out of ideas. good luck!



c.

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



Re: [PHP] Update Multiple Records From Form

2004-05-28 Thread Albert Padley
On May 28, 2004, at 3:50 AM, Ford, Mike [LSS] wrote:
On 28 May 2004 04:47, Albert Padley wrote:
I feel I'm so close.
I have a form with multiple database records with a checkbox to
indicate which records to update set up like so:
$name = ed[ . $row['id'] . ];
input type=\checkbox\ name=\ . $name . \ value=\Y\
Each text input is set up like so:
input type=\text\ name=\fname[]\ value=\ . $row['fname'] . \
On the processing page I am doing this:
foreach($ed as $id=$val){
  $query = UPDATE ref_events_reg
 SETfname = '$fname'
WHERE id = '{$id}';
I am looping through the correct records, but every field is being
updated to Array.
What tweak do I need to make?
I'd make two tweaks, actually.  First and most obviously, you're not 
selecting *which* fname field to pass to your update query, so this 
needs to be:

$query = UPDATE ref_events_reg
 SET fname = '{$fname[$id]}'
 WHERE id = '{$id}';
(By putting just $fname there, you are telling PHP to insert the 
string representation of the whole array -- and the string 
representation of any array is, er, exactly Array! ;)

This change may give you a clue to my other tweak -- I'd explicitly 
set the indexes of all the fname[] fields to be sure they sync 
correctly to the related check box, thus:

input type=\checkbox\ name=\ed[{$row['id']}]\ value=\Y\
input type=\text\ name=\fname[{$row['id']}]\ 
value=\{$row['fname']}\

Cheers!
Mike
Mike,
Thanks for the tweaks. That solved the problem.
I had actually tried something like that, but obviously didn't have all 
the parts working together at the same time.

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


Re: [PHP] Re: Send HTML/plain text email using PHP

2004-05-28 Thread jon
Yeah... gotta agree with that -- the PEAR package makes dealing with 
mime mail incredibly easy. I love that thing.

-- jon
--
jon roig
web developer
phone: 888.230.7557
email: [EMAIL PROTECTED]
Torsten Roehr wrote:
Maybe you could use a ready-made package such as PEAR's Mail_Mime:
http://pear.php.net/package/Mail_Mime
Regards,
Torsten Roehr
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Unable to load pages with errors

2004-05-28 Thread Michael Sims
peter a wrote:
 It not just that page.. it is all pages the will generate some sort of
 PHP error. Instead of the usual error output I get nothing.

Sounds to me like the apache process is segfaulting when PHP's error handler is
invoked.  You say it used to work for you, what changed recently?  Did you install a
new version of Apache, or PHP?  Did you change the configuration of either?  Is
there anything in the apache error log?

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



Re: [PHP] Unable to load pages with errors

2004-05-28 Thread peter a
No the file is there. I see it in the access logs for apache (even 
though last night it didn't even show up there.. ), but it refuses to load.

Every time I get a PHP error the page freezes up and my browser tries to 
load it forever or I get The page cannot be dispalyed. The file is 
there.. it just won't load..

In a working PHP-file I added some code that for sure wouldn't work, and 
the page froze. Still showed up in the access log though.. but it didn't 
display any output at all obviously.
 /peter


Peter Risdon wrote:
peter a wrote:

I have stumbled on something that is new for me. Usually when I get a 
PHP error I print them on the page, but suddenly pages with errors 
don't load at all, in IE I get the usual The page cannot be 
displayed and in Lynx I get Alert!: Unable to access document.

Lynx generally knows what it is talking about. It sounds as though your 
page really is not available. You have given very little detail - the 
webserver logs might be interesting, for example, because they'd show 
what document the browsers were trying to access. But I'd guess your php 
error - if that's what it is - consists of trying to load a non-existent 
url.

Stabbing in the dark here - have you missed a ? before GET arguments?
PWR.
I run PHP 4.3.2 and Apache 2.0.47 on RedHat 9.
Ideas anyone?
   /peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] how to redirect with post method

2004-05-28 Thread Ral Castro
Hello,
I have a webpage that I'm redirecting to other page with header command, for instance: 
header(location:information.php?cod1=$cod1cod2=$cod2...codn=$codn);

I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do this? thanks.

Re: [PHP] Unable to load pages with errors

2004-05-28 Thread peter a
PHP configuration has not been changed though... so it's just strange.. 
I read something about a similiar trouble if you SSL on the server, I 
have SSL installed but this site is not under https. Anybody now 
anything about that?
/peter


Chris W. Parker wrote:
peter a mailto:[EMAIL PROTECTED]
on Friday, May 28, 2004 9:17 AM said:

It not just that page.. it is all pages the will generate some sort of
PHP error. Instead of the usual error output I get nothing.

hmm... sounds like a php configuration thing. i.e. a server thing. in
which case i'm all out of ideas. good luck!

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


Re: [PHP] Unable to load pages with errors

2004-05-28 Thread peter a
I have not changed my configuration lateley, what I know of. There is 
another guy working on the server, but he said he had changed nothing 
either. I've been running this configuration for a couple of months now 
and it has never caused me any troubles.
  /peter

Michael Sims wrote:
peter a wrote:
It not just that page.. it is all pages the will generate some sort of
PHP error. Instead of the usual error output I get nothing.

Sounds to me like the apache process is segfaulting when PHP's error handler is
invoked.  You say it used to work for you, what changed recently?  Did you install a
new version of Apache, or PHP?  Did you change the configuration of either?  Is
there anything in the apache error log?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] how to redirect with post method

2004-05-28 Thread John Nichel
Ral Castro wrote:
Hello,
I have a webpage that I'm redirecting to other page with header command, for instance: 
header(location:information.php?cod1=$cod1cod2=$cod2...codn=$codn);
I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do this? thanks.
Easy way, JavaScript.
More involved way, Sockets
--
John C. Nichel
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] how to redirect with post method

2004-05-28 Thread raditha dissanayake
Ral Castro wrote:
Hello,
I have a webpage that I'm redirecting to other page with header command, for instance: 
header(location:information.php?cod1=$cod1cod2=$cod2...codn=$codn);
I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do this? thanks.
 

In fact if you redirect from a page that accepts POST data, the POST 
data will not be carried along to the next page. That's probably why 
John suggested you look at sockets. All in all it's very rarely that you 
need to accept post data and then redirect, most of the time you can 
either include another script in your main script or do with the data if 
there's no alternative other than to redirect.


--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: PHP doesn't work under SSL for Apache

2004-05-28 Thread Bryan Waters
I've asked this question in 4 different places and in each place i've not
received a single response...is that because its too hard or too esoteric?
I need to get this resolved and i'm stumped...

Please help!

thanks again
-bryanw

-Original Message-
From: Bryan Waters [mailto:[EMAIL PROTECTED]
Sent: Friday, May 28, 2004 7:27 AM
To: [EMAIL PROTECTED] Php. Net
Subject: PHP doesn't work under SSL for Apache


I have an Apache 1.3.27 server configured with SSL, PHP and so on...

My problem is that PHP doesn't work under the SSL virtual host...it works
under other named virtual hosts and the main site, but it simply doesn't
work under the _default_:443 virtualhost for some reason...on any other
non-ssl page on the site, php works...(my virtualhost config is below...)
but under SLL i can get html but not php pages to return...

What am i missing?  If i didn't include enough information, my
apologies...it seemed overkill to include the entire conf file.

thx
-bryanw

VirtualHost _default_:443
DocumentRoot /home/mydomain/html
ServerName secure.mydomain.com
ServerAdmin [EMAIL PROTECTED]
ErrorLog /usr/local/apache/logs/error_Log
TransferLog /usr/local/apache/logs/access_log

  SSLEngine on
  SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
  SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
  Files ~ \.(cgi|shtml|phtml|php3?)$
 SSLOptions +StdEnvVars
  /Files
  Directory /usr/local/apache/cgi-bin
SSLOptions +StdEnvVars
 /Directory
SetEnvIf User-Agent .*MSIE.* \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/ssl_request_log \
  %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
/VirtualHost

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



Re: [PHP] RE: PHP doesn't work under SSL for Apache

2004-05-28 Thread John Nichel
Bryan Waters wrote:
I have an Apache 1.3.27 server configured with SSL, PHP and so on...
My problem is that PHP doesn't work under the SSL virtual host...it works
under other named virtual hosts and the main site, but it simply doesn't
work under the _default_:443 virtualhost for some reason...on any other
non-ssl page on the site, php works...(my virtualhost config is below...)
but under SLL i can get html but not php pages to return...
What am i missing?  If i didn't include enough information, my
apologies...it seemed overkill to include the entire conf file.
thx
-bryanw
VirtualHost _default_:443
DocumentRoot /home/mydomain/html
ServerName secure.mydomain.com
ServerAdmin [EMAIL PROTECTED]
ErrorLog /usr/local/apache/logs/error_Log
TransferLog /usr/local/apache/logs/access_log
  SSLEngine on
  SSLCipherSuite
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt
  SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key
  Files ~ \.(cgi|shtml|phtml|php3?)$
 SSLOptions +StdEnvVars
  /Files
  Directory /usr/local/apache/cgi-bin
SSLOptions +StdEnvVars
 /Directory
SetEnvIf User-Agent .*MSIE.* \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/ssl_request_log \
  %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
/VirtualHost
Not sure if this is it, but you may try adding these lines to you secure 
virtual, and restarting Apache

AddType application/x-httpd-php .php
--
John C. Nichel
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: PHP doesn't work under SSL for Apache

2004-05-28 Thread raditha dissanayake
Bryan Waters wrote:
I've asked this question in 4 different places and in each place i've not
received a single response...is that because its too hard or too esoteric?
I need to get this resolved and i'm stumped...
 

and earlier:
What am i missing?  If i didn't include enough information, my
apologies...it seemed overkill to include the entire conf file.
 

Not the entire conf file but if you told us what is the error message 
you get ...

--
Raditha Dissanayake.
-
http://www.raditha.com/megaupload/upload.php
Sneak past the PHP file upload limits.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] nl2br problem

2004-05-28 Thread Gerben
If have some problems with the nl2br function. It f*cks up my layout.
does anyone know how to create a true nl2br function in stead of a
nl2br-and-nl function.
i.e. I just want everything on one line.

I used:
str_replace(\n, , nl2br($text));
but I don't like it that much and I don't know if nl2br produces \r-s

Greetings,
Gerben
Holland

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



Re: [PHP] how to redirect with post method

2004-05-28 Thread Daniel Clark
I don't believe you can sent those post variables on the URL.

Either as GET variables on the URL.
Set Session variables and read on the next page.

Or setup a FORM with hidden post variables populated with the $post
variables, and JavaScript to auot submit onload.

 Hello,
 I have a webpage that I'm redirecting to other page with header command,
 for instance:
 header(location:information.php?cod1=$cod1cod2=$cod2...codn=$codn);

 I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do
 this? thanks.

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



[PHP] Re: how to redirect with post method

2004-05-28 Thread Justin Patrin
Ral castro wrote:
Hello,
I have a webpage that I'm redirecting to other page with header command, for instance: 
header(location:information.php?cod1=$cod1cod2=$cod2...codn=$codn);
I need send all vars (cod1, cod2, ..codn) on POST method, How Can I do this? thanks.
If you really need to redirect the user to another site and auto-post 
some data, you should set up the form in the redirect page with the 
values you want (use hidden fields) with the action set to the page you 
want to redirect to, then output javascript which submits the form.

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


[PHP] Re: nl2br problem

2004-05-28 Thread Justin Patrin
Gerben wrote:
If have some problems with the nl2br function. It f*cks up my layout.
does anyone know how to create a true nl2br function in stead of a
nl2br-and-nl function.
i.e. I just want everything on one line.
I used:
str_replace(\n, , nl2br($text));
but I don't like it that much and I don't know if nl2br produces \r-s
Greetings,
Gerben
Holland
I'm not quite sure how extra newlines could be screwing up your layout.
If you just want to remove all newlines from your text before 
outputting, you could use:

$text = str_replace(array(\r, \n), '', $text);
You could also do something like this:
$text = str_replace(array(\r\n, \r, \n), 'br/', $text);
--
paperCrane Justin Patrin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Changing environment variables ? (stupid question)

2004-05-28 Thread Harry Sufehmi
On 27/05/2004 at 12:55 Jason Barnett wrote:
Oooh, wish you'd said Windows, I coulda given you a walkthru there.  The
environment variable that you want to set cannot (AFAIK) be changed by
Apache.  You'll need to change the variable in Solaris itself.
So sayeth google:
http://docs.sun.com/db/doc/806-7612/6jgfmsvrt?a=view

Thanks Jason... looks like what I need really is a Solaris expert. Cheers for that, 
I'll try to look for one.



Thanks!
Harry

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



[PHP] Re: nl2br problem

2004-05-28 Thread Gerben
my indentation is screwed up when I use nl2br();




Justin Patrin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Gerben wrote:

  If have some problems with the nl2br function. It f*cks up my layout.
  does anyone know how to create a true nl2br function in stead of a
  nl2br-and-nl function.
  i.e. I just want everything on one line.
 
  I used:
  str_replace(\n, , nl2br($text));
  but I don't like it that much and I don't know if nl2br produces \r-s
 
  Greetings,
  Gerben
  Holland

 I'm not quite sure how extra newlines could be screwing up your
layout.

 If you just want to remove all newlines from your text before
 outputting, you could use:

 $text = str_replace(array(\r, \n), '', $text);

 You could also do something like this:

 $text = str_replace(array(\r\n, \r, \n), 'br/', $text);
 --
 paperCrane Justin Patrin

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



RE: [PHP] Re: nl2br problem

2004-05-28 Thread Vail, Warren
Sounds like you have tab characters and blanks controlling your indentation
and html will display only one blank between text characters, has nothing to
do with nl2br.  This does not happen when you use pre/pre tags, but then
the br doesn't work either.

Warren Vail
 


-Original Message-
From: Gerben [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 28, 2004 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: nl2br problem


my indentation is screwed up when I use nl2br();




Justin Patrin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Gerben wrote:

  If have some problems with the nl2br function. It f*cks up my 
  layout. does anyone know how to create a true nl2br function in 
  stead of a nl2br-and-nl function. i.e. I just want everything on one 
  line.
 
  I used:
  str_replace(\n, , nl2br($text));
  but I don't like it that much and I don't know if nl2br produces 
  \r-s
 
  Greetings,
  Gerben
  Holland

 I'm not quite sure how extra newlines could be screwing up your
layout.

 If you just want to remove all newlines from your text before 
 outputting, you could use:

 $text = str_replace(array(\r, \n), '', $text);

 You could also do something like this:

 $text = str_replace(array(\r\n, \r, \n), 'br/', $text);
 --
 paperCrane Justin Patrin

-- 
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] Newbie Question: Variables on the fly

2004-05-28 Thread Tim Winters
Steve!!!
This is great!
I had no idea you could use arrays in url variables.  That makes everything 
much easier.

Thanks very much
Tim
At 06:26 AM 28/05/2004, Steve Edberg wrote:
At 2:01 AM -0300 5/28/04, [EMAIL PROTECTED] wrote:
Thanks for the reply Denis,
Let me elaborate a bit.
I have a php page which I want to pass a series of variables via a url 
string.

eg
myPage.php?dataPoint1=10dataPoint2=20dataPoint3=30
The thing is I won;t know until runtime how many dataPoints there will be 
so I have also included 1 additional url variable

eg
myPage.php?totalDataPoints=3dataPoint1=10dataPoint2=20dataPoint3=30
From there I want to take those data points and do several things
with each of them.  The keep things simple lets say I want to multiply 
each by 3 and then divide it by 2 and put it into a new variable (under 
the same naming system).

eg
$xtemp=$HTTP_GET_VARS[totalDataPoints];
do {
A line here which will take each dataPoint and multiply by 3 and 
divide by 2 and assign it to a new variable with the same numbering 
system (eg $myNewVar1=$HTTP_GET_VARS[dataPoint1]*3/2;
$xtemp--;
} while ($xtemp0);

Make any more sense?
Thanks.

Strictly speaking, your original question referred to what PHP calls 
'variable variables':

http://us3.php.net/manual/en/language.variables.variable.php
However, most of what you can do with them can be done more simply with 
arrays. In your example above, use

myPage.php?dataPoint[]=10dataPoint[]=20dataPoint[]=30
and you get an array
$dataPoint[0]=10
$dataPoint[1]=20
$dataPoint[2]=30
The number of data points is count($dataPoint). See
http://us3.php.net/manual/en/language.variables.external.php
for more info on this technique.
steve edberg


At 01:24 AM 28/05/2004, Dennis Seavers [EMAIL PROTECTED] wrote:
Maybe others will catch on to your intention, but I think you need to
provide a bit more information.  For example, what variables do you want to
create (drawn from a file source, or create on the fly)?  Where will they
come from (a database, perhaps)?  You could create a script that creates
variables from scratch, following a (hopefully) finite mathematical
formula.  Or you could manipulate data that already exists, turning this
data into some kind of variables.
Ultimately, you'll have to give a better of sense of the end result you'd
like.
Dennis Seavers

 [Original Message]
 From: [EMAIL PROTECTED]
 To: PHP List [EMAIL PROTECTED]
 Date: 05/27/2004 9:17:11 PM
  Subject: [PHP] Newbie Question: Variables on the fly
 Hello,
 I'm sure this is a newbie question but I don't know the syntax.
 I want to create a series of variables within a php script at runtime
with
 a for loop.
 eg
 myVar1
 myVar2
 myVar3
 etc
 What is the proper syntax to do this?
 Thanks,
  Tim

--
+--- my people are the people of the dessert, ---+
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
+ said t e lawrence, picking up his fork +
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] nl2br problem

2004-05-28 Thread Chris Shiflett
--- Gerben [EMAIL PROTECTED] wrote:
 does anyone know how to create a true nl2br function in stead of a
 nl2br-and-nl function.

$foo = str_replace('\n', 'br /', $foo);

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] nl2br problem

2004-05-28 Thread Chris Shiflett
 --- Gerben [EMAIL PROTECTED] wrote:
  does anyone know how to create a true nl2br function in stead of a
  nl2br-and-nl function.
 
 $foo = str_replace('\n', 'br /', $foo);

Make that \n to interpret the newline correctly. Sorry about that.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] Playing RealAudio files on the fly!

2004-05-28 Thread hamidhossain
Hi,

I want to play realaudio files without showing their location in my site.
That means I have to use php header() function to change the MIME type of
the page to audio/x-pn-realaudio which looks to me the correct MIME to
paly real files.

Unfortunately, I did not success in playing those files. I need some help. I
will show down what I did:

[code]

$file = // name of the file
$path = // path to the name of the file

header(Content-Disposition: attachment; filename=$file);
header(Content-Length:  . filesize($path));
header(Content-Type: audio/x-pn-realaudio);
readfile($path);

[/code]

any help would be highly appreciated.

Regards,
Hamid

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



[PHP] datetime formatting problem

2004-05-28 Thread Matt Newell

hi all -

this is probably straight forward, but i'm learning and would appreciate
any insight.

i'm using the datetime type in mysql and have been able to successsfully
pull the data records's date, but it's failing out and giving me the
current time [as in what it says on my system's clock]

basically i'm just spitting out all the rows to an html table and would
like to have the date AND time formatted as is in the date(...) function
at the top of the code demo. 

thanks!
matt

/ begin code demo


function formatDate($val)
{
$arr = explode(-, $val);
return date(M d, Y g:i A, mktime(0,0,0, $arr[1], $arr[2], $arr[0]));
}


// open database connection
$connection = mysql_connect($host, $user, $pass) or die (Unable to
connect!);

// select database
mysql_select_db($db) or die (Unable to select database!);

// generate and execute query
$query = SELECT * FROM outdoor ORDER BY id ASC;
$result = mysql_query($query) or die (Error in query: $query.  .
mysql_error());


// if records present
if (mysql_num_rows($result)  0)
{
// iterate through resultset
// print title with links to edit and delete scripts
while($row = mysql_fetch_object($result))
{
?
tr
td? echo $row-id; ?/td
td? echo $row-name; ?/td
tda href=mailto:? echo $row-email; ?? echo
$row-email; ?/a/td
td? echo $row-zip ?/td
td? echo formatDate($row-date); ?/td
td? echo $row-club_member ?/td   
td? echo $row-driver ?/td
!-- tdfont size=-1? echo $row-active ?/font/td --

tdcentera href=edit.php?id=? echo $row-id; ?img
src=notepad.gif alt= width=16 height=16 border=0/a nbsp;
a href=delete.php?id=? echo $row-id; ?img src=trashcan.gif
alt= width=16 height=16 border=0/a/center/td
/tr
?
}
}

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



Re: [PHP] datetime formatting problem

2004-05-28 Thread Daniel Clark
Isn't date a reserved word?

 hi all -

 this is probably straight forward, but i'm learning and would appreciate
 any insight.

 i'm using the datetime type in mysql and have been able to successsfully
 pull the data records's date, but it's failing out and giving me the
 current time [as in what it says on my system's clock]

 basically i'm just spitting out all the rows to an html table and would
 like to have the date AND time formatted as is in the date(...) function
 at the top of the code demo.

 thanks!
 matt

 / begin code demo


 function formatDate($val)
 {
 $arr = explode(-, $val);
 return date(M d, Y g:i A, mktime(0,0,0, $arr[1], $arr[2], $arr[0]));
 }


 // open database connection
 $connection = mysql_connect($host, $user, $pass) or die (Unable to
 connect!);

 // select database
 mysql_select_db($db) or die (Unable to select database!);

 // generate and execute query
 $query = SELECT * FROM outdoor ORDER BY id ASC;
 $result = mysql_query($query) or die (Error in query: $query.  .
 mysql_error());


 // if records present
 if (mysql_num_rows($result)  0)
 {
   // iterate through resultset
   // print title with links to edit and delete scripts
   while($row = mysql_fetch_object($result))
   {
   ?
   tr
   td? echo $row-id; ?/td
   td? echo $row-name; ?/td
   tda href=mailto:? echo $row-email; ?? echo
 $row-email; ?/a/td
   td? echo $row-zip ?/td
   td? echo formatDate($row-date); ?/td
   td? echo $row-club_member ?/td
   td? echo $row-driver ?/td
   !-- tdfont size=-1? echo $row-active ?/font/td --

   tdcentera href=edit.php?id=? echo $row-id; ?img
 src=notepad.gif alt= width=16 height=16 border=0/a  
 a href=delete.php?id=? echo $row-id; ?img src=trashcan.gif
 alt= width=16 height=16 border=0/a/center/td
   /tr
   ?
   }
 }

 --
 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] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Chris Jernigan
Hi everyone,

Ok, I need serious help. I have been handed a project by my boss to convert
an existing site that was built using ColdFusion / SQL into a site that will
use PHP / mySQL. The site relies heavily on calls to the database for
everything from site content, to an admin area where you can edit that
content, to a news ticker, to the actual navigation of the site.

What's the problem? I have one week to do this. Oh, and did I mention that I
know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
MSSQL. And to top it off, the site in question contains over 300 .cfm files!

Does anyone have any idea how I could pull this off?

Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
one week isn't enough time to retool a site of this proportion. Especially
considering that I don't understand any of the code that I'm staring at.

I've been a web designer for about five years now. Notice I said designer
not developer. I want to learn PHP / mySQL but in order to complete this
project I also need to understand ColdFusion in order to replicate the site
functionality. Any advice on what I should do?

Thanks in advance for your help,
Chris

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



Re: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread John Nichel
Chris Jernigan wrote:
Hi everyone,
Ok, I need serious help. I have been handed a project by my boss to convert
an existing site that was built using ColdFusion / SQL into a site that will
use PHP / mySQL. The site relies heavily on calls to the database for
everything from site content, to an admin area where you can edit that
content, to a news ticker, to the actual navigation of the site.
What's the problem? I have one week to do this. Oh, and did I mention that I
know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
MSSQL. And to top it off, the site in question contains over 300 .cfm files!
Does anyone have any idea how I could pull this off?
Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
one week isn't enough time to retool a site of this proportion. Especially
considering that I don't understand any of the code that I'm staring at.
I've been a web designer for about five years now. Notice I said designer
not developer. I want to learn PHP / mySQL but in order to complete this
project I also need to understand ColdFusion in order to replicate the site
functionality. Any advice on what I should do?
Thanks in advance for your help,
Chris
Tell your boss it's an unrealistic goal.  Even for a seasoned PHP 
programmer with a firm grasp on MySQL, something of this scope is 
unrealistic for a single person.  Scoping out the db schema alone could 
take a week or more (depending on the size of your db).  That doesn't 
even take into account migrating your data from MSSQL to MySQL once your 
MySQL db is set up, or writing all the php code from scratch (PEAR 
libraries would help speed up the process, but now you bring in the OOP 
learning curve).

--
John C. Nichel
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] PHP5 CGI with Apache2

2004-05-28 Thread Gerard Samuel
I installed php5 RC2 on winXP with Apache 2 on my dev box.
I started with the sapi module and it worked great there.
I edited apache's httpd.conf file to try out php as a CGI, 
(as mentioned in the install file), and I keep getting server 500 errors
--
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to 
complete your request.
.
--

I tried pulling down the latest from snaps, and got the same error.

Anyone experienced this with RC2?
Any fixes/workarounds?

Thanks for your input...

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



RE: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Jay Blanchard
[snip]
Tell your boss it's an unrealistic goal.  Even for a seasoned PHP 
programmer with a firm grasp on MySQL, something of this scope is 
unrealistic for a single person.  Scoping out the db schema alone could 
take a week or more (depending on the size of your db).  That doesn't 
even take into account migrating your data from MSSQL to MySQL once your

MySQL db is set up, or writing all the php code from scratch (PEAR 
libraries would help speed up the process, but now you bring in the OOP 
learning curve).
[/snip]

I agree...the situation you describe is a recipe for disaster.

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



Re: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Daniel Clark
I've used Cold Fusion for years.  However one week at 100 hours might not
be enough time to covert everything to PHP and mySQL.


 Hi everyone,

 Ok, I need serious help. I have been handed a project by my boss to
 convert
 an existing site that was built using ColdFusion / SQL into a site that
 will
 use PHP / mySQL. The site relies heavily on calls to the database for
 everything from site content, to an admin area where you can edit that
 content, to a news ticker, to the actual navigation of the site.

 What's the problem? I have one week to do this. Oh, and did I mention that
 I
 know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
 MSSQL. And to top it off, the site in question contains over 300 .cfm
 files!

 Does anyone have any idea how I could pull this off?

 Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
 one week isn't enough time to retool a site of this proportion. Especially
 considering that I don't understand any of the code that I'm staring at.

 I've been a web designer for about five years now. Notice I said
 designer
 not developer. I want to learn PHP / mySQL but in order to complete this
 project I also need to understand ColdFusion in order to replicate the
 site
 functionality. Any advice on what I should do?

 Thanks in advance for your help,
 Chris

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



Re: [PHP] datetime formatting problem

2004-05-28 Thread Torsten Roehr
Daniel Clark [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Isn't date a reserved word?

date and dateTime are not reserved in MySQL and can be used as column names.


  hi all -
 
  this is probably straight forward, but i'm learning and would appreciate
  any insight.
 
  i'm using the datetime type in mysql and have been able to successsfully
  pull the data records's date, but it's failing out and giving me the
  current time [as in what it says on my system's clock]
 
  basically i'm just spitting out all the rows to an html table and would
  like to have the date AND time formatted as is in the date(...) function
  at the top of the code demo.
 
  thanks!
  matt
 
  / begin code demo
 
 
  function formatDate($val)
  {
  $arr = explode(-, $val);
  return date(M d, Y g:i A, mktime(0,0,0, $arr[1], $arr[2], $arr[0]));
  }

Hi Matt,

try this:

function formatDate($val) {
$timestamp = strtotime($val);
return date('M d, Y g:i A', $timestamp);
}

Regards, Torsten Roehr

 
 
  // open database connection
  $connection = mysql_connect($host, $user, $pass) or die (Unable to
  connect!);
 
  // select database
  mysql_select_db($db) or die (Unable to select database!);
 
  // generate and execute query
  $query = SELECT * FROM outdoor ORDER BY id ASC;
  $result = mysql_query($query) or die (Error in query: $query.  .
  mysql_error());
 
 
  // if records present
  if (mysql_num_rows($result)  0)
  {
  // iterate through resultset
  // print title with links to edit and delete scripts
  while($row = mysql_fetch_object($result))
  {
  ?
  tr
  td? echo $row-id; ?/td
  td? echo $row-name; ?/td
  tda href=mailto:? echo $row-email; ?? echo
  $row-email; ?/a/td
  td? echo $row-zip ?/td
  td? echo formatDate($row-date); ?/td
  td? echo $row-club_member ?/td
  td? echo $row-driver ?/td
  !-- tdfont size=-1? echo $row-active ?/font/td --
 
   tdcentera href=edit.php?id=? echo $row-id; ?img
  src=notepad.gif alt= width=16 height=16 border=0/a
  a href=delete.php?id=? echo $row-id; ?img src=trashcan.gif
  alt= width=16 height=16 border=0/a/center/td
  /tr
  ?
  }
  }
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



[PHP] Re: ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Ammar Ibrahim
Tell your boss to get a life :)
I'm working on converting a large web application from ColdFusion/MsSQL 
to PHP/MySQL. This web app is almost around 3 million lines of code :| I 
was wondering if there exists a tool similiar to ASP2PHP to convert 
ColdFusion code to PHP. But anyway, the way ColdFusion is used to write 
web sites makes writing this application extermely hard.

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


Re: [PHP] datetime formatting problem

2004-05-28 Thread Jordan S. Jones
[snip /]
Hi Matt,
try this:
function formatDate($val) {
   $timestamp = strtotime($val);
   return date('M d, Y g:i A', $timestamp);
}
 

strtotime possibly will not work if your date is  01/01/1970.
[snip /]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] datetime formatting problem

2004-05-28 Thread Matt Newell

thanks a bunch torsten. it worked like a charm and i'm off to read up
some more on strtotime.

best,
m.

-Original Message-
From: Torsten Roehr [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 28, 2004 2:07 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] datetime formatting problem

Daniel Clark [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Isn't date a reserved word?

date and dateTime are not reserved in MySQL and can be used as column
names.


  hi all -
 
  this is probably straight forward, but i'm learning and would 
  appreciate any insight.
 
  i'm using the datetime type in mysql and have been able to 
  successsfully pull the data records's date, but it's failing out and

  giving me the current time [as in what it says on my system's clock]
 
  basically i'm just spitting out all the rows to an html table and 
  would like to have the date AND time formatted as is in the 
  date(...) function at the top of the code demo.
 
  thanks!
  matt
 
  / begin code demo
 
 
  function formatDate($val)
  {
  $arr = explode(-, $val);
  return date(M d, Y g:i A, mktime(0,0,0, $arr[1], $arr[2], 
  $arr[0])); }

Hi Matt,

try this:

function formatDate($val) {
$timestamp = strtotime($val);
return date('M d, Y g:i A', $timestamp); }

Regards, Torsten Roehr

 
 
  // open database connection
  $connection = mysql_connect($host, $user, $pass) or die (Unable to 
  connect!);
 
  // select database
  mysql_select_db($db) or die (Unable to select database!);
 
  // generate and execute query
  $query = SELECT * FROM outdoor ORDER BY id ASC; $result = 
  mysql_query($query) or die (Error in query: $query.  .
  mysql_error());
 
 
  // if records present
  if (mysql_num_rows($result)  0)
  {
  // iterate through resultset
  // print title with links to edit and delete scripts while($row = 
  mysql_fetch_object($result)) { ? tr td? echo $row-id; ?/td

  td? echo $row-name; ?/td tda href=mailto:? echo 
  $row-email; ?? echo $row-email; ?/a/td td? echo 
  $row-zip ?/td td? echo formatDate($row-date); ?/td td?

  echo $row-club_member ?/td td? echo $row-driver ?/td
  !-- tdfont size=-1? echo $row-active ?/font/td --
 
   tdcentera href=edit.php?id=? echo $row-id; ?img 
  src=notepad.gif alt= width=16 height=16 border=0/a a 
  href=delete.php?id=? echo $row-id; ?img src=trashcan.gif
  alt= width=16 height=16 border=0/a/center/td /tr ?
  }
  }
 
  --
  PHP General Mailing List (http://www.php.net/) To unsubscribe, 
  visit: http://www.php.net/unsub.php
 
 

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

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



RE: [PHP] datetime formatting problem

2004-05-28 Thread Matt Newell

appreciate the headsup, but all times will be from when record is
inserted which will not be possible before today.

thanks,
m. 

-Original Message-
From: Jordan S. Jones [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 28, 2004 2:20 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] datetime formatting problem


[snip /]

Hi Matt,

try this:

function formatDate($val) {
$timestamp = strtotime($val);
return date('M d, Y g:i A', $timestamp); }
  

strtotime possibly will not work if your date is  01/01/1970.

[snip /]

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

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



[PHP] Re: ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Stephen Lake
Yeah tell your boss to get stuffed and that your not old enough yet to have
a stroke ;)

There is absolutely no way no one knowlegable and experienced in both
languages can do it in a week no less a non programmer either

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



Re: [PHP] datetime formatting problem

2004-05-28 Thread Stephen Lake
Try strftime
it allows you to take a timestamp created by time() and format it as
required.
heres the man page for it:
http://www.php.net/manual/en/function.strftime.php

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

thanks a bunch torsten. it worked like a charm and i'm off to read up
some more on strtotime.

best,
m.

-Original Message-
From: Torsten Roehr [mailto:[EMAIL PROTECTED]
Sent: Friday, May 28, 2004 2:07 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] datetime formatting problem

Daniel Clark [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Isn't date a reserved word?

date and dateTime are not reserved in MySQL and can be used as column
names.


  hi all -
 
  this is probably straight forward, but i'm learning and would
  appreciate any insight.
 
  i'm using the datetime type in mysql and have been able to
  successsfully pull the data records's date, but it's failing out and

  giving me the current time [as in what it says on my system's clock]
 
  basically i'm just spitting out all the rows to an html table and
  would like to have the date AND time formatted as is in the
  date(...) function at the top of the code demo.
 
  thanks!
  matt
 
  / begin code demo
 
 
  function formatDate($val)
  {
  $arr = explode(-, $val);
  return date(M d, Y g:i A, mktime(0,0,0, $arr[1], $arr[2],
  $arr[0])); }

Hi Matt,

try this:

function formatDate($val) {
$timestamp = strtotime($val);
return date('M d, Y g:i A', $timestamp); }

Regards, Torsten Roehr

 
 
  // open database connection
  $connection = mysql_connect($host, $user, $pass) or die (Unable to
  connect!);
 
  // select database
  mysql_select_db($db) or die (Unable to select database!);
 
  // generate and execute query
  $query = SELECT * FROM outdoor ORDER BY id ASC; $result =
  mysql_query($query) or die (Error in query: $query.  .
  mysql_error());
 
 
  // if records present
  if (mysql_num_rows($result)  0)
  {
  // iterate through resultset
  // print title with links to edit and delete scripts while($row =
  mysql_fetch_object($result)) { ? tr td? echo $row-id; ?/td

  td? echo $row-name; ?/td tda href=mailto:? echo
  $row-email; ?? echo $row-email; ?/a/td td? echo
  $row-zip ?/td td? echo formatDate($row-date); ?/td td?

  echo $row-club_member ?/td td? echo $row-driver ?/td
  !-- tdfont size=-1? echo $row-active ?/font/td --
 
   tdcentera href=edit.php?id=? echo $row-id; ?img
  src=notepad.gif alt= width=16 height=16 border=0/a a
  href=delete.php?id=? echo $row-id; ?img src=trashcan.gif
  alt= width=16 height=16 border=0/a/center/td /tr ?
  }
  }
 
  --
  PHP General Mailing List (http://www.php.net/) To unsubscribe,
  visit: http://www.php.net/unsub.php
 
 

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

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



Re: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Travis Low
Here's what you do.   Assume 10-hour work days.  Obviously, you want to start 
with the schema.  That's pretty darn important, so allow yourself a whole day 
for that.

You have four days left.  Oh wait -- you will probably have to work the weekend 
for this one.  So you have six days left.  That's 60 hours, or 3600 minutes. 
You have 300 files, so you can't spend more than 12 minutes per file.  Wait, 
you said OVER 300, so try to keep it to 10 minutes per file.  To play it safe, 
spend no more than 8 minutes per file -- that way, you have a little extra time 
in case something unexpected comes up.

It might be easier to buy a CFM-to-PHP converter.  You can get those at most 
Kmart stores.  They're usually next to the bacon stretchers and smoke-shifters.

Hope this helps!
cheers,
Travis
Chris Jernigan wrote:
Hi everyone,
Ok, I need serious help. I have been handed a project by my boss to convert
an existing site that was built using ColdFusion / SQL into a site that will
use PHP / mySQL. The site relies heavily on calls to the database for
everything from site content, to an admin area where you can edit that
content, to a news ticker, to the actual navigation of the site.
What's the problem? I have one week to do this. Oh, and did I mention that I
know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
MSSQL. And to top it off, the site in question contains over 300 .cfm files!
Does anyone have any idea how I could pull this off?
Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
one week isn't enough time to retool a site of this proportion. Especially
considering that I don't understand any of the code that I'm staring at.
I've been a web designer for about five years now. Notice I said designer
not developer. I want to learn PHP / mySQL but in order to complete this
project I also need to understand ColdFusion in order to replicate the site
functionality. Any advice on what I should do?
Thanks in advance for your help,
Chris
--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Curt Zirzow
* Thus wrote Chris Jernigan ([EMAIL PROTECTED]):
 Hi everyone,
 
 What's the problem? I have one week to do this. Oh, and did I mention that I
 know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
 MSSQL. And to top it off, the site in question contains over 300 .cfm files!
 
 Does anyone have any idea how I could pull this off?

rename all files to .php and set the web server to parse .php files
as coldfusion.


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

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



Re: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Tim Traver
Oh my god...I'm crying...
what the heck is a bacon stretcher ?
t
At 03:52 PM 5/28/2004, Travis Low wrote:
Here's what you do.   Assume 10-hour work days.  Obviously, you want to 
start with the schema.  That's pretty darn important, so allow yourself a 
whole day for that.

You have four days left.  Oh wait -- you will probably have to work the 
weekend for this one.  So you have six days left.  That's 60 hours, or 
3600 minutes. You have 300 files, so you can't spend more than 12 minutes 
per file.  Wait, you said OVER 300, so try to keep it to 10 minutes per 
file.  To play it safe, spend no more than 8 minutes per file -- that way, 
you have a little extra time in case something unexpected comes up.

It might be easier to buy a CFM-to-PHP converter.  You can get those at 
most Kmart stores.  They're usually next to the bacon stretchers and 
smoke-shifters.

Hope this helps!
cheers,
Travis
Chris Jernigan wrote:
Hi everyone,
Ok, I need serious help. I have been handed a project by my boss to convert
an existing site that was built using ColdFusion / SQL into a site that will
use PHP / mySQL. The site relies heavily on calls to the database for
everything from site content, to an admin area where you can edit that
content, to a news ticker, to the actual navigation of the site.
What's the problem? I have one week to do this. Oh, and did I mention that I
know VERY little about PHP / mySQL. I know NOTHING about ColdFusion or
MSSQL. And to top it off, the site in question contains over 300 .cfm files!
Does anyone have any idea how I could pull this off?
Even if I had a working knowledge of ColdFusion, MSSQL, PHP, mySQL...still
one week isn't enough time to retool a site of this proportion. Especially
considering that I don't understand any of the code that I'm staring at.
I've been a web designer for about five years now. Notice I said designer
not developer. I want to learn PHP / mySQL but in order to complete this
project I also need to understand ColdFusion in order to replicate the site
functionality. Any advice on what I should do?
Thanks in advance for your help,
Chris
--
Travis Low
mailto:[EMAIL PROTECTED]
http://www.dawnstar.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] ColdFusion / SQL PHP / mySQL HELP!

2004-05-28 Thread Daniel Clark
That's funny Travis !

Here's what you do.   Assume 10-hour work days.  Obviously, you want to start 
with the schema.  That's pretty darn important, so allow yourself a whole day 
for that.

You have four days left.  Oh wait -- you will probably have to work the weekend 
for this one.  So you have six days left.  That's 60 hours, or 3600 minutes. 
You have 300 files, so you can't spend more than 12 minutes per file.  Wait, 
you said OVER 300, so try to keep it to 10 minutes per file.  To play it safe, 
spend no more than 8 minutes per file -- that way, you have a little extra time 
in case something unexpected comes up.

It might be easier to buy a CFM-to-PHP converter.  You can get those at most 
Kmart stores.  They're usually next to the bacon stretchers and smoke-shifters.

Hope this helps!

cheers,

Travis

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