php-general Digest 29 Dec 2004 15:20:44 -0000 Issue 3197

Topics (messages 205282 through 205300):

Re: CMS
        205282 by: Zareef Ahmed

Arrays
        205283 by: GH
        205284 by: John Holmes
        205292 by: Brent Baisley

Re: Environment and Modules
        205285 by: Zareef Ahmed

Re: $HTTP_POST array
        205286 by: Zareef Ahmed

Re: Making includes and requires safe.
        205287 by: Zareef Ahmed

Re: authentication
        205288 by: Zareef Ahmed

wrong value from define
        205289 by: Arthur
        205290 by: Richard Davey
        205298 by: Daniel Schierbeck

Re: help with PEAR and SOAP
        205291 by: Jones, Douglas 1

Re: MySQL Database type
        205293 by: Brent Baisley

Re: cURL and line breaks
        205294 by: Mike Johnson

Re: PEAR DB vs ADODB
        205295 by: Matthew Weier O'Phinney

Re: Destroying session data
        205296 by: Jason Barnett

Re: Interfaces and Access Levels
        205297 by: Jason Barnett

Re: How to enable TTF extension
        205299 by: John Nichel

Which Version To Get?
        205300 by: GH

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
HI Javier,

  You may try (!) pathos which is now available under a new name EXPONENT.
It is based on Smarty template. It is very good at adding   new
exetensions. One of the problem I faced in this CMS is its file
structure. IMO it is best .

visit

http://sourceforge.net/projects/exponent/


zareef ahmed 


On Tue, 28 Dec 2004 16:41:57 +0600, kalinga <[EMAIL PROTECTED]> wrote:
> typo3, it's a good one..
> 
> try it ;-)
> 
> vk.
> 
> On Tue, 28 Dec 2004 11:00:32 +0100, Javier Leyba
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi
> >
> > I'm looking for a good CMS recommendation.
> >
> > I've seen comments in opencms and tested a few (Xaraya was good when I read
> > features but so slow at testing time) but I can't test all and may be other
> > user experience could reduce my test universe.
> >
> > I want a CMS with html code separated from PHP code, fully customizable,
> > easy to implement and fast...
> >
> > Any clue ?
> >
> > Thanks in advance
> >
> > Javier
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> --
> vk.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

--- End Message ---
--- Begin Message ---
Would it be possible in a form fields name to make it an array? 

This way it would be i.e. att[$part_id] 

Now is there a way to iterate through the array when I submit the form
to process it, being that the ID numbers are not going to be
sequential and that there will be some numbers not included?

I.E. the id's would be 1, 5, 6, 7, 20, 43

and how would I refence it? would it be $_POST['att']['[partIDhere}'] ?

Thanks
G

--- End Message ---
--- Begin Message --- GH wrote:
Would it be possible in a form fields name to make it an array?

This way it would be i.e. att[$part_id]

Now is there a way to iterate through the array when I submit the form
to process it, being that the ID numbers are not going to be
sequential and that there will be some numbers not included?

I.E. the id's would be 1, 5, 6, 7, 20, 43

and how would I refence it? would it be $_POST['att']['[partIDhere}'] ?

Did you try that at all?

<input type="text" name="att[1]" value="" />
<input type="text" name="att[5]" value="" />
<input type="text" name="att[9]" value="" />

Then to loop through them:

foreach($_POST['att'] as $part_id => $value)
{ echo "For part id: $part_id you supplied: $value"; }

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- You can absolutely use arrays as form field names. They allow great flexibility. Although you wouldn't use quotes for the array keys.
So your form field name would be something like:
att[keyname]


While in PHP, the same array would look like:
$att['keyname']

Your array "id's" are consider keys since they are not sequential. Just treat them as names for the array entry. There are a number of ways to reference it.
$att = $_POST['att'];
foreach($att as $attkey=>$attval) {
echo $att[$attkey];
echo $attval;
}


Or you could use the array_keys functions to get the keys to the array in it's own array that can be referenced sequentially.
$att = $_POST['att'];
$attkeys = array_keys($att);
echo $att[$attkeys[0]];
echo $att[$attkeys[1]];
etc.



You can even use multidimensional arrays as form field names, which is helpful when you need to keep separate form fields related. Like having multiple phone number/phone description fields:
<input type="text" name="phone[home][desc]" value="Vacation Home" size="10">
<input type="text" name="phone[home][number]" value="123456789" size="10">


<input type="text" name="phone[work][desc]" value="Uptown Office" size="10">
<input type="text" name="phone[work][number]" value="123456789" size="10">



On Dec 28, 2004, at 10:52 PM, GH wrote:

Would it be possible in a form fields name to make it an array?

This way it would be i.e. att[$part_id]

Now is there a way to iterate through the array when I submit the form
to process it, being that the ID numbers are not going to be
sequential and that there will be some numbers not included?

I.E. the id's would be 1, 5, 6, 7, 20, 43

and how would I refence it? would it be $_POST['att']['[partIDhere}'] ?

Thanks
G

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


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

--- End Message ---
--- Begin Message ---
HI,
Install instruction file contains all information you need to enable
some of the exetension.
HINT ::  dlls folder

zareef ahmed 

On Tue, 28 Dec 2004 18:26:52 +0100, Steven Spierenburg
<[EMAIL PROTECTED]> wrote:
> Hi There,
> 
> I recently installed PHP and have two things going on that I can't seem to
> rectify or solve.
> If I may use the collective knowledge of PHP users/developers on these
> groups I would be grateful.
> 
> First some info on my setup:
> OS : Windows 2000 Server
> Webserver :IIS6
> PHP : 4.3.10 (extracted zip version from php.net into folder "c:\php4")
> phpinfo() page : www.jikade.com/test.php
> 
> The problems:
> 
> 1) I want PHP to look for my php.ini file in the php folder (c:\php4) but it
> refuses to do so. Setting PHPRC doesn't help and this setting actualy won't
> show in the summary of phpinfo() in the environment section. I changed the
> PATH environment variable to include "c:\php4" but that doesn't help either.
> Putting the php.ini in the "c:\winnt" folder does work and then I configure
> PHP through this file. Otherwise it won't load *any* php.ini file and use
> defaults, or so it seems.
> What I want to accomplish is that PHP finds and uses the php.ini file that
> resides in the "c:\php4" folder
> 
> 2) Some modules won't load, php_mcrypt.dll for one. I tried setting the
> "extension_dir" (extension_dir = "c:\php4\extensions") but that doesn't
> help. Copying the dll to the "c:\winnt\system32" folder doesn't work either.
> Some modules do load however (php_df.dll loads fine from the same location),
> it's just some modules that don't/won't. Examples are: php_mcrypt.dll,
> php_mhash.dll and php_xmlrpc.dll.
> What I want to accomplish here is that modules can load (obviously) :-)
> Any help on these matters will be appreciated immensly!
> 
> ps: I used a MailExpire temporary email address to be able to post on this
> newsgroup. Don't know if that's a faux-pas around here but I tend to be
> realy carefull with my real email addresses on newsgroups due to spam
> problems. If people say it's ok to use my real email address then I'll use
> that one in future posts. Sorry for any inconvenience caused.
> 
> --
> 
> Greetings,
> Steven Spierenburg
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

--- End Message ---
--- Begin Message ---
Hi Kalinga,

    it is not recomended to use $HTTP_POST_VAR array. Use $_POST and 
it have global scope. In PHP5, we have a special directive by which we
can disable $HTTP_*_VAR. currently it defaults to enabled. But who
says in future versions of PHP it default set to disabled. then your
code will not run. So Use $_POST, $_GET etc. instead of using old long
$HTTP_*_* style.


zareef ahmed 


On Mon, 27 Dec 2004 18:31:21 +0300, Burhan Khalid <[EMAIL PROTECTED]> wrote:
> kalinga wrote:
> > Dear all,
> > Is it possible to pass the entire $HTTP_POST array to a function of a class
> > as a variable?
> 
> Use $_POST -- its automatically in scope of every function (you don't
> need to pass it).
> 
> You can pass any array to a function.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

--- End Message ---
--- Begin Message ---
I agree with John Holmes that  it is targeted at PHP. It is really
wonderfull thing to know that google, yahoo can detect my php code on
my site. These news item written by total uninformed (or Illinformed )
persons.

zareef ahmed 



-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

--- End Message ---
--- Begin Message ---
Hi  Ali,
 Visit 

http://zareef.users.phpclasses.org/browse/class/21.html

You will find a lot of code.

zareef ahmed 


On Tue, 28 Dec 2004 13:12:14 +1030, Ali <[EMAIL PROTECTED]> wrote:
> Hi everyone...
> can anyone lead me to a good tutorial on authentication...it wud be good if
> i can get a one in connection with a database..
> thnks
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
Zareef Ahmed :: A PHP Developer in India ( Delhi )
Homepage :: http://www.zareef.net

--- End Message ---
--- Begin Message ---
Hi,

in the following code, i want to get a constant value from config.php. I
don't receive the value, that is defined, but the name of the constant.
I tested the defines in config.php by echoing all defines, and it was
allright, so i'm quite confused why it doesn't work here.

That's my piece of code (which is in a class in a file which is in the same
dir as config.php):

function reg($name, $pw, $ally, $act) {
  include('config.php');
  echo(DB_SERV_NAME . '<br>');
  $dbp = mysql_connect(DB_SERV_NAME, DB_USR_NAME, DB_PW);
  if(!$dbp) die ("MySQL-Fehler");

Thats my error message:

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL Server Host
'DB_SERV_NAME' (11001) in
C:\apachefriends\xampp\htdocs\alliance\script\cl.member.php on line 34
MySQL-Fehler

Normally, i should get 'localhost'.
Anyone who can help me?

--- End Message ---
--- Begin Message ---
Hello Arthur,

Wednesday, December 29, 2004, 12:37:30 PM, you wrote:

A> That's my piece of code (which is in a class in a file which is in the same
A> dir as config.php):

A> function reg($name, $pw, $ally, $act) {
A>   include('config.php');
A>   echo(DB_SERV_NAME . '<br>');
A>   $dbp = mysql_connect(DB_SERV_NAME, DB_USR_NAME, DB_PW);
A>   if(!$dbp) die ("MySQL-Fehler");

Show us the define statements? The code above is fine, assuming that
it could find config.php of course (swap it for a require to get a
fatal error).

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

--- End Message ---
--- Begin Message --- Arthur wrote:
Hi,

in the following code, i want to get a constant value from config.php. I
don't receive the value, that is defined, but the name of the constant.
I tested the defines in config.php by echoing all defines, and it was
allright, so i'm quite confused why it doesn't work here.

That's my piece of code (which is in a class in a file which is in the same
dir as config.php):

function reg($name, $pw, $ally, $act) {
  include('config.php');
  echo(DB_SERV_NAME . '<br>');
  $dbp = mysql_connect(DB_SERV_NAME, DB_USR_NAME, DB_PW);
  if(!$dbp) die ("MySQL-Fehler");

Thats my error message:

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL Server Host
'DB_SERV_NAME' (11001) in
C:\apachefriends\xampp\htdocs\alliance\script\cl.member.php on line 34
MySQL-Fehler

Normally, i should get 'localhost'.
Anyone who can help me?
place this at the top of the file: error_reporting(E_ALL);

Either you don't define the consatnts properly or the include file doesn't exist.
--- End Message ---
--- Begin Message ---
Greg,

The code that you gave seems like it would work...only I'm not sure how I can 
reformat the result before it gets sent back to the soap client.  For instance, 
I have a function that simply builds a string containing XML and returns that.  
I wrap this function in a class.  The constructor for this class creates an 
instance of SOAP_Server (from the PEAR SOAP package).  This object is passed 
$this (the class I created to wrap my function) and the service method is 
called from the SOAP_Server class.  After I call the service method, the 
processing is taken care of and the SOAP package calls my function with the 
correct parameters and returns that to the client.  The only place that I would 
really have control over the value getting returned is inside my function.  I 
don't think the conversion of the chars is happening here.  Does PHP 
automatically convert special HTML chars?  If so, is there a way to stop it 
from doing this?  

In my other message, I wasn't really asking for people who have used something 
other than SOAP for returning XML but I was asking if anyone has used an 
implementation of SOAP for PHP other than the one in the PEAR library.  I know 
that there is nusoap and that php has some soap functions that can be compiled 
in, perhaps one of these implementations is better?


The only thing else I can think of is that the PEAR SOAP libraries are doing 
the conversion on the data before it sends it to the client.  Perhaps there is 
a way to tell it to stop this behavior.

Thanks.


-------------------------
Doug Jones
Co-Op Web Developer


-----Original Message-----
From: Greg Beaver [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 29, 2004 1:37 AM
To: Jones, Douglas 1
Subject: Re: help with PEAR and SOAP [offlist]


Douglas 1 Jones wrote:
> Hello,
> 
> I have the SOAP PEAR package set up correctly to the point where I can send a 
> request and get a response.  However, my web service is designed to return 
> XML back to the caller.  When I do this, all of the tags have their "<" and 
> ">" converted to &lt; and &gt;.  I have spent much time searching the web for 
> an answer to this, but have come up empty handed.  If anyone knows how to 
> solve this that would be great.  Also, if anyone has experience writing a web 
> service in PHP that returns XML I am open to suggestions of approaches other 
> than using the PEAR SOAP package.

Before digging too deeply, be sure you try doing a reverse 
html_specialchars() on the result and see if that doesn't fix your problem.

Something like:
<?php
$tr = get_html_translation_table(HTML_SPECIALCHARS);
$result = strtr($result, $tr);
?>

As for alternatives to SOAP, perhaps an offlist discussion would work 
better as it doesn't really have anything to do with PHP until you start 
implementing it :).  What kind of information does the web service provide?

Greg

--- End Message ---
--- Begin Message --- It depends on what you are trying to do. If you need full text searching, MyISAM is what you should be using. If you are doing transactions, InnoDB is what you probably want to use. If you write a lot to the database, InnoDB may be better, if you read a lot MyISAM may be better. But that depends on the situation.

Was that any help at all?


On Dec 28, 2004, at 4:57 PM, The Disguised Jedi wrote:

Which type of engine would y'all recommend for a user/customer and
session data storage database?  I'm currently using MyISAM, but I just
was curious to see if you guys could tell me if you know of a better
one, or tell me what you use.

TIA,

--
The Disguised Jedi
[EMAIL PROTECTED]

PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
This message is Certified Virus Free

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


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

--- End Message ---
--- Begin Message ---
From: Andrew Kreps [mailto:[EMAIL PROTECTED] 

> Are you talking about the variable you're POSTing?  Does it make a
> difference if you urlencode the form var?  Have you tried debugging
> from the server end to see what cURL is passing over?  I use cURL
> quite a bit, although I've never tried passing muti-line form data.

Yeah. Sorry, I wasn't as clear as I could have been in my original post.

What I was referring to is one or more values passed to
CURLOPT_POSTFIELDS. Oddly enough, if I urlencode it, it ends up
urlencoded all the way through to the phpBB database.

I didn't get to do much debugging as I was in a hurry. I just wanted to
toss this one out there and see if it was a known issue I'd missed in
Google. I doubted it, but figured it was worth a shot.


-- 
Mike Johnson             Smarter Living, Inc.
Web Developer            www.smarterliving.com
[EMAIL PROTECTED]   (617) 886-5539

--- End Message ---
--- Begin Message ---
* [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> > Haven't done much with either of them, besides reading docs, but I'd
> > lean towards ADODB for its exception handling(with php5), if you
> > need error handling.
> >
> > Having that said, I haven't really a clue what I'm talking about in
> > this regard, so I'll be listening in with interest.
>
> I'm assuming PEAR error handling will come out with exception handling?

Yes -- it's planned for the 1.4.0 release. You can access it now if you
use an development version of PEAR.

> Besides , i am using thepear syntax in adodb , i wonder if it will
> still work with the components ie DataGrid andDB_DataObjects. These
> tools will be highly useful, I cant see much pear stuff compatible
> withADODB

It might be more useful to check on the pear-general or pear-dev mailing
lists to find out if DataGrid and/or DB_DataObjects can use ADODB. My
guess is that they don't, but a developer would know for certain.

There's not much benefit or point in PEAR developers developing for a
non-PEAR library -- the idea is to create a set of high quality
libraries following a common set of coding standards and practices;
compatibility with outside libraries doesn't make sense if those
libraries do not follow the same guidelines.

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

--- End Message ---
--- Begin Message ---
this might be coming into play:
http://us4.php.net/session

session.gc_maxlifetime  integer

    session.gc_maxlifetime specifies the number of seconds after which
data will be seen as 'garbage' and cleaned up.


Okay, lemme see if I understand how it works. Even if it "sees" it as garbage, it will not destroy it until the session has ended? or will destroy when that time is reached? So can I set session.gc_maxlifetime to be a low number (e.g., 10 seconds) and it will still behave appropriately? Currently, it's set to the default - 1440.

~Philip

There are two parts to it:

session.gc_lifetime = 10
(any session data which is older than this is considered "garbage" by PHP's garbage collector)


session.gc_probability = 1
session.gc_divisor = 1
(these two combine to calculate the probability that PHP will check for and clean up "garbage" when it starts up)


So if you *always* wanted to destroy every session after 10 seconds you can use the settings above. But just realize that this will prevent users from storing anything long term on the server. Not only that but you'll have overhead on every PHP script because you'll end up destroying session files on every startup.

Perhaps cron / scheduled tasks is a better answer for you? Just create a script that destroys all files in the session directory and run it as often as you like.


-- Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--- End Message ---
--- Begin Message --- Gerard Samuel wrote:
I would like bar::do_something_internal() to have an access level of *private*
But this would fail, as the interface can only have *public* methods.
Is there a way to get bar::do_something_internal() to be private?
Or am I SOL, and it has be public?
Thanks


interface foo
{
    function do_something_internal();
}

class bar implements foo
{
   private function do_something_internal()
   {
       // I would like this to be private
   }
}

Interfaces, at least as far as PHP is concerned, is kind of like the "minimum standard" for an API. An interface is a contract with the outside world only... no promises on how the work gets done be it one big function or several internal functions to help it.


I simply don't understand why you want to require a class to have a method that will never be accessed outside of the class. Perhaps using abstract classes / protected methods will work for your purpose?
http://php.net/manual/en/language.oop5.abstract.php




--
Teach a person to fish...

Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html
PHP Manual: http://php.net/manual/
php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

--- End Message ---
--- Begin Message --- Viet Hung wrote:
Hi all,

I'm testing an PHP application, this application
requires TTF extension.
Please help me a way to configure PHP enabling TTF
extension.
I have to download & install which application/module
to configure successfully.
I'm using Linux OS (FC3).
Any help will be appreciated highly!
Thanks in advance.


Hung Le

You're wanting to use true type fonts, right?

http://us4.php.net/manual/en/ref.image.php

--
John C. Nichel
�berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Greetings....
     I am about to launch on the mission to install PHP4 on my Laptop
running Win XP Pro SP2.

When I go to the download page of the PHP.net website I am presented
with the following for windows

PHP 4.3.10

Windows Binaries
All Windows binaries can be used on Windows 98/Me and on Windows
NT/2000/XP/2003.

PHP 4.3.10 zip package [7,405Kb] - 15 Dec 2004
(CGI binary plus server API versions for Apache, Apache2
(experimental), ISAPI, NSAPI, Servlet and Pi3Web. MySQL support
built-in, many extensions included, packaged as zip)
md5: 0bb30525512ea686abf22c8fe61e1bb6
 
PHP 4.3.10 installer [1,052Kb] - 15 Dec 2004
(CGI only, MySQL support built-in, packaged as Windows installer to
install and configure PHP, and automatically configure IIS, PWS and
Xitami, with manual configuration for other servers. N.B. no external
extensions included)
md5: 6d60129d738e16ea0b69f3fd6646bf3a 


Since there is a difference of 6.4Mbytes what extensions/features are
not included? Also, after installing the Installer version, can I add
in the extra features? If so, how?

Thanks

--- End Message ---

Reply via email to