[PHP] Recommended book on PHP/SOAP

2008-05-05 Thread Todd Cary
I would like a book on implementing SOAP geared for someone with 
no SOAP experience.  Hopefully SOAP can be used with PHP 4?!?


Many thanks...

Todd

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



Re: [PHP] Recommended book on PHP/SOAP

2008-05-05 Thread Todd Cary

Dan Joseph wrote:

On Mon, May 5, 2008 at 12:29 PM, Todd Cary [EMAIL PROTECTED] wrote:


I would like a book on implementing SOAP geared for someone with no SOAP
experience.  Hopefully SOAP can be used with PHP 4?!?

Many thanks...




I'm not sure of a book, but for PHP4 you'll want to grab NuSOAP.  Its
actually a pretty nice SOAP library.  You can ifnd it on google.  I was able
to work with it by searching for examples just fine.  You may not even need
a book.


Thank you Dan.

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



[PHP] How to create accessible by PHP

2008-05-03 Thread Todd Cary
Are there any examples of creating a dll that can be placed in 
the dll directory of php that can be accessed by php?  My 
language would be Delphi, however an example in C would suffice.


Many thanks...

Todd

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



[PHP] Re: How to create accessible by PHP

2008-05-03 Thread Todd Cary

Todd Cary wrote:
Are there any examples of creating a dll that can be placed in the dll 
directory of php that can be accessed by php?  My language would be 
Delphi, however an example in C would suffice.


Many thanks...

Todd

Sorry about my typo in the Subject!

Todd

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



[PHP] Interacting with an IpServer via sockets

2008-05-02 Thread Todd Cary
I have an IpServer using Turbopowers IpServer library) and am 
able to connect and send data (fwrite() ), however, I cannot 
receive data from the server.  The PutString() in the IpServer 
executes without error, however the fgets() just hangs.


Any ideas on what I may be doing incorrectly?

  $fp = fsockopen(192.168.0.21, 5389);
  if ($fp) {
echo Socket has been opened:  . $fp .   . date(m/d/y 
h:n:s, time()) . br;

fwrite($fp, Please send me a report!);
//echo fgets($fp) . br;
fclose($fp);
  } else {
echo Socket cannot open socketbr;
  }


Many thanks.
Todd

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



[PHP] Processing a table of input fields

2007-05-11 Thread Todd Cary
I create a table of input fields so the user (secretary at a 
Rotary meeting) can check mark if the person attended and how 
much they paid for lunch.  Each input field name has the user ID 
as part of it.  What is the best way to process the table when 
the submit button is pressed?  There are about 50 rows in the table.


Sample of one row for member 590:

tr
tdinput type=checkbox name=590_attend value=1
/td
td05/11/2007/tdtdTheressa/tdtdBryant/tdtdinput 
type=text name=590_pay value=16 size=5 maxlength=4/td
tdinput type=text name=590_charge value=16 size=5 
maxlength=4/td
tdinput type=text name=590_note size=26 
maxlength=25/td

/tr

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



Re: [PHP] Processing a table of input fields

2007-05-11 Thread Todd Cary

Jim Lucas wrote:

Richard Davey wrote:

Todd Cary wrote:

I create a table of input fields so the user (secretary at a Rotary 
meeting) can check mark if the person attended and how much they paid 
for lunch.  Each input field name has the user ID as part of it.  
What is the best way to process the table when the submit button is 
pressed?  There are about 50 rows in the table.


Sample of one row for member 590:

tr
tdinput type=checkbox name=590_attend value=1
/td
td05/11/2007/tdtdTheressa/tdtdBryant/tdtdinput 
type=text name=590_pay value=16 size=5 maxlength=4/td
tdinput type=text name=590_charge value=16 size=5 
maxlength=4/td

tdinput type=text name=590_note size=26 maxlength=25/td
/tr


Personally I'd do it like this (if you are displaying say 50 
checkboxes on the page at once)


Name each checkbox so the they go into an array, i.e.:

input type=checkbox name=attend[] value=590
input type=checkbox name=attend[] value=591
input type=checkbox name=attend[] value=592

Then in your PHP script you can simply loop through the attend array 
($_POST['attend']) and extract all the IDs of those people who were 
ticked. If they weren't ticked, they won't be in your array.


Cheers,

Rich

I would do it even a different way

tr
tdinput type=checkbox name=list[590][attend] value=1/td
td05/11/2007/td
tdTheressa/td
tdBryant/td
tdinput type=text name=list[590][pay] value=16 size=5 
maxlength=4/td
tdinput type=text name=list[590][charge] value=16 size=5 
maxlength=4/td
tdinput type=text name=list[590][note] size=26 
maxlength=25/td

/tr


Then on the PHP side this.

if ( isset($_POST['list'])  count($_POST['list'])  0 ) {
foreach ( $_POST['list'] AS $id = $data ) {
if ( isset($data['attend'])  $data['attend'] == '1' ) {
# do stuff related to them attending the meal
}
}
}


This way, everything the grouped in one big array.  You don't have to 
worry about checking for values in each array, it is all right there.  
Keeping things in sync is much easier this way.


Hope this helps



WOW!  Now it is quite refined!  Thank you for contributions.

Todd

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



Re: [PHP] Processing a table of input fields

2007-05-11 Thread Todd Cary

Jim Lucas wrote:

Richard Davey wrote:

Todd Cary wrote:

I create a table of input fields so the user (secretary at a Rotary 
meeting) can check mark if the person attended and how much they paid 
for lunch.  Each input field name has the user ID as part of it.  
What is the best way to process the table when the submit button is 
pressed?  There are about 50 rows in the table.


Sample of one row for member 590:

tr
tdinput type=checkbox name=590_attend value=1
/td
td05/11/2007/tdtdTheressa/tdtdBryant/tdtdinput 
type=text name=590_pay value=16 size=5 maxlength=4/td
tdinput type=text name=590_charge value=16 size=5 
maxlength=4/td

tdinput type=text name=590_note size=26 maxlength=25/td
/tr


Personally I'd do it like this (if you are displaying say 50 
checkboxes on the page at once)


Name each checkbox so the they go into an array, i.e.:

input type=checkbox name=attend[] value=590
input type=checkbox name=attend[] value=591
input type=checkbox name=attend[] value=592

Then in your PHP script you can simply loop through the attend array 
($_POST['attend']) and extract all the IDs of those people who were 
ticked. If they weren't ticked, they won't be in your array.


Cheers,

Rich

I would do it even a different way

tr
tdinput type=checkbox name=list[590][attend] value=1/td
td05/11/2007/td
tdTheressa/td
tdBryant/td
tdinput type=text name=list[590][pay] value=16 size=5 
maxlength=4/td
tdinput type=text name=list[590][charge] value=16 size=5 
maxlength=4/td
tdinput type=text name=list[590][note] size=26 
maxlength=25/td

/tr


Then on the PHP side this.

if ( isset($_POST['list'])  count($_POST['list'])  0 ) {
foreach ( $_POST['list'] AS $id = $data ) {
if ( isset($data['attend'])  $data['attend'] == '1' ) {
# do stuff related to them attending the meal
}
}
}


This way, everything the grouped in one big array.  You don't have to 
worry about checking for values in each array, it is all right there.  
Keeping things in sync is much easier this way.


Hope this helps



Thanks again!  Have it working for the initial entry and the 
recreation of the table for editing based on the array.


Todd

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



[PHP] Passing an array as a hidden variable

2007-05-11 Thread Todd Cary
When I use the following syntax, the 2 dimensional array loses 
it's contents.  Can an array be passed this way?


  ? echo 'input type=hidden name=attend_ary_save value=' . 
$attend_ary_save .''; ?


Todd

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



[PHP] Removing commas from number

2007-05-06 Thread Todd Cary
Thanks to the suggestions, I use number_format($my_number, 2) to format the 
number in an edit field.  Now I need to reenter it into MySQL.  How should I use 
preg_replace to remove the commas?


This removes the commas *and* the decimal point:

preg_replace('/\D/', '', $str)

In reviewing patterns, I cannot find the purpose of the / character in the 
above.

Many thanks

Todd

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



Re: [PHP] Removing commas from number

2007-05-06 Thread Todd Cary

Paul -

You make a good point.  What is your suggestion for the following sequence:

$number = $row-AMOUNT; // Get the double from MySQL

To display the number in the HTML edit field, I do

$display_number = number_format($number, 2, '.', '');

The user may enter a character that will not be accepted by MySQL, so I do

$mysql_number = preg_replace('/[^0-9^\.]/', '', $display_number);

Thank you for your suggestions

Todd

Paul Novitski wrote:

At 5/6/2007 08:33 AM, Todd Cary wrote:
Thanks to the suggestions, I use number_format($my_number, 2) to 
format the number in an edit field.  Now I need to reenter it into 
MySQL.  How should I use preg_replace to remove the commas?


This removes the commas *and* the decimal point:

preg_replace('/\D/', '', $str)



This strikes me as such an odd thing to do.  If the MySQL table field is 
defined as float, I don't see the need to remove the decimal point.


If you do need to store the digits without the punctuation, you could 
also multiply by 100 and store it as an integer: intval($my_number * 
100) which seems more efficient than to format as a string and then 
reformat without the punctuation.


If I have two uses for a number -- say, formatted with commas and other 
dressing for display and formatted more severely for SQL -- I'd retain 
the number in a variable as its pure value and convert it for each use, 
rather than converting it for one use and then converting that for the 
next use.  The software's more robust because a glitch in a formatting 
operation isn't going to affect the final result.  Also, in many 
arithmetic circumstances where division is involved, the true value of 
the results are accurate to more than two decimal places.  While these 
might be rounded to the nearest cent for display purposes, you'll want 
to add the true values to get the true total.  One common example is a 
column of percentages that should add to 100%.


Regards,

Paul
__

Paul Novitski
Juniper Webcraft Ltd.
http://juniperwebcraft.com


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



[PHP] Best way to format double as money?

2007-05-05 Thread Todd Cary
I have a MySQL DB that stores currency values as doubles.  I want to 
display the values in the #,##0.00 format.  What is the best way to do that?


Todd

--
Ariste Software
2200 D Street Ext
Petaluma, CA 94952
(707) 773-4523

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



[PHP] Sending the results of a query without using a file

2007-05-02 Thread Todd Cary
Some shared servers do not allow the creation of a file, so I am 
looking for a way to take the results of a query (MySQL), create 
a CSV output and have it in a sendable format for the user 
without creating a file.


Many thanks

Todd

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Todd Cary
Many thanks!  I must be losing my eyesight!  There it is and it works as 
expected...great.


Todd

Richard Lynch wrote:

On Thu, April 26, 2007 3:39 pm, Todd Cary wrote:
  

Is there a function that can parse a comma delimited file into an
array?



fgetcsv should work...



  


--
Ariste Software
2200 D Street Ext
Petaluma, CA 94952
(707) 773-4523



[PHP] Parsing CSV files

2007-04-26 Thread Todd Cary
Is there a function that can parse a comma delimited file into an 
array?


Todd

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



[PHP] Capitalizing the first letter

2007-03-13 Thread Todd Cary
I would like to write a filter that takes the text smith or 
SMith and returns Smith; same for ralph smith.  Is the a 
good source on using filters this way?


Thank you...

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



Re: [PHP] Capitalizing the first letter

2007-03-13 Thread Todd Cary

Chris Boget wrote:
I would like to write a filter that 
takes the text smith or SMith and 
returns Smith; same for ralph smith.  
Is the a good source on using filters 
this way?


It may not be the most efficient way of accomplishing this, but you
could do something like:

$string = 'SMith'
$fixedString = ucwords( strtolower( $string ));

thnx,
Chris


Thank you!  I did not know about the ucwords() functions, and it 
does not need the string set to lower case.


Now to create a filter that returns only numbers (e.g. a1234z 
- 1234) and the same for non-numbers.


Many thanks...

Todd

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



Re: [PHP] Capitalizing the first letter

2007-03-13 Thread Todd Cary

Steve wrote:
For your filter to return only/no digits, I would recommend doing a bit of 
reading on preg_replace ( http://us2.php.net/preg_replace ) while noting the 
following flags:


\d
Matches any decimal digit; this is equivalent to the class [0-9].

\D
Matches any non-digit character; this is equivalent to the class [^0-9].

ex:
preg_replace('/\d/', '', $str);
preg_replace('/\D/', '', $str);



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

Chris Boget wrote:
I would like to write a filter that takes the text smith or SMith 
and returns Smith; same for ralph smith.  Is the a good source on 
using filters this way?

It may not be the most efficient way of accomplishing this, but you
could do something like:

$string = 'SMith'
$fixedString = ucwords( strtolower( $string ));

thnx,
Chris
Thank you!  I did not know about the ucwords() functions, and it does not 
need the string set to lower case.


Now to create a filter that returns only numbers (e.g. a1234z - 1234) 
and the same for non-numbers.


Many thanks...

Todd 


Thank you for the \d and \D suggestions!  Another addition to my 
tool chest.


Todd

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



[PHP] Using a reentrant form

2007-03-13 Thread Todd Cary
To validate a page, I set the form value to the page name the 
user is on.  Then there is a hidden variable, looped that is 
set to 1.  By checking looped, I know if the user has 
re-entered the form so I can do my validation checks.


Is there a disadvantage to this approach?

Thank you...

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



[PHP] Have a SQL Server COM question

2006-08-08 Thread Todd Cary
I am in the process of converting my clients PHP scripts that are 
using Interbase so they will work with SQL Server (their request; 
not mine).


Is there a reference where I can get the COM Methods and Properties?

Also, without loading the large AdoDb, is there a Prepare() 
method if I use the


$db = new COM(ADODB.Connection)

connection?

Any suggestions are greatly appreciated.

Todd

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



[PHP] Using Header() to pass information...

2006-04-22 Thread Todd Cary

If I use

  if ($send)
header(location: mypage.php?message= . $message);

the data ($message) is passed in the URL.  Is there a way to pass 
the data as though it was a POST method i.e. not in the URL?


Todd

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



Re: [PHP] Using Header() to pass information...

2006-04-22 Thread Todd Cary

M. Sokolewicz wrote:

Jochem Maas wrote:


Todd Cary wrote:


If I use

  if ($send)
header(location: mypage.php?message= . $message);

the data ($message) is passed in the URL.  Is there a way to pass the 
data as though it was a POST method i.e. not in the URL?



probably, but I don't know how off the top of my head.

look into using $_SESSION instead and maybe even consider that you
could save yourself a redirect by doing something _like_:

if ($send) {
$_POST['message'] = $message;
include './mypage.php';
exit;
}

now sticking stuff into $_POST or $_GET probably isn't the best tactic -
if a security guru could comment on that I'd appreciate it also!



Todd



Actually, contrary (apparently) to what most people think on this list, 
it is *not* possible (well, not in a standards-compliant way). Basically 
what you do with a location header is stating that the URL provided is 
in a different location (using a 3xx status code). This in turn means 
(for most browsers) that they will make a new connection to the URI 
provided. You can redirect both POST and GET requests (and a hundred 
more), which should work fine in common browsers. A POST request getting 
a `303 See Other` status should be resent (with a nice are you sure you 
wish to resubmit this data prompt to the user; unfortunately, few 
browsers do this, though most common browsers (currently) do properly 
resend the data as part of a POST request to the URL provided.


Well, it's all very interesting up till now; the problem you're facing 
is that you do not with to *redirect*, you wish to *force the browser to 
initiate a specific type of request to a specific URI*, you use the 30x 
status codes to do this (which is actually incorrect usage, but let's 
just forget about / ignore that for now). That means the following:

1. a new URI is sent to the browser via the Location header
2. the browser makes a new connection to the specified URI with the 
original type (ie. POST, GET, PUT, etc. (not HEAD))
3. the browser re-sends any additional data it was supposed to send 
(generally only in POST and PUT requests)
Since there is no way for the server to inject data into that new 
request (except for the URI, which is why get redirects work), you 
can't inject a new POST request to a browser. Either you redirect the 
existing request (via a 30x status response), or you need to have the 
user re-submit a form (with potential new info provided by the script) 
to the new URI.


The RFC2616 HTTP/1.1 [1] document covers this in reasonable detail.
Also, google searches for POST redirect request will bring up a few 
articles detailing why this does not (and should not) work.


hope this help,
- tul

[1] http://www.w3.org/Protocols/rfc2616/rfc2616.html


What I have done in the past is to open a new socket and pass the 
 data that way.  Never had a problem, but I thought there might 
be an easier way.  Your detailed explanation tells why there is not.


Many thanks

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



[PHP] ibase_errcode() not defined

2006-04-22 Thread Todd Cary
If I use ibase_errcode(), I get an undefined error; 
ibase_errmsg() works.  Anyone else have this error with Firebird?


Todd

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



[PHP] Can output_buffering be set in a script?

2006-03-30 Thread Todd Cary
I do not have access to the php.ini file and I need to have 
output_buffering turned on.  Can this be done within a script?


Thank you

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



[PHP] Formatting a Time field

2006-03-23 Thread Todd Cary
I have a field, Start_Time, in a MySQL DB.  Since it is not a 
TimeStamp, I believe I cannot use date(), correct?


I would like to format 09:00:00 to 9:00 AM.

If I convert the 09:00:00 with the strtotime(), I get a couple of 
extra minutes added.


Suggestions are welcomed

Todd

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



[PHP] Creating a Window without JavaScript that is on top

2006-03-22 Thread Todd Cary
Is there a way to create a Window that is like the Help or Popup 
type windows one can create with JavaScript?


I have an event calendar and I want the link for the event to go 
to a PHP page, but I want the page to be on top and have focus 
with a Close button.  The PHP page will have some PHP code that 
will display the data passed by the GET var.


Todd

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



Re: [PHP] Creating a Window without JavaScript that is on top

2006-03-22 Thread Todd Cary

Thank you!  Very helpful indeed!

Todd

Jay Blanchard wrote:

[snip]
Is there a way to create a Window that is like the Help or Popup 
type windows one can create with JavaScript?


I have an event calendar and I want the link for the event to go 
to a PHP page, but I want the page to be on top and have focus 
with a Close button.  The PHP page will have some PHP code that 
will display the data passed by the GET var.

[/snip]

You do know that JavaScript can open a PHP page right? Here is an
example

/* 
* description:	pop up a window with a specific file 
* call:		a href=javascript:popUp('name of file to open like

foo.php')link name/a
*/
function popUp(url){
pop = window.open(url,'window
name','width=300,height=200,toolbar=no,location=no,menubar=no,scrollbars
=no,resizable=no');
pop.moveTo(50,50);
}

Whatever foo.php is will be displayed in the pop-up window. There are
several ways to pass variables back and forth using JavaScriptbut
this is not the list for that :)


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



Re: [PHP] Creating a Window without JavaScript that is on top

2006-03-22 Thread Todd Cary

Gosh darn!  That really works!!  Many thanks!

Though I may be still playing around with the PHP code, a demo 
might be seen at


http://209.204.172.137/calendar/php/showmonth.php

Todd


Brady Mitchell wrote:
Personally, I think that posting a way to allow php to communicate 
with javascript OR any other language is relevant for a php-general 
list, don't you think?


To use the value of a PHP variable in javascript, you create a
javascript variable and then echo the value of the php variable.  


For example:

Say you have a $price variable set in your PHP script and you want to
use that in a JavaScript.

?php
$price = 50;
?

script language=javascript type=text/javascript
var price = ?php echo $price; ?;
/script

Assuming you put this in a .php file, PHP will parse the file and echo
the price before the javascript makes it to the browser, so if you look
at the source of the document you'll see:

script language=javascript type=text/javascript
var price = 50;
/script

HTH,

Brady


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



Re: [PHP] Creating a Window without JavaScript that is on top

2006-03-22 Thread Todd Cary

How do I get the var into a php variable in the destination window?

Todd

Brady Mitchell wrote:
Personally, I think that posting a way to allow php to communicate 
with javascript OR any other language is relevant for a php-general 
list, don't you think?


To use the value of a PHP variable in javascript, you create a
javascript variable and then echo the value of the php variable.  


For example:

Say you have a $price variable set in your PHP script and you want to
use that in a JavaScript.

?php
$price = 50;
?

script language=javascript type=text/javascript
var price = ?php echo $price; ?;
/script

Assuming you put this in a .php file, PHP will parse the file and echo
the price before the javascript makes it to the browser, so if you look
at the source of the document you'll see:

script language=javascript type=text/javascript
var price = 50;
/script

HTH,

Brady


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



Re: [PHP] Creating a Window without JavaScript that is on top

2006-03-22 Thread Todd Cary

Problem solved

Todd

Todd Cary wrote:

How do I get the var into a php variable in the destination window?

Todd

Brady Mitchell wrote:
Personally, I think that posting a way to allow php to communicate 
with javascript OR any other language is relevant for a php-general 
list, don't you think?


To use the value of a PHP variable in javascript, you create a
javascript variable and then echo the value of the php variable. 
For example:


Say you have a $price variable set in your PHP script and you want to
use that in a JavaScript.

?php
$price = 50;
?

script language=javascript type=text/javascript
var price = ?php echo $price; ?;
/script

Assuming you put this in a .php file, PHP will parse the file and echo
the price before the javascript makes it to the browser, so if you look
at the source of the document you'll see:

script language=javascript type=text/javascript
var price = 50;
/script

HTH,

Brady


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



[PHP] Executing a string

2006-01-09 Thread Todd Cary

If I have

$myStr = $a * $b;

and I pass it as an argument

$result = myFunction($myStr);

function myFunction($var) {
  $a = getData(1);
  $b = getData(2);

  return // Use $var
}

Is there a way to use $var to process $a and $b?

Todd

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



[PHP] Using POST to pass variables

2005-11-30 Thread Todd Cary
When I have more than one button on a page, I us what I call a reentrant 
approach.  That is the page calls itself.


If the page is emailer.pgp, the the FORM tag would be

form method=get action=emailer.php

At the top is

?php
  $send= $_GET[btnSend];  // Send button pressed
  $cancel  = $_GET[btnCancel];// Cancel is pressed
  $message = $_GET[message];
  if ($send) {
header(location: send.php?message= . $message);
  }
  if ($cancel) {
header(location: index.php);
  }
?

Is there a better way to do this so I can use a POST form?

Thank you...

Todd

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



[PHP] Re: Using POST to pass variables

2005-11-30 Thread Todd Cary
Except this passes the message in the URL.  Is there a way to pass 
variables as a POST (not in the URL)?


I have a class that creates a new socket, however on my client's shared 
server, the creation of sockets is not allowed.  With a new socket, I am 
able to pass the variable information via the socket (POST).


Todd

David Robley wrote:

Todd Cary wrote:


When I have more than one button on a page, I us what I call a reentrant
approach.  That is the page calls itself.

If the page is emailer.pgp, the the FORM tag would be

form method=get action=emailer.php

At the top is

?php
   $send= $_GET[btnSend];  // Send button pressed
   $cancel  = $_GET[btnCancel];// Cancel is pressed
   $message = $_GET[message];
   if ($send) {
 header(location: send.php?message= . $message);
   }
   if ($cancel) {
 header(location: index.php);
   }
?

Is there a better way to do this so I can use a POST form?

Thank you...

Todd

What about:

form method=post action=emailer.php

and

if (isset($_POST['send']) ) {
  # do some sanitising on $_POST['message'] here
  header(location: http://f.q.d.n/path/to/send.php?message=; .
$_POST['message']);
}
exit();

if (isset($_POST['cancel']) ) {
   header(location: http://f.q.d.n/path/to/index.php;);
}

Add other sanity checks as required.


Cheers


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



[PHP] Re: when to enter submitted in mysql?

2005-11-29 Thread Todd Cary
I track my sessions in the MySQL database in the session table.  There 
is a field, ExpireTime, so the table is self purging.


For the pages, I place them into a table, tmp_data, that has a sessionID 
field and ExpireTime.  When all pages are completed, the data is 
inserted into the data table.


If the user has cookies turned off, s/he cannot pickup where s/he left 
off since the sessionID was not stored.  Other than that it works well 
where my client is processing many thousands of Class Action lawsuit claims.


Actually, I use Interbase (Firebird) for this type of application.

Todd

[EMAIL PROTECTED] wrote:

Hi to all!
I have form made on 4 pages (by groups of questions). Right now my code 
works this way: once somebody submit the first page of the form his/her 
submitted info is entered in database with status=temp. I store the ID 
(insert_id()) in session and then every time visitor submit the next 
page I do update of the current record using ID.
But, I heard once that the best solution is store all entered info in 
session (array) and insert all info at once.

Or, instead in sessions, move submitted info with serialized array.

Opinions?

Thanks for help.

-afan


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



Re: [PHP] Web based editor

2005-11-27 Thread Todd Cary

Tom -

I noticed that too:

http://209.204.172.137/emailer/php/examples/example_full.htm

http://209.204.172.137/FCKeditor/_samples/php/sample01.php

Todd

Tom Chubb wrote:

I don't know about TinyMCE - about to look at it, but I have found FCKeditor
very slow.
HTH

On 26/11/05, Todd Cary [EMAIL PROTECTED] wrote:


Joe -

Thank you.  I like how TinyMCE integrates.

Todd
Joe Wollard wrote:


On Nov 26, 2005, at 12:11 PM, Todd Cary wrote:



I want to provide the user with an editor like

http://209.204.172.137/FCKeditor/_samples/php/sample01.php

Is it best to use a JavaScript based editor?

Are there some favorites out there or is the FCKeditor about as
good as they get?

Todd

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



I don't know if one is better than the next, but I've used TinyMCE in
the past and it has served me well.
http://tinymce.moxiecode.com/


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






--
Tom Chubb
[EMAIL PROTECTED]
07915 053312



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



[PHP] When to make a class

2005-11-26 Thread Todd Cary
My background is in Object Oriented Pascal (Delphi), however I am having 
 difficulty knowing when to make a class in PHP.  For instance, in my 
script file, functions.php, I have these functions among others:


  /* Input a field */
  function input_field($name, $value, $size, $max) {
echo('INPUT TYPE=text NAME=' . $name . ' VALUE=' . $value .
 ' SIZE=' . $size . ' MAXLENGTH=' . $max . '');
  };

  /* Input a password field */
  function input_password_field($name, $value, $size, $max) {
echo('INPUT TYPE=password NAME=' . $name . ' VALUE=' . $value .
 ' SIZE=' . $size . ' MAXLENGTH=' . $max . '');
  };


Should I have a class that contains these functions (methods)?

One of my non-profit clients would like to have an online emailer 
program driven by a MySQL database.  This I can envision as a class, 
actually several classes (e.g. send mail, create message, select 
addresses, etc.).


Todd

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



[PHP] Re: When to make a class

2005-11-26 Thread Todd Cary

Olli -

A very well thought out answer.  I especially liked the part, I see the 
benefits of a class when functions start sharing variables..


Todd

Oliver Grätz wrote:

Todd Cary schrieb:

My background is in Object Oriented Pascal (Delphi), however I am having 
 difficulty knowing when to make a class in PHP.  For instance, in my 
script file, functions.php, I have these functions among others:


  /* Input a field */
  function input_field($name, $value, $size, $max) {
echo('INPUT TYPE=text NAME=' . $name . ' VALUE=' . $value .
 ' SIZE=' . $size . ' MAXLENGTH=' . $max . '');
  };

  /* Input a password field */
  function input_password_field($name, $value, $size, $max) {
echo('INPUT TYPE=password NAME=' . $name . ' VALUE=' . $value .
 ' SIZE=' . $size . ' MAXLENGTH=' . $max . '');
  };


Should I have a class that contains these functions (methods)?



Simple answer:
If YOU don't see the benefits of a class then you shouldn't use one.

Longer answer:
I see the benefits of a class when functions start sharing variables.
Then you would have to use $GLOBALS or the global keyword. This is a big
indication that the functions should instead be inside a class and that
the variables should be properties of that class.
Of course, when you start using classes you slowly move to using classes
even if they're not absolutely necessary as with your two functions up
there. Then one notices that there are even more types of input fields
(radio buttons, hidden fields, select boxes...) and that they have
something in common (attributes of the input tag). So one could think
Hey, why not make a base class for all fields?. And so on...

OLLi


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



[PHP] An event calendar

2005-11-26 Thread Todd Cary
Currently I am considering the use of ltwCalendar, however I am open to 
suggestions for an open source event calendar like this demo of ltwCalendar:


http://209.204.172.137/sfyc/php/calendar/calendar.php

I would like to be able to easily modify it so that I can have an event 
that links to another page when necessary or even to a signup page to 
make reservations.


Exploring

Todd

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



Re: [PHP] Web based editor

2005-11-26 Thread Todd Cary

Joe -

Thank you.  I like how TinyMCE integrates.

Todd
Joe Wollard wrote:

On Nov 26, 2005, at 12:11 PM, Todd Cary wrote:


I want to provide the user with an editor like

http://209.204.172.137/FCKeditor/_samples/php/sample01.php

Is it best to use a JavaScript based editor?

Are there some favorites out there or is the FCKeditor about as  
good as they get?


Todd

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



I don't know if one is better than the next, but I've used TinyMCE in  
the past and it has served me well.

http://tinymce.moxiecode.com/


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



[PHP] Improving my PHP coding

2005-11-26 Thread Todd Cary
Though my applications run in a high profile environment (national class 
action lawsuits e.g. Enron, Microsoft, etc.), my coding style is ages 
old, and even then, primitive.  If there is anyone who has the time to 
help me bring my coding up to 2005 standards, off line, I would 
appreciate it.


With appreciation

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



Re: [PHP] Printing to a buffer

2005-11-13 Thread Todd Cary

Marcus -

Many thanks!  I did not know that MIME-Type.  Change duly made!

Todd

Marcus Bointon wrote:


On 13 Nov 2005, at 00:17, Jasper Bryant-Greene wrote:

seem to do that.  I just tried application/text since I use  
application/pdf for other applications.



Whatever it's giving the user the ability to do, it's probably  
because the browser doesn't recognise the (invalid) MIME-Type.



Quite - it's right up there with 'application/force-download'. If you  
want to suggest (the final choice is not yours to make) that a  browser 
might download something instead of displaying it, set an  appropriate 
content-disposition header instead of setting the wrong  type.


Marcus


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



Re: [PHP] Printing to a buffer

2005-11-13 Thread Todd Cary


Just before the police knocked at my door, I made a few changes!

?
  ob_start();
  print This is a testbr;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: text/plain);
  header(Content-Length: $len);
  header(Content-Disposition: attachment; filename=sfyc.html);
  print($buf);
?

Todd
Marcus Bointon wrote:

On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:


Many thanks!  I did not know that MIME-Type.  Change duly made!



You're not suggesting that you actually set the MIME-Type to  
application/force-download, are you?



I think he is. I've called the MIME-type police and they'll be round  
later.


Todd, I think you should read this: http://support.microsoft.com/kb/ 
q260519/


There's a PHP example just before the user notes here: http:// 
www.php.net/header


Marcus


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



[PHP] Output_Buffer problem

2005-11-13 Thread Todd Cary
My client has switched to a shared server, so direct access to the 
php.ini is not availble.  Our calendar program expects to have 
output_buffering set to On (1).


Currently, I get the expected error of

Warning: Cannot modify header information - headers already sent by 
(output started at 
/home/content/s/f/y/sfycadmin/html/php/calendar/private/ltw_config.php:375) 
in 
/home/content/s/f/y/sfycadmin/html/php/calendar/private/ltwdisplaymonth.php 
on line 283


At the top of ltwdisplaymonth.php, I tried ini_set(output_buffering, 
1), but that does not appear to have an effect.


Have I missed something?

Todd

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



Re: [PHP] Printing to a buffer

2005-11-13 Thread Todd Cary
Because this was just a test of what will be many print lines.  The 
original application used a file to hold the data and upon request by 
the user, it was emailed.  But with my client's shared server, files 
cannot be opened...a pain.


If you have a better solution, I am open to other ideas.

Todd

M. Sokolewicz wrote:

call me stupid, but why don't you do it like this:

$buf = This is a testbr;
header(Content-type: text/plain);
header(Content-Length: .strlen($buf));
header(Content-Disposition: attachment; filename=sfyc.html);
echo $buf;

??
looks easier to me... no output buffering required...

Todd Cary wrote:



Just before the police knocked at my door, I made a few changes!

?
  ob_start();
  print This is a testbr;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: text/plain);
  header(Content-Length: $len);
  header(Content-Disposition: attachment; filename=sfyc.html);
  print($buf);
?

Todd
Marcus Bointon wrote:


On 13 Nov 2005, at 19:27, Jasper Bryant-Greene wrote:


Many thanks!  I did not know that MIME-Type.  Change duly made!





You're not suggesting that you actually set the MIME-Type to  
application/force-download, are you?





I think he is. I've called the MIME-type police and they'll be round  
later.


Todd, I think you should read this: http://support.microsoft.com/kb/ 
q260519/


There's a PHP example just before the user notes here: http:// 
www.php.net/header


Marcus


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



[PHP] Printing to a buffer

2005-11-12 Thread Todd Cary
My client's new shared server does not allow printing to a file, so I 
want my print statement to print to a buffer, then I'll send it to the 
user via Headers.  This does not work since print does no go to the 
buffer, or at least appears not to: I get the errors from the header 
statements;


?
  ob_start;
  print This is a testbf;
  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: application/text);
  header(Content-Length: $len);
  header(Content-Disposition: inline; filename=Sfyc.html);
  print($buf);
?

Todd

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



Re: [PHP] Printing to a buffer

2005-11-12 Thread Todd Cary

Yup!  It was the missing parentheses!  Works as planned.

Many thanks

The application/text gives the user the ability; text/plain does not 
seem to do that.  I just tried application/text since I use 
application/pdf for other applications.


Todd

Jasper Bryant-Greene wrote:

Todd Cary wrote:

My client's new shared server does not allow printing to a file, so I 
want my print statement to print to a buffer, then I'll send it to the 
user via Headers.  This does not work since print does no go to the 
buffer, or at least appears not to: I get the errors from the header 
statements;


?
  ob_start;



You're missing some parentheses on the ob_start function. I think you 
meant to write:


ob_start();


  print This is a testbf;



You probably meant br in that string too.


  $buf = ob_get_contents();
  $len = strlen($buf);
  ob_end_clean();
  header(Content-type: application/text);



application/text isn't a MIME-Type, is it? Do you mean text/plain?


  header(Content-Length: $len);
  header(Content-Disposition: inline; filename=Sfyc.html);
  print($buf);
?

Todd



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



[PHP] Attachments and SendMail()

2005-11-08 Thread Todd Cary
I have had to move an application for a client from a dedicated server 
to a shared server.  On the dedicated server, the path to the 
attachements was an absolute address of


/home/sites/home/web/php/images/raceschd.pdf;

and all worked fine when I gave that as the location of the attachement:

if ($Attachment) {
  $mail-AddAttachment($Attachment);
}

Now I am not sure where/how to specify the location of the attachment. 
If anyone has experience with a shared server, I would appreciate any help.


The URL to the site is

http://64.202.163.82/s/f/y/sfycadmin/html/

And with FTP that is the base or root.  I have tried putting the file in 
that directory, but SendMail() does not appear to connect to it.


Todd

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



[PHP] Re: Attachments and SendMail()

2005-11-08 Thread Todd Cary
I figured it out!  The base location for SendMail is the php directory. 
 Now that I think about it, that makes sense.


Todd

Todd Cary wrote:
I have had to move an application for a client from a dedicated server 
to a shared server.  On the dedicated server, the path to the 
attachements was an absolute address of


/home/sites/home/web/php/images/raceschd.pdf;

and all worked fine when I gave that as the location of the attachement:

if ($Attachment) {
  $mail-AddAttachment($Attachment);
}

Now I am not sure where/how to specify the location of the attachment. 
If anyone has experience with a shared server, I would appreciate any help.


The URL to the site is

http://64.202.163.82/s/f/y/sfycadmin/html/

And with FTP that is the base or root.  I have tried putting the file in 
that directory, but SendMail() does not appear to connect to it.


Todd


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



[PHP] Setting up Linux and SendMail for SMTP

2005-10-13 Thread Todd Cary
I have a Linux server on my network, however my main mail is handled by 
Thunderbird on my PC which uses my ISP's SMTP server (UserName and PW). 
 Can I configure SendMail to send mail to my ISP's SMTP server using 
the built in mail() function of PHP?


If I use one of the Mail Classes, I can do it and on my client's Linux 
server, mail() works (but they are not using an outside SMTP server).


Many thanks...

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



[PHP] Best way to update PHP on RH 9

2005-09-11 Thread Todd Cary
I have RH 9 on our server and if I try to use a rpm for php-4.3.9 or 
greater, there are many unresolved dependencies.  What is the best way 
around this problem?


Todd

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



Re: [PHP] Checking a date for validity

2005-09-08 Thread Todd Cary

Chris W. Parker wrote:

Todd Cary mailto:[EMAIL PROTECTED]
on Wednesday, September 07, 2005 3:39 PM said:



  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];



Why $parts2?

Just use $parts instead, like you did in the other two blocks.

Change it to:



  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts = explode(-, $date);
  } else {
$parts = explode(., $date);
  }




Is there a simplier solution?



How about strtotime()? In your function you're pretty much only
accepting a certain number of formats for your date already so you could
probably go with just passing the date (in whatever format it's given)
to strtotim() and check for a 'false' or a timestamp.


Chris.

Chris -

That you for the helpful comments!  The reason I use the strtotime() up 
front is to make sure junk data has not been placed in the fields.  My 
client tests by putting %^#$ into fields, and that creates a problem 
with their php 4.2.x but not with my 4.3.9.  The strtotime() took care 
of the problem...


Todd

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



Re: [PHP] Checking a date for validity

2005-09-08 Thread Todd Cary

Chris W. Parker wrote:

Todd Cary mailto:[EMAIL PROTECTED]
on Wednesday, September 07, 2005 3:39 PM said:



  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];



Why $parts2?

Just use $parts instead, like you did in the other two blocks.

Change it to:



  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts = explode(-, $date);
  } else {
$parts = explode(., $date);
  }




Is there a simplier solution?



How about strtotime()? In your function you're pretty much only
accepting a certain number of formats for your date already so you could
probably go with just passing the date (in whatever format it's given)
to strtotim() and check for a 'false' or a timestamp.


Chris.

Chris -

That you for the helpful comments!  The reason I use the strtotime() up
front is to make sure junk data has not been placed in the fields.  My
client tests by putting %^#$ into fields, and that creates a problem
with their php 4.2.x but not with my 4.3.9.  The strtotime() took care
of the problem...

Todd

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



Re: [PHP] Checking a date for validity

2005-09-08 Thread Todd Cary

Chris W. Parker wrote:

Todd Cary mailto:[EMAIL PROTECTED]
on Wednesday, September 07, 2005 3:39 PM said:



  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];



Why $parts2?

Just use $parts instead, like you did in the other two blocks.

Change it to:



  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts = explode(-, $date);
  } else {
$parts = explode(., $date);
  }




Is there a simplier solution?



How about strtotime()? In your function you're pretty much only
accepting a certain number of formats for your date already so you could
probably go with just passing the date (in whatever format it's given)
to strtotim() and check for a 'false' or a timestamp.


Chris.

Chris -

That you for the helpful comments!  The reason I use the strtotime() up
front is to make sure junk data has not been placed in the fields.  My
client tests by putting %^#$ into fields, and that creates a problem
with their php 4.2.x but not with my 4.3.9.  The strtotime() took care
of the problem...

Todd

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



[PHP] Checking a date for validity

2005-09-07 Thread Todd Cary
I need to check the input of a user to make sure the date is valid and 
correctly formatted.  Are there any examples available?


Here is one solution I created:

  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];
  } else {
$parts = explode(., $date);
  }
  //print_r($parts);
  if (checkdate($parts[0], $parts[1], $parts[2]) )
return 1;
  else
return 0;
}
return $retval;
  }

Is there a simplier solution?

Many thanks..

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



Re: [PHP] Checking a date for validity

2005-09-07 Thread Todd Cary

Jordan Miller wrote:
writing a parse script is okay, but it will be very difficult to  always 
ensure they are inputting it correctly. I recommend putting a  popup 
calendar next to the input field. If the field is automatically  
populated in this way you will have a much easier time parsing it  
correctly. I can't recommend a good one offhand, but there are  several 
that are DHTML and JS only, so that should be a good starting  point for 
standards compliance. See:

http://www.dynarch.com/projects/calendar/
and
http://www.google.com/search?q=dhtml+popup+calendar

Jordan


On Sep 7, 2005, at 5:39 PM, Todd Cary wrote:

I need to check the input of a user to make sure the date is valid  
and correctly formatted.  Are there any examples available?


Here is one solution I created:

  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];
  } else {
$parts = explode(., $date);
  }
  //print_r($parts);
  if (checkdate($parts[0], $parts[1], $parts[2]) )
return 1;
  else
return 0;
}
return $retval;
  }

Is there a simplier solution?

Many thanks..

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




My need has to do with claimants for class action lawsuits, so I guess 
having drop downs for months, days and years is one answer.


Todd

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



[PHP] Debugging mail()

2005-07-28 Thread Todd Cary
I have the following code in my script and no errors are created, but I 
do not get any emails.  It works on other servers.


Are there some logs I can check to figure out why an email is not being 
sent/received?


Todd

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



[PHP] Re: Debugging mail()

2005-07-28 Thread Todd Cary

Todd Cary wrote:
I have the following code in my script and no errors are created, but I 
do not get any emails.  It works on other servers.


Are there some logs I can check to figure out why an email is not being 
sent/received?


Todd
I think I figured out the problem: the needed port is assigned to 
another server!


Todd

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



[PHP] Re: Debugging mail()

2005-07-28 Thread Todd Cary

Todd Cary wrote:
I have the following code in my script and no errors are created, but I 
do not get any emails.  It works on other servers.


Are there some logs I can check to figure out why an email is not being 
sent/received?


Todd


Whoops...forgot the code:

if (mail([EMAIL PROTECTED], Test email, $body, 
From:[EMAIL PROTECTED])) {

 $msg = Email has been sent to  . $req_email;
 $req_email = ;
} else {
  $msg = Cannot send email;
}

And I believe the problem is that the required is being used by another 
server.


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



[PHP] Is GD available

2005-07-15 Thread Todd Cary

I have php 4.3.11 available, and when I do a phpinfo()

   http://209.204.172.137:81/testphp.php

I see it in the configuration, but it is not listed elsewhere.  How can 
I test to see if it is available?


gd_info() is not in 4.3.11 and extension_loaded('gd') gives a false.

Todd

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



Re: [PHP] Is GD available

2005-07-15 Thread Todd Cary
In php 4.3.11, ini files are placed in /etc/php.d that have 
extension=.  I have one (i.e. gd.ini) with extension=libgd.so.2  
and libgd.so.2 is in /usr/lib/php4.


Todd

André Medeiros wrote:


On Fri, 2005-07-15 at 07:06 -0700, Todd Cary wrote:
 


I have php 4.3.11 available, and when I do a phpinfo()

   http://209.204.172.137:81/testphp.php

I see it in the configuration, but it is not listed elsewhere.  How can 
I test to see if it is available?


gd_info() is not in 4.3.11 and extension_loaded('gd') gives a false.

Todd

   



Check if the extension is loaded on php.ini

If it is, check apache's errorlog.

Good luck


 



Re: [PHP] Is GD available

2005-07-15 Thread Todd Cary

Damn!  I should have checked the error_log first!

PHP Warning:  Unknown(): Invalid library (maybe not a PHP library)
'libgd.so.2'  in Unknown on line 0

And this is the library from the rpm specified in ww.php.net: 
http://www.boutell.com/gd/.  However, the site says that gd should be 
supported out of the box.  I am going to try and find the rpm for 
php-4.3.11 and reinstall it.


Todd

André Medeiros wrote:


On Fri, 2005-07-15 at 07:25 -0700, Todd Cary wrote:
 


In php 4.3.11, ini files are placed in /etc/php.d that have
extension=.  I have one (i.e. gd.ini) with
extension=libgd.so.2  and libgd.so.2 is in /usr/lib/php4.

Todd

André Medeiros wrote: 
   


On Fri, 2005-07-15 at 07:06 -0700, Todd Cary wrote:
 
 


I have php 4.3.11 available, and when I do a phpinfo()

   http://209.204.172.137:81/testphp.php

I see it in the configuration, but it is not listed elsewhere.  How can 
I test to see if it is available?


gd_info() is not in 4.3.11 and extension_loaded('gd') gives a false.

Todd

   
   


Check if the extension is loaded on php.ini

If it is, check apache's errorlog.

Good luck


 
 



Try putting it on php.ini

There's something wrong that makes the extension not being loaded.

Did you check apache's error logs?


 



[PHP] RH 9: Installing PHP 4.3

2005-07-06 Thread Todd Cary
Until I can get Fedora 4 to install on my computer, I need to go back to 
RH 9 which means I need to update Apache and PHP. This is not an area in 
which I have much knowledge, so bear with me:


I downloaded the tarball for Apache 2.0.54 and then configured with

./configure --prefix=/www --enable-module=so

followed by the make and make install

Next I download Php 4.3.11 and do the configure with

./configure --with-interbase=shared,/opt/firebird --with-apxs2=/www/bin/apxs

When I run the make, I get

...
sapi/apache2handler/php_functions.lo main/internal_functions.lo -lcrypt 
-lcrypt -lresolv -lm -ldl -lnsl

-lcrypt -lcrypt -o libphp4.la
ext/ctype/ctype.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

If I do not have the --with-apxs2=/www/bin/apxs, there are no errors, 
but I do not get the libphp4.so that I need.


Help!

Todd

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



[PHP] PHP 4.3/MySQL phpinfo()

2005-04-05 Thread Todd Cary
I have installed FC 3 with Apache and MySQL.  When I run phpinfo(), I do 
not see MySQL listed as a database nor can I connect via php.

Does something have to be specially done with the FC 3 install?
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Simple CMS program

2005-03-31 Thread Todd Cary
This has been the one I wanted to try, but I needed to hear from someone
that could recommend it.  Now I'll do a test install on my Linux play box.
Many thanks...
Todd
Andre Dubuc wrote:
On Wednesday 30 March 2005 08:19 pm, Josip Dzolonga wrote:
Todd Cary wrote:
When I went to a site that lists and compares CMS programs, I was
overwhelmed by at least 100 listings.  Again, I would like to rely on
personal experience.  What I am seeking is a CMS that will provide
users at my client (a Yacht Club) to update news items, and if
possible, update a calendar using a Web based editor.  Not a full
fledged portal CMS.
Also, it would be nice if it was written in PHP and use MySQL for the
server DB.  Has anyone had experience with such a CMS?
Todd

Try:
http://www.mamboserver.com
easy to install, update, etc.
Hth,
Andre
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Any personal experience with MySQL/Calendar application

2005-03-30 Thread Todd Cary
Joe -
Can you send me the name?
[EMAIL PROTECTED]
Todd
Joe Harman wrote:
Hey Todd... I have one that I created and posted at Zend.com ... it
can be easily adapted to store data n MySQL...
Joe
On Tue, 29 Mar 2005 12:33:12 -0500, Peter G. Brown
[EMAIL PROTECTED] wrote:
I have used egroupware in a company setting and found it to be largely
satisfactory. It might be overkill in your case but you can restrict
module access.
www.egroupware.org
HTH
Peter Brown
Todd Cary wrote:
I am looking for an open source calendar program that uses MySQL to
store the data and has an online Admin feature.  Rather than trying the
many that are listed, I am hoping that someone may have some personal
experience with a application of this type and make a recommendation.
Todd
--
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] Simple CMS program

2005-03-30 Thread Todd Cary
When I went to a site that lists and compares CMS programs, I was 
overwhelmed by at least 100 listings.  Again, I would like to rely on 
personal experience.  What I am seeking is a CMS that will provide users 
at my client (a Yacht Club) to update news items, and if possible, 
update a calendar using a Web based editor.  Not a full fledged portal CMS.

Also, it would be nice if it was written in PHP and use MySQL for the 
server DB.  Has anyone had experience with such a CMS?

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


[PHP] Any personal experience with MySQL/Calendar application

2005-03-29 Thread Todd Cary
I am looking for an open source calendar program that uses MySQL to 
store the data and has an online Admin feature.  Rather than trying the 
many that are listed, I am hoping that someone may have some personal 
experience with a application of this type and make a recommendation.

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


[PHP] Sending data via POST

2005-03-11 Thread Todd Cary




Currently I send data to another page by using

header("Location: http://" . $_SERVER['HTTP_HOST'] .
  dirname($_SERVER['PHP_SELF']) . 
 "/" . $relative_url . 
 "?"
. $my_data);

My
client would like the data passed via a POST rather than in the URL.

Can this be done and if so, how?

Many
thanks

Todd


-- 



inline: NewLogo.gif

[PHP] Re: Sending data via POST

2005-03-11 Thread Todd Cary
Shawn -
Many thanks!  I have a class I wrote that does that, but I thought I may 
have overlooked something simplier.

Todd
Shawn Kelly wrote:
This is from php.net:
Just change the $out to fill with your POST request (instead of the 
GET).  Works good, you can change ports. :)
 
|$fp = fsockopen(www.example.com, 80, $errno, $errstr, 30);
if (!$fp) {
   echo $errstr ($errno)br /\n;
} else {
   $out = GET / HTTP/1.1\r\n;
   $out .= Host: www.example.com\r\n;
   $out .= Connection: Close\r\n\r\n;

   fwrite($fp, $out);
   while (!feof($fp)) {
   echo fgets($fp, 128);
   }
   fclose($fp);
}
|
Todd Cary [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Currently I send data to another page by using
header(Location: http://; . |$_SERVER['HTTP_HOST'] .|
|dirname($_SERVER['PHP_SELF']) . |
|/ . $relative_url  . |
|? . $my_data);|
||
||My client would like the data passed via a POST rather than in the
URL.
Can this be done and if so, how?
||Many thanks
Todd
||
-- 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Inline Frame and php

2005-02-28 Thread Todd Cary
My client insists on using inline Frames that uses my php pages.  As an 
example, this is on one page:

IFRAME target=_top frameborder=0 
SRC=search.php?search_text=?echo($search_text);? WIDTH=592 HEIGHT=282
/IFRAME

This works well with the control being given to search.php.  What I do 
not understand is that within search.php, I have a statement that is 
suppose to pass control to anther page.  The line is

header(location: http://192.168.0.23/mypath/mypage.php;);
Rather than going to the page, it opens mypage.php in the inline frame.
Is there a way to leave the inline frame?
[Excuse my nomenclature e.g. control, leave]
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Cannot upload a file greater than 500 KB

2005-02-08 Thread Todd Cary
I am using php 4 and Apache 1.3 on a RH 9 box.
upload_max_filesize is set to 5M
post_max_size is set to 8M
MAX_FILE_SIZE in the HTML upload page is set to 500
I get the error The document contains no data with any file over 500 KB.
What is creating the error?
Many thanks.
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Cannot upload a file greater than 500 KB

2005-02-08 Thread Todd Cary
Richard -
It turned out that the following was missing from Apache's httpd.conf file:
Files *.php
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 500
/Files
Not sure what that does or where I should have read about it, but I did 
find that in an email I got with Google.

Todd
Richard Lynch wrote:

Todd Cary wrote:
I am using php 4 and Apache 1.3 on a RH 9 box.
upload_max_filesize is set to 5M
post_max_size is set to 8M
MAX_FILE_SIZE in the HTML upload page is set to 500
I get the error The document contains no data with any file over 500 KB.
What is creating the error?

Are you sure the HTML one isn't 50?... :-)
Also double-check your settings in ?php phpinfo();? to be sure that the
php.ini you changed is the one PHP reads...
Actually, though, you shouldn't get The document contains no data in any
of these, unless your BROWSER is getting tired of waiting for a response
from the server.
The PHP script should still be invoked, and it should be able to detect
the over-sized file uploaded, and it should print some kind of error
message about that.
It's quite possible your script does absolutely NOTHING when the file is
over-sized, and then it prints nothing out, and so the document is
completely empty, and you get that message.
Review the PHP you wrote and see what you did for an over-sized check on
the file uploaded, or any other kind of upload error.  Are you printing
SOMETHING out in that case?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Changing PHP properties (Previously: Cannot upload a file greater

2005-02-08 Thread Todd Cary
Dan -
Keep in mind that the change I made was within Apache on my server - not 
in the php.ini file.  The changes to the php.ini file are well 
documented and have been covered within messages on this NewNet.

However, s I stated, I am not sure why that change needs to be 
made...more reading for me I am sure!

Todd
Dan Trainor wrote:
Todd Cary wrote:
Richard -
It turned out that the following was missing from Apache's httpd.conf 
file:

Files *.php
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 500
/Files
Not sure what that does or where I should have read about it, but I 
did find that in an email I got with Google.

Todd
Richard Lynch wrote:

Todd Cary wrote:
I am using php 4 and Apache 1.3 on a RH 9 box.
upload_max_filesize is set to 5M
post_max_size is set to 8M
MAX_FILE_SIZE in the HTML upload page is set to 500
I get the error The document contains no data with any file over 
500 KB.

What is creating the error?


Are you sure the HTML one isn't 50?... :-)
Also double-check your settings in ?php phpinfo();? to be sure that 
the
php.ini you changed is the one PHP reads...

Actually, though, you shouldn't get The document contains no data 
in any
of these, unless your BROWSER is getting tired of waiting for a response
from the server.

The PHP script should still be invoked, and it should be able to detect
the over-sized file uploaded, and it should print some kind of error
message about that.
It's quite possible your script does absolutely NOTHING when the file is
over-sized, and then it prints nothing out, and so the document is
completely empty, and you get that message.
Review the PHP you wrote and see what you did for an over-sized check on
the file uploaded, or any other kind of upload error.  Are you printing
SOMETHING out in that case?

While we're touching base on this subject, I know that you don't know 
much about this Todd, but does anyone else know where we can find more 
information about making modifications to PHP's operations inline in a 
configuration file such as this?

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


Re: [PHP] Displaying a html line as html

2005-02-01 Thread Todd Cary
OK...I am close, but still missing something.  The string returned by 
the function is $page_path and it contains

a href=http://209.204.172.137/casesearch/php/search.php;Home/a-
a href=http://209.204.172.137/casesearch/php/search.php;Search/a
And here is how the function is used:
 $page_path = make_page_path($page_string, $fullscriptname);
 print($page_path);
It is not printing the string as a link, and
 print(' . $page_path . ');
just prints the literal string with apotrophies added.  I tried
 $page_path = ' . make_page_path($page_string, $fullscriptname) . ';
with the same results.
Todd
Justin French wrote:
On 01/02/2005, at 1:05 PM, Todd Cary wrote:
I have the following:
$p = a href=http://209.204.172.137/casesearch/php/home.php;Home/a

try
$p = 'a href=http://209.204.172.137/casesearch/php/home.php;Home/a';
echo $p;
---
Justin French, Indent.com.au
[EMAIL PROTECTED]
Web Application Development  Graphic Design
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Displaying a html line as html

2005-02-01 Thread Todd Cary
Jochem -
Here is the function:
  /* Make page path */
  function make_page_path($page_string, $script_name) {
$parts = explode('|', $page_string);
for ($i = 0; $i  count($parts); $i++) {
  if ($i == 0) {
$page_path = 'lt;a href=' . $script_name . 'gt;' . 
$parts[$i] . 'lt;/agt;';
  } else {
$page_path = $page_path . '-' . 'lt;a href=' . $script_name 
. 'gt;' . $parts[$i] . 'lt;/agt;';
  }
}
//print(Page_path:  . $page_path . br);
return $page_path;
  }

Here is the executing code:
  $page_string   = make_page_string($page_string, Search);
  $script_string = make_script_string($script_string, search.php);
print(Page_string:  . $page_string . br);
print(Script_string:  . $script_string . br);
print(Url:  . $url . br);
  $page_path = make_page_path($page_string, $script_string, $url);
print($page_path);
To see it execute, this URL will do it: 
http://209.204.172.137/casesearch/php/search.php?search_text=***page_string=Homescript_string=home.php

The Title area contains
 nbsp;nbsp;? print($page_path); ?
The function that creates the link(s) is
  /* Make page path */
  function make_page_path($page_string, $script_string, $path) {
$scripts = explode('|', $script_string);
$pages   = explode('|', $page_string);
for ($i = 0; $i  count($scripts); $i++) {
  if ($i  count($scripts) - 1) {
if ($i == 0) {
  $page_path = 'lt;a href=' . $path . $scripts[$i] . 'gt;' 
. $pages[$i] . 'lt;/agt;';
} else {
  $page_path = $page_path . '-gt;' . 'lt;a href=' . $path . 
$scripts[$i] . 'gt;' . $pages[$i] . 'lt;/agt;';
}
  } else {
if ($i == 0) {
  $page_path = $pages[$i];
} else {
  $page_path = $page_path . '-gt;' . $pages[$i];
}
  }
}
//print(Page_path:  . $page_path . br);
return $page_path;
  }


Thank you for your help...
Todd
Jochem Maas wrote:
Todd Cary wrote:
OK...I am close, but still missing something.  The string returned by 
the function is $page_path and it contains

a href=http://209.204.172.137/casesearch/php/search.php;Home/a-   

 ^
what ever else you function is doing this is probably not correct


a href=http://209.204.172.137/casesearch/php/search.php;Search/a
And here is how the function is used:
funny thing is you don't show the code for the function - AND i willing to
bet money that the function uses html_entities() - or an equivelant...
you say the function returns:
a href=http://209.204.172.137/casesearch/php/home.php;Home/a
but that is bullshit (if everything else you say it true, namely a 
direct echo of the return
value does not show a link), if you bother to look at your own source, 
then you
will see that the string that is output is:

lt;a 
href=quot;http://209.204.172.137/casesearch/php/home.phpquot;gt;Homelt;/agt; 

actually I noticed that the site had changed a little since I happened 
to look yesterday.
today you are dumping some debug output at the top of the page, where as 
yesterday
you we outputting the borked link next to the logo (the home link there 
now works - I suspect
that this is because you have reverted to functionality there?)

post the code for the make_page_path() function!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Displaying a html line as html

2005-02-01 Thread Todd Cary
Jochem -
Sorry!  The prior message was incorrect.  Here it is corrected.
Here is the executing code:
  $page_string   = make_page_string($page_string, Search);
  $script_string = make_script_string($script_string, search.php);
print(Page_string:  . $page_string . br);
print(Script_string:  . $script_string . br);
print(Url:  . $url . br);
  $page_path = make_page_path($page_string, $script_string, $url);
print($page_path);
To see it execute, this URL will do it:
http://209.204.172.137/casesearch/php/search.php?search_text=***page_string=Homescript_string=home.php
The Title area contains
 nbsp;nbsp;? print($page_path); ?
The function that creates the link(s) is
  /* Make page path */
  function make_page_path($page_string, $script_string, $path) {
$scripts = explode('|', $script_string);
$pages   = explode('|', $page_string);
for ($i = 0; $i  count($scripts); $i++) {
  if ($i  count($scripts) - 1) {
if ($i == 0) {
  $page_path = 'lt;a href=' . $path . $scripts[$i] . 'gt;'
. $pages[$i] . 'lt;/agt;';
} else {
  $page_path = $page_path . '-gt;' . 'lt;a href=' . $path .
$scripts[$i] . 'gt;' . $pages[$i] . 'lt;/agt;';
}
  } else {
if ($i == 0) {
  $page_path = $pages[$i];
} else {
  $page_path = $page_path . '-gt;' . $pages[$i];
}
  }
}
//print(Page_path:  . $page_path . br);
return $page_path;
  }

Thank you for your help...
Todd
Jochem Maas wrote:
Todd Cary wrote:
OK...I am close, but still missing something.  The string returned by 
the function is $page_path and it contains

a href=http://209.204.172.137/casesearch/php/search.php;Home/a-   

 ^
what ever else you function is doing this is probably not correct


a href=http://209.204.172.137/casesearch/php/search.php;Search/a
And here is how the function is used:
funny thing is you don't show the code for the function - AND i willing to
bet money that the function uses html_entities() - or an equivelant...
you say the function returns:
a href=http://209.204.172.137/casesearch/php/home.php;Home/a
but that is bullshit (if everything else you say it true, namely a 
direct echo of the return
value does not show a link), if you bother to look at your own source, 
then you
will see that the string that is output is:

lt;a 
href=quot;http://209.204.172.137/casesearch/php/home.phpquot;gt;Homelt;/agt; 

actually I noticed that the site had changed a little since I happened 
to look yesterday.
today you are dumping some debug output at the top of the page, where as 
yesterday
you we outputting the borked link next to the logo (the home link there 
now works - I suspect
that this is because you have reverted to functionality there?)

post the code for the make_page_path() function!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Storing key values in an array

2005-01-21 Thread Todd Cary
I am using an array to populate a drop-down and I would like to have the 
same value in the key as the value.  Using the following, the key is 
0,1,2,3...etc.  How can I correct that?

$file_list = array();
$dir = opendir($doc_dir);
while (false !== ($file = readdir($dir))) {
  if (($file != .)  ($file != ..))
$file_list[$file] = $file;  ---
}
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Storing key values in an array

2005-01-21 Thread Todd Cary
Jochem -
The problem is the sort()!  I did not realize that it replaces the key 
with an integer.  Instead, I should have used ksort().

$dir = opendir($doc_dir);
while (false !== ($file = readdir($dir))) {
  if (($file != .)  ($file != ..))
$file_list[$file] = $file;
}
// Debug code
echo 'pre';
print_r($file_list);
echo '/pre';
sort($file_list);  ---
foreach ($file_list as $key = $val) {
  echo $key .  =  . $val . br;
}
Here are the result:
Array
(
[mailings] = mailings
[cases] = cases
)
0 = cases
1 = mailings

Todd
Jochem Maas wrote:
Todd Cary wrote:
I am using an array to populate a drop-down and I would like to have 
the same value in the key as the value.  Using the following, the key 
is 0,1,2,3...etc.  How can I correct that?

what is there to correct - you are telling me that the value of $file 
show up as a string and then magically it becomes an integer (but just 
while you are designating the key)

listen you've just shown us a simple loop to stuff some file/dir names 
into an array where by the file/dir name is the assoc. key as well as 
the value of any given item in said array - WHERE THE F*** IS THE 
DROPDOWN RELATED CODE?

$file_list = array();
$dir = opendir($doc_dir);
while (false !== ($file = readdir($dir))) {
  if (($file != .)  ($file != ..))
$file_list[$file] = $file;  ---
}

what happens if you place the following right after the code you mention 
(just to prove that what you say about the key is wrong):

echo 'pre';
print_r($file_list);
echo '/pre';
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Providing a means for the surfer to send a file

2005-01-20 Thread Todd Cary




I am looking for some sample code on setting up a page that provides a
means for the surfer to send a file to the server.

Todd
-- 



inline: NewLogo.gif

[PHP] Making includes and requires safe.

2004-12-27 Thread Todd Cary
I received the following and I would like to know what is meant by 
making includes and requires safe:

[Quote]
News Story by Peter Sayer
DECEMBER 27, 2004 (IDG NEWS SERVICE) - The latest version of the Santy 
worm poses an elevated risk to many Web sites built using the PHP 
scripting language, and protection of those sites may involve 
individually recoding them, security experts warned over the weekend.

Early versions of the Santy worm exploited a specific bug in a 
bulletin-board software package called phpBB, and their attacks could be 
prevented by applying a patch to the software (see story). However, the 
security flaw exploited by newer versions of the worm such as Santy.C or 
Santy.E is more general, and can occur anywhere a site designer has left 
the door open for the inclusion of arbitrary files into PHP scripts, 
experts at K-OTik Security in Montpellier, France, warned.

Santy.C and Santy.E behave so differently from Santy.A that K-OTik is 
renaming the worm PhpInclude.Worm in its advisories, the company said 
yesterday. The worm doesn't exploit the vulnerabilities in phpBB 
targeted by its predecessor, instead aiming for a wider range of common 
programming errors in PHP Web pages. It uses search engines including 
Google, Yahoo and AOL to identify exploitable Web pages written in PHP 
that use the functions include() and require() in an insecure 
manner, K-OTik said.

These functions can be used to embed the contents of a file in a Web 
page. If the site designer used them without sufficient checking of the 
parameters passed to the function, then an attacker could exploit them 
to incorporate an arbitrary file in the Web page, rather than the 
limited range presumably intended by the site designer. From there, 
depending on the configuration of the Web server, the attacker could 
move on to take control of the entire machine, K-OTik warned.

To prevent these attacks, it may be necessary to recode the site to use 
the include() and require() functions in a safe manner.

Eliminating the security flaws exploited by the newer versions of Santy 
involves no new tricks, and is simply a matter of applying long-known 
sound programming principles.

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


[PHP] Passing values from a new window

2004-11-05 Thread Todd Cary
I have a button that creates a new window.  The surfer may enter data in 
the new window, and if he does, when the window is closed by the surfer, 
can the information update fields on the original page - the page/window 
from which the new window was created?

I have seen instances where the surfer can open a new window to get 
email addresses and these addresses appear in the first window.

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


[PHP] Re: Passing values from a new window

2004-11-05 Thread Todd Cary
Is there a place where I can view some examples of using JavaScript?
Todd
Todd Cary wrote:
I have a button that creates a new window.  The surfer may enter data in 
the new window, and if he does, when the window is closed by the surfer, 
can the information update fields on the original page - the page/window 
from which the new window was created?

I have seen instances where the surfer can open a new window to get 
email addresses and these addresses appear in the first window.

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


[PHP] Passing a list in the Header

2004-11-02 Thread Todd Cary
I need to pass a list (preferably an Array) in the header.  Can this be 
done, and if so, what is the best method?

Also, how do I extract the info on the page that receives the info?
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Passing marked rows in a table

2004-11-02 Thread Todd Cary
I create a list of records from a DB and each has a check box.  What is 
the best way to select those that were checked after the form is submitted?

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


Re: [PHP] Passing marked rows in a table

2004-11-02 Thread Todd Cary
[snip]
If the elements all live within the same form, you can add [] to the end
of the name/id attribute, and then all checkboxes with the same name
will be accessible in an array.  So checkboxname[] will show up as
$_POST['checkboxname'] on the receiving end.
[/snip]
Can I do
  $MyArray = $_POST['checkboxname'];
And then access each array element
  for ($i = 0; $i  (count($MyAray)); $i++) echo $MyArray[$i];
Todd
Pablo Gosse wrote:
[snip]
I create a list of records from a DB and each has a check box.  What is 
the best way to select those that were checked after the form is
submitted?
[/snip]

If the elements all live within the same form, you can add [] to the end
of the name/id attribute, and then all checkboxes with the same name
will be accessible in an array.  So checkboxname[] will show up as
$_POST['checkboxname'] on the receiving end.
This is the best way, and most appropriate to this list since it is all
PHP.
HOWEVER, if the checkboxes are all contained in different forms (each
form in a row with its own processing options), then you will need to
assign a common name to each element (I usually call mine
performMultiple), and then using Javascript loop through all elements on
the page, checking for the proper name, and if found then adding the
value to a comma-delimited list, the value of which will be set to a
hidden input field before the form is submitted.
HTH.
Pablo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] With a graphic image, making text transparent

2004-10-12 Thread Todd Cary
I would like to place text on a graphic but vary the transparency of the 
text.  Can this be done with the gd library?

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


[PHP] Creating a new window

2004-09-20 Thread Todd Cary
I am using PHP to create a button on a window so that a new window is 
created when the button is clicked using javaScript.  Is there a way to 
create a new window inline; that is create a window on top of the 
current window without having the surfer press a button?

Here is my current onClick code:
input name=btnView type=button value=View 
onClick=MM_openBrWindow('claim_pdf.php?session_id=1095690357pdf_file=1000481.pdf','','toolbar=no,status=no,scrollbars=no,resizable=yes');nbsp; 
  /td

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


[PHP] Auto escaping an apostrophy...

2004-09-20 Thread Todd Cary
I have noticed that an apostrophy is automatically escaped with a \, 
or at least appears to be if the surfer enters an apostrophy in a text 
field.  Has this always been the case or is there a setting in the 
php.ini file that contols this?

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


Re: [PHP] Auto escaping an apostrophy...

2004-09-20 Thread Todd Cary
Many thanks to all.
Todd
John Legg wrote:
Todd,
From the PHP manual:
magic_quotes_gpc boolean 
Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote),  (double quote), \ (backslash) and NUL's are escaped with a backslash automatically. 

  Note: If the magic_quotes_sybase directive is also ON it will completely override magic_quotes_gpc. Having both directives enabled means only single quotes are escaped as ''. Double quotes, backslashes and NUL's will remain untouched and unescaped. 

See also get_magic_quotes_gpc() 

Rgds
John
---
I have noticed that an apostrophy is automatically escaped with a \, 
or at least appears to be if the surfer enters an apostrophy in a text 
field.  Has this always been the case or is there a setting in the 
php.ini file that contols this?

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


[PHP] Displaying a pdf inline

2004-09-14 Thread Todd Cary
After reading the online documentation, it appears that I should be 
using the following code, however it does not appear to work.  Are there 
some obvious errors?

if ($row) {
  $pdf_file = $row-CLM_IMG_FILE;
  $msg = $pdf_file;
  $SRC_FILE = /tmp/ . $pdf_file;
  $download_size = filesize($SRC_FILE);
  $filename = basename($SRC_FILE);
//print(Filename:  . $filename . br);
//print(SRC_FILE:  . $SRC_FILE . br);
//print(Size:  . $download_size . br);
  header(Content-Type: application/pdf);
  header(Content-Disposition: inline; filename=image.pdf);
  //header(Content-Disposition: attachment; filename=image.pdf);
  header(Content-Length: $download_size);
  header(Connection: close);
  readfile($SRC_FILE);
} else {
  $msg = Cannot find the claim;
}
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Displaying a pdf inline

2004-09-14 Thread Todd Cary
Curt -
Thank you for the quick response.  The file is being sent and the PDF 
reader does try to open it, but it is corrupted.  When I change the 
Disposition to

header(Content-Disposition: attachment; filename=image.pdf)
and save the file, it cannot be opened do to errors within the file. 
Yet, the file can be opened on the server.

Am I missing something simple here?
Todd

Curt Zirzow wrote:
* Thus wrote Todd Cary:
After reading the online documentation, it appears that I should be 
using the following code, however it does not appear to work.  Are there 
some obvious errors?
...
 header(Content-Type: application/pdf);
 header(Content-Disposition: inline; filename=image.pdf);
 //header(Content-Disposition: attachment; filename=image.pdf);
 header(Content-Length: $download_size);
 header(Connection: close);


The problem comes down to how the client is configured to display a
pdf file. IIRC, inline doesn't force the browser to display it
within the browser, it all depends on the content-type, and if a
plugin is suppose to load within the browser at that point.
If you search the archives, your answer may be revealed :)
Curt
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Slideshow using PHP

2004-07-08 Thread Todd Cary
I do have a JavaScript based SlideShow, however, I would like to use 
PHP rather than JavaScript.  Is there a way to loop with PHP and 
display an image without re-displaying the whole page?

Todd
Alex Shi wrote:
Search google for javascript slideshow script. Javascript slideshow need 
an array of image names, this can be done by php and mysql when dynamically
generate the page.

Alex Shi

I would like to have images displayed automatically using PHP with a 
Database and/or an array of images.  Is there any sample code available 
for doing that?

Can that be done with Flash and PHP?
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Slideshow using PHP

2004-07-08 Thread Todd Cary
Matthew -

Part of getting the slideshow to work is making the browser switch to the
next image and well, PHP doesn't really make the browser do anything.

As I was thinking about it before posting this thread, that was my 
impression.  The problem with my javaScript app is the fact that it 
needs to load all of the images.

I am hoping there is some way to load the iamges one-at-a-time; as needed.
Someone told me that there is a way to use Flash and PHP.
Todd
Matthew Sims wrote:
I do have a JavaScript based SlideShow, however, I would like to use
PHP rather than JavaScript.  Is there a way to loop with PHP and
display an image without re-displaying the whole page?
Todd

To get a good slideshow you'll need to use client side instructions, aka
javascript. You're probably not going to get it to work so well using PHP
which is server side instructions.
Part of getting the slideshow to work is making the browser switch to the
next image and well, PHP doesn't really make the browser do anything.
--Matthew Sims
--http://killermookie.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Slideshow using PHP

2004-07-07 Thread Todd Cary
I would like to have images displayed automatically using PHP with a 
Database and/or an array of images.  Is there any sample code available 
for doing that?

Can that be done with Flash and PHP?
Todd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Online HTML editor

2004-06-21 Thread Todd Cary
I want to create an email application in PHP for my client so they can 
produce email text with different fonts and styles just using a browser. 
 Are there any classes that would provide the means to do the editing?

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


[PHP] OnClick handler to show PDF

2004-05-13 Thread Todd Cary
Currently, I have a Link to show a PDF file

? print('Click a href=' . $url . $sfyc_race_schd_send . ' Name=Race 
Schedule Target=_blankhere/a to open the Race Schedule'); ?

I want to replace it with a button and an OnClick()

?
  print('input type=button name = View Schedule OnClick=');
?
I cannot get the syntax correct for the OnClick.  Is this the best way 
to use a button for the task?

Todd

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


Re: [PHP] OnClick handler to show PDF

2004-05-13 Thread Todd Cary
You were close enough...this works:

input type=button value=View Schedule 
onClick=JavaScript:document.location='?php echo ( $url . 
$sfyc_race_schd_send ); ?'

The next challenge is to create a new window and display the file.

Todd

John Nichel wrote:

Todd Cary wrote:

Currently, I have a Link to show a PDF file

? print('Click a href=' . $url . $sfyc_race_schd_send . ' 
Name=Race Schedule Target=_blankhere/a to open the Race 
Schedule'); ?

I want to replace it with a button and an OnClick()

?
  print('input type=button name = View Schedule OnClick=');
?
I cannot get the syntax correct for the OnClick.  Is this the best way 
to use a button for the task?

Todd

Since this is a PHP mailing list, my JavaScript may be a bit off

input type=button name=View Schedule 
onClick=JavaScript:document.location=?php echo ( $url ); ? /

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


[PHP] Making Printer Friendly files

2004-05-13 Thread Todd Cary
I have a news letter produced by PageMaker that is normally put into PDF 
format so the user can download it.  However, I would like to have a 
Printer Friendly version (no graphics).  Is there a PHP program that can 
take an HTML version and remove the graphics or is there a better way 
with pagemaker?

Todd

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


[PHP] Reshuffling an array

2004-05-12 Thread Todd Cary
I do the following:

  $eventList = array();
  $eventList[] = Any;
  $dbh = db_open($host, $user, $password, $database);
  if($dbh) {
$sthdl = db_get_event_data($dbh);
while ($row = mysql_fetch_object($sthdl)) {
  $eventList[] = $row-EV_EVENT;
}
  } else {
$eventList[] = * None found *;
  }
  asort( $eventList );
Now I want to put Any as the first item.  What is the best way to do 
this?  Often the sort puts it as an item down the list.

Todd

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


Re: [PHP] Reshuffling an array

2004-05-12 Thread Todd Cary
Works as advertised.  Made it a sort.

Todd

John W. Holmes wrote:
From: Todd Cary [EMAIL PROTECTED]

I do the following:

  $eventList = array();
  $eventList[] = Any;
  $dbh = db_open($host, $user, $password, $database);
  if($dbh) {
$sthdl = db_get_event_data($dbh);
while ($row = mysql_fetch_object($sthdl)) {
  $eventList[] = $row-EV_EVENT;
}
  } else {
$eventList[] = * None found *;
  }
  asort( $eventList );
Now I want to put Any as the first item.  What is the best way to do
this?  Often the sort puts it as an item down the list.


Remove the line adding 'Any' at the beginning of your code and use
array_unshift() to add it at the end.
   $eventList = array();
   $dbh = db_open($host, $user, $password, $database);
   if($dbh) {
 $sthdl = db_get_event_data($dbh);
 while ($row = mysql_fetch_object($sthdl)) {
   $eventList[] = $row-EV_EVENT;
 }
   } else {
 $eventList[] = * None found *;
   }
   asort( $eventList );
   array_unshift($eventList,'Any');
do you really need to maintain the numeric keys to the array by using
asort() instead of just sort()? If so, this may not work. You may be able to
use array_splice($input, 0, 0, array('Any')) or array_merge().
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


  1   2   3   >