Re: [PHP] UML

2004-07-30 Thread Colin Kettenacker
[EMAIL PROTECTED] [EMAIL PROTECTED] on 7/30/04 12:14 PM wrote:

 Now that PHP is OOP with 5.0 is there a UML tool dedicated to PHP?
 

Well it is not dedicated to PHP, but the latest release of ArgoUML can
output to PHP 5.0 (haven't tried it myself yet).

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net 

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread Colin Kettenacker
Hi Walter,

You may want to look into PEAR's config package. It does pretty much all you
have listed here and a lot more. I just started looking into it today. I
haven't looked closely at the code so I don't know how efficiently it
handles everything it does but it may give you some ideas. As far as I tell
it can handle Generic Config files, .ini files, XML config files and more.

http://pear.php.net/package/Config
http://pear.php.net/manual/en/package.configuration.php

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net


jsWalter [EMAIL PROTECTED] on 10/22/03 1:10 AM wrote:

 I need to read (write comes later) from a config file that we used to handle
 manually.
 
 I'm getting lazy, so I'm writing a web interface for this.
 
 What I have does this...
 - open a given file
 - dump entire file into a string
 - explode string into an array at the EOL marker
 - walk down this new array
 - decide if there is anything in current element
 - decide if current line is a comment
 - split line at '=' into 2 variables
 - add new key and value from these variables back into array
 - kill original array element
 
 There must be a better way to do this.
 
 All this seems a bit over kill to me.
 
 Does anyone have any ideas on this?
 
 Thanks
 
 Walter
 
 This is what I have...
 
 ?php
 
 $config = $list . '/home/walter/vmd/config';
 
 // Open the file
 $handle = fopen ($config, r);
 
 // Read entire file into var
 $content = fread($handle, filesize($config));
 
 // convert var into array and explode file via line break
 $content = split(\r\n, $content);
 
 // close file
 fclose($handle);
 
 // Loop through file contents array
 foreach ($content as $i = $value)
 {
 // If we have any data in this line
 if (! empty ($value))
 {
 // If this line is not a comment
 if ( $value{0} != '#')
 {
 list($a, $b) = split(=, $value);
 $content[$a] = $b;
 }
 
 // kill original array element
 unset($content[$i]);
 }
 }
 
 // show me what I have
 echo 'pre';
 echo print_r($content);
 echo '/pre';
 
 ?
 
 # Sample config file data, just 2 lines from the file...
 #
 # The Personal Name of the list, used in outgoing headers.
 # If empty, default is the same as the list's username.
 # if explicitly `false', then it is redefined empty.
 LIST_NAME=RMT Working Group
 
 # The address of the list's admin or owner.
 # if explicitly `false', then it is redefined empty.
 [EMAIL PROTECTED]
 
 ...

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



[PHP] A web site interface preference tutorial

2003-10-20 Thread Colin Kettenacker
Hey gang,

A couple of years ago (back when I first started to learn PHP) I came up
with some code that allows users to choose a interface style and color when
viewing a web site. I want to post the code as a tutorial for others because
I was never able to find a good resource on the subject.

To see it in action you can visit my woefully antiquated and never completed
site at http://kettenacker.com/home/webprefs/ (I am currently building my
company's new site where I will eventually post this tutorial in my resource
section).

Anyway I am interested in hearing any feedback/improvements/optimization
tips on this section of the code (This code checks if the user has chosen a
style and color preference for viewing the web site, if not, it will set it
to a default style and color preference):

-

// Please feel free to use and abuse this code as you wish.
// If you find it at all useful perhaps you may wish to add the
// following credit to your code (but you are not obliged to):
// Original code provided by Colin Kettenacker http://www.cube-o.com/
// Code modified by (Add your name here if you have modified this code)

session_start();

// If the session variable 'prefAa' has been assigned then...
if (isset($_SESSION['prefsAa'])) {

// Extract the interface style and color information from it
$intStyleS = $_SESSION['prefsAa']['style'];
$intColorS = $_SESSION['prefsAa']['color'];

// If the session variable 'prefAa' has *not* been assigned yet then...
} else {

// If there are cookies present on the client's machine with
// the website's preference information then...
if (isset($_COOKIE['prefsAa'])) {

// Extract the interface style and color information from it
$intStyleS = $_COOKIE['prefsAa']['style'];
$intColorS = $_COOKIE['prefsAa']['color'];

// If there is *not* a cookie present on the client's machine with
// the website's preference information then...
} else {

// Set up a default interface style and color
$intStyleS = 'l'; // 'c' for (c)lean, 'l' for (l)ines
$intColorS = 'y'; // 'y' for gre(y), 'n' for gree(n), 'e' for blu(e)

// Attempt to create 2 cookies with the default interface style and
// color information
setcookie('prefsAa[style]', $intStyleS, time()+3600*24*7*52*10,
'/');
setcookie('prefsAa[color]', $intColorS, time()+3600*24*7*52*10,
'/');

} // end if

// Set the session variable 'prefAa'
$prefsAa = array( 'style' = $intStyleS,
  'color' = $intColorS
);
$_SESSION['prefsAa'] = $prefsAa;

} // end if

-

Any feedback/tips/hints/improvements to the code is appreciated. I will
hopefully have my company web site http://www.cube-o.com/ finished within
the next month (Nov) with the full tutorial on it.

TIA,

ck

-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net 

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



Re: [PHP] A web site interface preference tutorial

2003-10-20 Thread Colin Kettenacker
Chris W. Parker [EMAIL PROTECTED] on 10/20/03 12:03 PM wrote:

 Colin Kettenacker mailto:[EMAIL PROTECTED]
 on Monday, October 20, 2003 11:06 AM said:
 
 Any feedback/tips/hints/improvements to the code is appreciated. I
 will hopefully have my company web site http://www.cube-o.com/
 finished within the next month (Nov) with the full tutorial on it.
 
 You should put a temp page up there.
 
 Chris.
 

Ahhh... nobody knows about the site yet (well till now I guess) :)

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net 

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



Re: [PHP] need help w a for loop

2003-10-20 Thread Colin Kettenacker
Hi Redmond,

A couple of issues I see here. First of all you are resetting the
$categories_array to an empty array for each iteration in the loop. You must
move it out of the loop. Secondly, you have enclosed the entire $_REQUEST
superglobal variable in quotes so it is seeing it as a string rather than a
superglobal.

Try this:

$categories_array = array();
for($j=0; $j  $categories_count; $j++){
$tempval=str_categories.$j;
array_push($categories_array,$_REQUEST[$tempval]);
}

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net

Redmond Militante [EMAIL PROTECTED] on 10/20/03 2:15 PM wrote:

 hi all
 
 i'm in need of pointers on how to get the following for loop working correctly
 
 for($j=0; $j  $categories_count; $j++){
 $categories_array = array();
 $tempval=str_categories.$j;
 array_push($categories_array,'$_REQUEST['.$tempval.']');
 }
 
 it looks like it's appending the string '$_REQUEST['str_categories0']' to the
 array $categories_array, instead of the actual value of
 $_REQUEST['str_categories0'] - the actual value is being passed correctly to
 the page because i can echo it out...
 
 any advice would be appreciated
 
 thanks
 redmond 

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



Re: [PHP] passing form data using $_SESSION

2003-10-20 Thread Colin Kettenacker
Hi Chris,

I don't think there is anything wrong with this. The only gotcha that I can
come up with is now that you are using session variables rather than get
variables, you will no longer be able to bookmark the state of that page,
I think?

What I mean is if your URL reads:

index.php?e_name=mynamee_comp=mycompany

This can be bookmarked by the user and they can return to that page with the
code presumably parsing the get variables. With the session variables, I
don't think the user will be able to bookmark the page and return to it on a
later date (after the session has expired) and have the session variables
parsed correctly. I am not sure of this.

However if you don't require the page to be bookmarked in it's latest state
then no big deal. If you do you can use cookies or record the state
sever-side to work around this.

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net


Chris W. Parker [EMAIL PROTECTED] on 10/20/03 4:31 PM wrote:

 Hiya.
 
 The way I do my forms is I create a form page and a corresponding
 processing page. I don't like to post forms to themself so I always make
 a processing page that header(Location: ...)'s back to the original
 page.
 
 Normally I create a long string that get's posted back to the original
 page via the querystring. For example:
 
 if(the name is blank)
 {
 $errors = e_name=Name cannot be blank;
 }
 
 if(the company is blank)
 {
 $errors .= e_comp=Company cannot be blank;
 }
 
 $location = originalpage.php?$errors;
 
 So then I redirect with the $location variable.
 
 But instead of passing it back through the querystring, what about
 assigning the values to the $_SESSION array and simply checking for the
 existence of those values on the original form?
 
 I think it will work fine (and even better than posting everything) but
 I'm wondering if there's something I'm not considering that makes this
 Not A Good Idea(tm)?
 
 
 Thanks,
 Chris.
 
 
 --
 Don't like reformatting your Outlook replies? Now there's relief!
 http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] run exe file

2003-10-20 Thread Colin Kettenacker
 Dear all,
 
 Is there anyway that I can put .exe file on the web, and allow visitors
 only to run it, not download it.
 
 Regards,
 DT
 
 
 *Checks list address*  Yep, php list.  In a word, no.

Well how about, in a word, it depends. Okay that's 2 words:)

Check out:

http://www.php.net/manual/en/language.operators.execution.php
http://www.php.net/manual/en/function.shell-exec.php
http://www.php.net/manual/en/function.exec.php

It may be what you are looking for.

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net 

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



Re: [PHP] run exe file

2003-10-20 Thread Colin Kettenacker
John Nichel [EMAIL PROTECTED] on 10/20/03 9:42 PM wrote:

 Those are all fine and dandy if you want to run the file (*.exe or
 whatever) on the same machine that php is running on. However, to run
 it on the remote machine, it IS going to be downloaded.

That's why I said it depends:)

 Even though the 
 OP was not clear about where the program was to be run, I would have to
 guess that he/she is refering to the remote (client) machine.  So, no,
 it can't be done.

If your assumption is correct then yes, your answer is correct. But no harm
in presenting both options as the original question was unclear.

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net 

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



Re: [PHP] Choosing a CMS?

2003-10-19 Thread Colin Kettenacker
I'd recommend Justin's route as well, if you have the time. In fact that is
how I learned to program in PHP by programming my own template and CMS
system (it still has a ways to go though).

If you don't have the time search the list archives as this question comes
up often. You'll get a lot of good feed back there.

ck
-- 
Cheap Domain Registration | Web Hosting | Email Packages | + more
Fantastic prices -- Even better service.
http://www.hosttohost.net

Justin French [EMAIL PROTECTED] on 10/19/03 2:14 AM wrote:

 On Sunday, October 19, 2003, at 02:16  PM, Joel Konkle-Parker wrote:
 
 I'm looking for an open source PHP/MySQL CMS that I can use as the
 backend to my website.
 
 If you've got the time  skills, I'd actually recommend creating your
 own -- building my own CMS rapidly enhanced the way I work, streamlined
 my code, built up my knowledge and problem solving techniques, etc etc.
 
snip /

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



[PHP] cURL and relative paths

2003-09-04 Thread Colin Kettenacker
I'm coming up against a brick wall on this one.

Can one cURL in a web page while automatically resolving all the relative
file paths? I've fooled around with regexp to resolve this issue, but it is
not a real stable solution.

I tried the archives and googled, but there appears to be no solution to
this. 

Any advice?

ck

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



Re: [PHP] Why use XML?

2003-02-10 Thread Colin Kettenacker
 It seems like a
 great tool, but I am trying to figure out why I would actually use it? All
 it does is seperate content and data, albeit on the client

Not necessarily only on the client, but on the server side as well.

 It would just add
 another layer of content/data seperation that would have to processed on the
 other end. 

And that is the heart of the matter. That additional layer as you have so
correctly put it allows you to take the data structure you have defined in
your XML document and port it into any other system. Let's say that you
define a data structure in XML that is being parsed in PHP... maybe at some
point you need it to work in a PERL application as well. By conventional
means if you needed to update your data specifications you'd need to update
it and integrate that into both your PHP and PERL applications. This means
you are duplicating the work effort for each platform you support. If you
have an XML spec defined for your data structure (and content) then all you
need to do is update the XML document and it *should* work seamlessly in
both applications. I say should work seamlessly, as you *may* need to write
additional API's in your platforms to support the changes you've made in
your XML spec. That really depends on what changes you make to you XML spec.

As you have already touched on, there is an additional overhead, as one
would have to write an API layer that will parse the XML for each platform
application that they support. The nice thing is that there is a building
base of XML specifications for a number of data structures, as well as a
growing base of existing API's that will parse those specs... so if you are
lucky you may not need to build the XML structure and API's to run your
spec.

ck


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




Re: [PHP] output buffering problem

2002-11-16 Thread Colin Kettenacker
webmaster [EMAIL PROTECTED] on 11/15/02 3:47 PM wrote:

 I'm trying to enable output buffering to speed up the load time of some
 of our php web pages.  I've consulted the manual and enabled the
 following:

The manual lacks description for this topic. Take a look at this article at
Developer Shed, it got me up and running within 10 minutes.

http://www.devshed.com/Server_Side/PHP/OutputBuffering/page1.html

HTH,

ck



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




[PHP] Can you read a parsing PHP page's results

2002-11-12 Thread Colin Kettenacker
Is there anyway at all of reading the results of a parsing PHP page from
within that same PHP page itself. In other words can you read the HTML code
it's going to create. I know that you can use regular expressions to parse
the HTML page manually swapping variable content as you would with most any
template system... I guess I am asking if you can get the results of an echo
statement. If I had to write it in pseudo code it would be this:

$htmlCode = echo $myPHPcontent;

I find it highly unlikely but I thought I'd toss it out to those who know.

TIA,

ck

PS: I am a newbie who genuinely for the past hour has searched the archives,
the manual and tried writing several scripts to make this work with no
success. Forgive me if I missed something obvious.


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