php-general Digest 8 Dec 2004 17:13:22 -0000 Issue 3158

Topics (messages 203709 through 203738):

Re: eBay API?
        203709 by: daniel.electroteque.org

how to display the content step by step
        203710 by: yangshiqi
        203727 by: Brent Baisley

Desparate
        203711 by: Peter Lauri

Re: ini_set doesn't work
        203712 by: Mukasa Assey Alfred

OT Re: Desparate
        203713 by: David Robley
        203726 by: Peter Lauri

i'm beginner and i couldn't solve the problem
        203714 by: Mecnun
        203716 by: Sagar C Nannapaneni
        203723 by: Ford, Mike
        203737 by: Chris W. Parker

mail with attachment
        203715 by: Dre
        203730 by: Manuel Lemos
        203733 by: Dre

Re: php editor or php IDE for linux with autocompletion
        203717 by: partners.symbulos.com

Re: (Quanta) php editor or php IDE for linux with autocompletion
        203718 by: partners.symbulos.com
        203719 by: Jason Wong
        203720 by: partners.symbulos.com
        203721 by: Raditha Dissanayake
        203729 by: Jason Wong
        203731 by: partners.symbulos.com

Pear libraries
        203722 by: eric LUDINART

Re: PEAR performance/overhead
        203724 by: Joshua Beall
        203736 by: Ryan King

Re: PHP Security
        203725 by: Joshua Beall

Re: Drawing checkboxes
        203728 by: Brent Baisley

Sessions problem
        203732 by: Dre
        203734 by: Raditha Dissanayake

PHP extensions with EasyPHP 1-7
        203735 by: Michel Gangloff
        203738 by: Richard Lynch

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 ---
never tried it, looks intense though

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

> Hi,
>
> Is anyone use eBay API?
> or REST only?
>
> What i want to do is searching items from eBay and store those data in
> my own database.
>
> Anybody did this before?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Just like many applications, I want to display my main content table a
sector after a sector, may be row ater row.

 

Coz the html may wait until the whole table be downloaded then to show it,
but I see some application like the Web calendar
http://www.k5n.us/webcalendar.php?topic=Demo

 

Anyone here know about this?

 

 

 

Best wishes,

 

Yangshiqi

 

 

 

 


--- End Message ---
--- Begin Message --- As far as I know, there is no reliable way to force a browser to display data before the whole page is downloaded. A browser won't display information contained in an open tag, like a table. Once the tag is closed, the browser may display part of the data, but this depends on the browser. IE won't display anything until it gets a certain amount of data, regardless of open tags. I forget how much, maybe 32K. So if your page is 31K, there is no way to get IE to display part of the page.

The link you specified displays all at once for me, maybe because I'm on a T1, maybe because at the moment I'm using Firefox on a Mac. Perhaps if I had a slow connection or a slow computer, I could watch the screen draw.

On Dec 8, 2004, at 12:17 AM, yangshiqi wrote:

Just like many applications, I want to display my main content table a
sector after a sector, may be row ater row.



Coz the html may wait until the whole table be downloaded then to show it,
but I see some application like the Web calendar
http://www.k5n.us/webcalendar.php?topic=Demo




Anyone here know about this?







Best wishes,



Yangshiqi










--
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 ---
Best groupmember,

I just moved to Bangkok and have a huge problem. My ISP does not provide a
news-server. For the news.php.net there is no problem, but I can not locate
any other discussion groups.

Is there any open news-servers that can be used instead of ISP-connected
news-server? Ex: news.opennewsserver.com

I know that this is not supposed to be posted in this group, not relevant to
the subject, sorry about that. But I have tried to find a solution for two
weeks now.

--
- Best Of Times
/Peter Lauri

--- End Message ---
--- Begin Message ---
Try ini_set(memory_limit, "-1");

regards
Assey

On Wed, 8 Dec 2004, Joerg P wrote:

> hello,
>
> what do I have to change in php.ini, to allow thr
> ini_set("memory_limit",-1);
> command?
>
> It doesn't work in my script...
>
> regards
> Joerg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Wed, 8 Dec 2004 16:31, Peter Lauri wrote:

> Best groupmember,
> 
> I just moved to Bangkok and have a huge problem. My ISP does not provide a
> news-server. For the news.php.net there is no problem, but I can not
> locate any other discussion groups.
> 
> Is there any open news-servers that can be used instead of ISP-connected
> news-server? Ex: news.opennewsserver.com
> 
> I know that this is not supposed to be posted in this group, not relevant
> to the subject, sorry about that. But I have tried to find a solution for
> two weeks now.


Try something from here:
http://directory.google.com/Top/Computers/Usenet/Public_News_Servers/

Google is your friend

-- 
David Robley

Thesaurus: ancient reptile with an excellent vocabulary.

--- End Message ---
--- Begin Message ---
I have looked there, did not find what I wanted :) Know of any open MySQL
newsgroup?

Java newsgroup?

/Peter


"David Robley" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> On Wed, 8 Dec 2004 16:31, Peter Lauri wrote:
>
> > Best groupmember,
> >
> > I just moved to Bangkok and have a huge problem. My ISP does not provide
a
> > news-server. For the news.php.net there is no problem, but I can not
> > locate any other discussion groups.
> >
> > Is there any open news-servers that can be used instead of ISP-connected
> > news-server? Ex: news.opennewsserver.com
> >
> > I know that this is not supposed to be posted in this group, not
relevant
> > to the subject, sorry about that. But I have tried to find a solution
for
> > two weeks now.
>
>
> Try something from here:
> http://directory.google.com/Top/Computers/Usenet/Public_News_Servers/
>
> Google is your friend
>
> --
> David Robley
>
> Thesaurus: ancient reptile with an excellent vocabulary.

--- End Message ---
--- Begin Message ---
I'm usin php, apache and mysql on my computer. I have run some scripts. so i'm 
sure i installed them correctly. One of my script don't run properly, also it 
doesnt give error. 
I'm trying to send some data to my database by using a form. The database can 
get the auto incremented number but doesn't get whatever I type into the text 
box in the form. My code is below:
------------------------------------------------------
<?php
//open the connection
$conn = mysql_connect("localhost", "selimatmaca", "BETULBETUL");
//pick the database to use
mysql_select_db("testDB", $conn);
//create the sql statement
$sql = "INSERT INTO testTable values ('', '$_POST[testField]')";
//execute
if (mysql_query($sql,$conn)){ 
echo "Record Added";
} else{ 
echo "Somethin went wrong";
}
?>
--------------------------------------------------------------
 
 
mysql> select * from testTable;
+----+--------------+
| id | testField    |
+----+--------------+
|  1 | some value   |
|  2 | some value   |
|  3 |                    |
|  4 |                    |
|  5 |                    |
|  6 |                    |
|  7 |                    |
|  8 |                    |
|  9 |  [testField]    |
| 10 | [testField]    |
| 11 |                    |
| 12 |                    |
| 13 |                    |
| 14 |                    |
+----+--------------+
14 rows in set (0.00 sec)
 
 
The database dont show the "testField" data, but it shows the numbers.
Also this is my html form:
 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>An Insert Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<FORM ACTION="insert.php" METHOD=POST>
<P> Type something in:<br>
<input type=text name="testField" size=30>
<input type="submit" name="submit" value="Insert Record">
</P>
</FORM>
</body>
</html>

 
 There is another script for which I dont use a html form. I send the data 
directly from the script and it works fine. Codes are here: 
 
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$conn = mysql_connect("localhost", "selimatmaca", "BETULBETUL");
mysql_select_db("testDB", $conn);
$sql = "INSERT INTO testTable values ('', 'some value')";
if (mysql_query($sql, $conn)) 
 {
 echo "record added";
 } 
 else 
 {
 echo "Something went wrong";
 }
?>
</body>
</html>

 
so, please tell me where I'm doing wrong. Thanks a lot.

                
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Find what you need with new enhanced search. Learn more.

--- End Message ---
--- Begin Message ---
$sql = "INSERT INTO testTable values ('', '$_POST[testField]')";

should be

$var = $_POST["testField"];
$sql = "INSERT INTO testTable values ('', '$var')";

/sagar

----- Original Message -----
From: "Mecnun" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 08, 2004 4:23 PM
Subject: [PHP] i'm beginner and i couldn't solve the problem


> I'm usin php, apache and mysql on my computer. I have run some scripts. so
i'm sure i installed them correctly. One of my script don't run properly,
also it doesnt give error.
> I'm trying to send some data to my database by using a form. The database
can get the auto incremented number but doesn't get whatever I type into the
text box in the form. My code is below:
> ------------------------------------------------------
> <?php
> file://open the connection
> $conn = mysql_connect("localhost", "selimatmaca", "BETULBETUL");
> file://pick the database to use
> mysql_select_db("testDB", $conn);
> file://create the sql statement
> $sql = "INSERT INTO testTable values ('', '$_POST[testField]')";
> file://execute
> if
sql_query($sql,$conn)){ 
> echo "Record Added";
> } else{ 
> echo "Somethin went wrong";
> }
> ?>
> --------------------------------------------------------------
>  
>  
> mysql> select * from testTable;
> +----+--------------+
> | id | testField    |
> +----+--------------+
> |  1 | some value   |
> |  2 | some value   |
> |  3 |                    |
> |  4 |                    |
> |  5 |                    |
> |  6 |                    |
> |  7 |                    |
> |  8 |                    |
> |  9 |  [testField]    |
> | 10 | [testField]    |
> | 11 |                    |
> | 12 |                    |
> | 13 |                    |
> | 14 |                    |
> +----+--------------+
> 14 rows in set (0.00 sec)
>  
>  
> The database dont show the "testField" data, but it shows the numbers.
> Also this is my html form:
>  
>  
>  
> <!DOCTYPE HTML PUBLIC "-//W3C/
/DTD HTML 4.01 Transitional//EN">
> <html>
> <head>
> <title>An Insert Form</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <body>
> <FORM ACTION="insert.php" METHOD=POST>
> <P> Type something in:<br>
> <input type=text name="testField" size=30>
> <input type="submit" name="submit" value="Insert Record">
> </P>
> </FORM>
> </body>
> </html>
>
>
>  There is another script for which I dont use a html form. I send the data
directly from the script and it works fine. Codes are here:
>
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> </head>
> <body>
> <?php
> $conn = mysql_connect("localhost", "selimatmaca", "BETULBETUL");
> mysql_select_db("testDB", $conn);
> $sql = "INSERT INTO testTable values ('', 'some value')";
> if (mysql_query($sql, $conn))
>  {
>  echo "record added";
>  }
>  else
>  {
>  echo "Something went wrong";
>  }
> ?>
> </body>
> </html>
>
>
> so, please tell me where I'm doing wrong. Thanks a lot.
>
>
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Mail - Find what you need with new enhanced search. Learn more.

--- End Message ---
--- Begin Message ---
To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm



On 08 December 2004 11:29, Sagar C Nannapaneni wrote:

> $sql = "INSERT INTO testTable values ('', '$_POST[testField]')";
> 
> should be
> 
> $var = $_POST["testField"];
> $sql = "INSERT INTO testTable values ('', '$var')";

Nope -- the original is functionally identical to your suggested correction.

Cheers!

Mike

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

--- End Message ---
--- Begin Message ---
Ford, Mike <mailto:[EMAIL PROTECTED]>
    on Wednesday, December 08, 2004 5:18 AM said:

>> $sql = "INSERT INTO testTable values ('', '$_POST[testField]')";
>> 
>> should be
>> 
>> $var = $_POST["testField"];
>> $sql = "INSERT INTO testTable values ('', '$var')";
> 
> Nope -- the original is functionally identical to your suggested
> correction. 

Hmm... I thought arrays don't work correctly within a string unless they
are wrapped with { and }?

<?php

  $sql = "INSERT INTO ... ('', '{$_POST['testField']}')";

?>

Also you should always wrap the index name in single quotes (or maybe
double quotes work also.)



Chris.

p.s. It's a bad idea to directly insert data from outside your script
into your database. Check the recent PHP Security thread for more info.

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

I'm trying to send a mail with attachment, using mail() fucntion ..
the mail is sent with the attached file, but when I open my mail box to
check the mail I sent using my script, I find the normal text contents and
the attachment displayed as text too !!!
ex. if I attached a document, it will not be just attached when I open the
mail, it will be displayed as text.
I'm using multipart MIME

thanks in advance



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

Dre wrote:
I'm trying to send a mail with attachment, using mail() fucntion ..
the mail is sent with the attached file, but when I open my mail box to
check the mail I sent using my script, I find the normal text contents and
the attachment displayed as text too !!!
ex. if I attached a document, it will not be just attached when I open the
mail, it will be displayed as text.
I'm using multipart MIME

You are probably doing something wrong but without seeing the source of your code, it is hard to tell what is the problem.


Anyway, you may want to try this class that is capable of composing and sending messages with as many attachments as you want and works properly:

http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Thanks Manuel, I will check the class

and here is the code of the mail sending script
//======================================================
<?php
  $att_name = $_POST['att'];
  echo $att_name;
  $att_size = filesize($att_name);
  $handle= fopen($att_name, "r");
  $file = fread($handle, $att_size);

  $file = chunk_split(base64_encode($file));
  $num = md5(time());

  $hdr = "From:"."[EMAIL PROTECTED]";
  $hdr .= "MIME-Version: 1.0\r\n";
  $hdr .= "Content-Type: multipart/mixed; ";
  $hdr .= "Content-Transfer-Encoding: 7bit\r\n\n";
  $hdr .= "boundary=$num\r\n";
  $hdr .= "--$num\r\n";

  $hdr .= "Content-Type: text/plain\r\n";
  $hdr .= "Content-Transfer-Encoding: 8bit\r\n\n";
  $hdr .= $_POST['content']."\r\n";
  $hdr .= "--$num\n";

  $hdr .= "Content-Type: $att_type; ";
  $hdr .= "name=\"".$_POST['att']."\"\r\n";
  $hdr .= "Content-Transfer-Encoding: base64\r\n";
  $hdr .= "Content-Disposition: attachment; ";
  $hdr .= "filename=\"".$_POST['att']."\"\r\n\n";
  $hdr .= "$file\r\n";
  $hdr .= "--$num--";

  if(mail( "[EMAIL PROTECTED]", $_POST['re'], $_POST['content'], $hdr))
  {echo "done";}
  else
  {echo "shit";}
  fclose($handle);
?>

//======================================================


"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> Dre wrote:
> > I'm trying to send a mail with attachment, using mail() fucntion ..
> > the mail is sent with the attached file, but when I open my mail box to
> > check the mail I sent using my script, I find the normal text contents
and
> > the attachment displayed as text too !!!
> > ex. if I attached a document, it will not be just attached when I open
the
> > mail, it will be displayed as text.
> > I'm using multipart MIME
>
> You are probably doing something wrong but without seeing the source of
> your code, it is hard to tell what is the problem.
>
> Anyway, you may want to try this class that is capable of composing and
> sending messages with as many attachments as you want and works properly:
>
> http://www.phpclasses.org/mimemessage
>
>
> -- 
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html

--- End Message ---
--- Begin Message ---
Steve Brown wrote:
> Eclipse: http://www.eclipse.org/
> PHPEclipse: http://www.phpeclipse.de/

What about Eclipse? Did anyone make it work?

How does it compare to Kdevelop?

I tried to install it, unsuccesfully, on Mandrake 10.1 CE. Apparently, one
library is missing (but the library does not exist).

--- End Message ---
--- Begin Message ---
Jason Wong wrote:
> What version of quanta are you using? Autocompletion was available quite a
> while ago.

I am using Quanta 3.2.3, and php auto completion does not work. How do you
activate it?

 

--- End Message ---
--- Begin Message ---
On Wednesday 08 December 2004 19:49, [EMAIL PROTECTED] wrote:
> Jason Wong wrote:
> > What version of quanta are you using? Autocompletion was available quite
> > a while ago.
>
> I am using Quanta 3.2.3, and php auto completion does not work. How do you
> activate it?

I think I may have misunderstood what you mean by auto-completion. What Quanta 
does is auto-complete words that you *already* have in the document. It 
doesn't (AFAIK) do php-specific auto-completion.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
  I tripped over a hole that was sticking up out of the ground.
*/

--- End Message ---
--- Begin Message ---
Jason Wong wrote:
> I think I may have misunderstood what you mean by auto-completion. What
> Quanta does is auto-complete words that you *already* have in the
> document. 

Not really. With HTML / XHTML Quanta does auto complete words, tags,
properties, attributes which are in the DTD. Or am I wrong?

--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] wrote:

Jason Wong wrote:


I think I may have misunderstood what you mean by auto-completion. What
Quanta does is auto-complete words that you *already* have in the
document.



Not really. With HTML / XHTML Quanta does auto complete words, tags,
properties, attributes which are in the DTD. Or am I wrong?


Ask in the quanta mailing list and someone will tell you.



--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message ---
On Wednesday 08 December 2004 20:09, [EMAIL PROTECTED] wrote:
> Jason Wong wrote:
> > I think I may have misunderstood what you mean by auto-completion. What
> > Quanta does is auto-complete words that you *already* have in the
> > document.
>
> Not really. With HTML / XHTML Quanta does auto complete words, tags,
> properties, attributes which are in the DTD. Or am I wrong?

So are you looking to auto-complete (X)HTML tags or are you looking to 
auto-complete PHP keywords/functions? What is your question?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Death is only a state of mind.

Only it doesn't leave you much time to think about anything else.
*/

--- End Message ---
--- Begin Message ---
Jason Wong wrote:
> So are you looking to auto-complete (X)HTML tags or are you looking to
> auto-complete PHP keywords/functions? What is your question?
> 


We need to auto-complete PHP words and functions INDIPENDENTLY of the fact
that they are present or not in the page. For instance if one developer
digits

fun 

inside a php page, and between <?php ?> tags, we expect the auto-completion
tool to propose 

function.

If the developer writes 

mysql_f

inside a php page, and between <?php ?> tags, we expect the auto-completion
tool to propose
 
mysql_fetch_row()
mysql_free_result()
and so on

and she can choose from the list, and so on, son on.

This is the kind of auto-completion we are looking for, exactly as in the
case of Quanta and HTML / XHTML.

--- End Message ---
--- Begin Message ---
hi,
I search a package with all available libraries PEAR in on pack ...
for manual update ...

thanks.


eric

--- End Message ---
--- Begin Message ---
"David Dickson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>I was told that PEAR has too much overhead to be considered for a large 
>scale site. Does any one feel the same? Is this an outrageous comment? I 
>would like to hear comments from people who are using PEAR, or people who 
>have considered PEAR but decided not to use it and your reasons.

I wound up taking a hybrid approach, rolling my own DB abstraction layer 
that was more efficient than PEAR DB (and less full featured, as well), but 
suited our needs nicely.  By doing this I was able to reduce each page's 
memory footprint by about 50%, and execution time by about 40%.  I still use 
other components of PEAR, however, and I think it is a great resource.

Anyone who dismisses PEAR out of hand, without giving it a serious look, is 
insane.

> The packages I am particularly interested in are HTML_QuickForm and DB.

You'll have to write some tests and do some benchmarks to decide what the 
best answer is. 

--- End Message ---
--- Begin Message ---
On Dec 7, 2004, at 12:34 PM, David Dickson wrote:

I was told that PEAR has too much overhead to be considered for a large scale site. Does any one feel the same? Is this an outrageous comment? I would like to hear comments from people who are using PEAR, or people who have considered PEAR but decided not to use it and your reasons.

The packages I am particularly interested in are HTML_QuickForm and DB.

I think that when most people say PEAR has big overhead they're referring to the parsing work that must be done. Under a plain PHP implementation it can be quite expensive to re-parse those two packages for every request. However, if you are concerned with performance on your site you should be using a compiler so that this does not occur. A php compiler will easily improve your site's performance by an order of magnitude.


-ryan

--
http://theryanking.com/blog

--- End Message ---
--- Begin Message ---
"Greg Donald" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> The other day a post came across one of those mailing lists discussing
> PHP security.  One of the posters was describing how insecure PHP's
> file upload functionality is and went on to explain a simple method of
> attaching exploit code to the end of a jpeg or other image format,
> then proceeding in uploading the image to the target site that
> accepted image uploads.  The code would be executed as PHP in spite of
> the file type detection.

Chris already gave a good response to all this, but I am curious myself - 
can this mystery antagonist provide an example exploit?  What he is 
suggesting seems impossible, unless for some strange reason you have set 
Apache to execute .jpg files at PHP code.  In which case the security hole 
is the admin who set things up like that, not PHP!

Can you also provide a link to the relevant message in the mailing list 
archive?  I would like to read this myself.

  -Josh 

--- End Message ---
--- Begin Message --- If I have to pass name/value pairs to a function or anything else, I always use an multidimensional associative array (that's a mouthful). Using a string delimiter is too unreliable and probably slower.
Something like this:


$checkBoxList[] = array('name'=>'Coffee','value'=>'Coffee','checked'=>'Y');
$checkBoxList[] = array('name'=>'Coffee Pot','value'=>'Coffee Pot','checked'=>'N');
$checkBoxList[] = array('name'=>'Tea Pot','value'=>'Tea Pot','checked'=>'Y');
draw_checkbox_menu($checkBoxList);


function draw_checkbox_menu($checkboxes,$parameters=false) {
foreach($checkboxes as $box) {
$field .= '<input type="checkbox" name="'.$box['name'].'" value="'.$box['value'].'"'.($box['checked']=='Y'?' CHECKED':'').'><br />';
}
return $field;
}


A one line function to display your checkboxes. Of course, you need extra code to accommodate your parameters. I have a similar function where the parameters are how many rows or columns to create for the checkboxes. So I could create a checkbox area with 3 columns and x rows or 4 rows and x columns just by passing a different parameter.

On Dec 7, 2004, at 3:10 PM, Mike wrote:



Hello,

I am having a hard time figuring this one out, maybe someone here (with
fresh eyes) can offer a suggestion?

Here is the function...

// Draw Checkbox Menu
function draw_checkbox_menu($name, $values, $default = false, $parameters =
false) {




    for ($i=0; $i<sizeof($values); $i++) {
        $field .= '<input type="checkbox" name="'.$name.'" value="' .
$values[$i]['id'] . '"';
        if(strstr($default, $values[$i]['id'])) {
            $field .= ' CHECKED';
        }
        $field .= '> ' . $values[$i]['text'] . '<br>
        ';
    }

    return $field;
}

This function is passed the name of the checkbox list($name), the values
that are available($values = array) along with the ones that should be
checked ($default). Parameters too , but not important.



The problem is this. The Values are formatted like this...

value1|value2|value3...etc...

I use the strstr() function to check against the $default so I can check it
if so.


Well it works great..BUT, lets say the product has a category of "Coffee
Pots", but the one of the values available is "Coffee".


In this case both "Coffee" AND "Coffee Pots" get checked when only "Coffee
Pots" should.


What can I do to this function eliminate this?

Thanks




+--------------------------------------------+ Mike Yrabedra [EMAIL PROTECTED] Your Mac Intelligence Resource +--------------------------------------------+ W: http://www.macagent.com/ E: [EMAIL PROTECTED]

--
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,

I need to make sessions work in my local machine .. I'm using Apache 2.0.49
on WINDOWS XP PRO.

my php.ini sessions section is

session.save_handler = files

session.save_path = "C:\php4\tmp"

session.use_cookies = 1

session.name = PHPSESSID

session.auto_start = 1

session.cookie_lifetime = 0

session.cookie_path = "/"

session.cookie_domain = "localhost"

session.serialize_handler = php

session.gc_probability = 1
session.gc_divisor     = 100

session.gc_maxlifetime = 1440

session.bug_compat_42 = 1
session.bug_compat_warn = 1


I tried everything and sessions still not working, and I don't know what is
worng .. help will be appreciated.
Thanks in advance

--- End Message ---
--- Begin Message ---
Dre wrote:

Hi,

I need to make sessions work in my local machine .. I'm using Apache 2.0.49
on WINDOWS XP PRO.

my php.ini sessions section is

session.save_handler = files

session.save_path = "C:\php4\tmp"


A common problem is that this path is not writable by the webserver please check for that.

I tried everything and sessions still not working, and I don't know what is
worng .. help will be appreciated.


Any error messages? or is it just that your data is not being saved? have you tried to print_r() or var_dump() to confirm this?

Thanks in advance





--
Raditha Dissanayake.
------------------------------------------------------------------
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/ | Drag and Drop Upload

--- End Message ---
--- Begin Message ---
I try to use some PHP extensions with EasyPHP 1.7 on Windows XP

I have checked the path for extensions in the "php.ini" file ; it is correct
But when I want do add some extensions , some work well , and others don't (they are in the same directory )



I get the following message :

Unable to load dynamic library C:\Program Files\EasyPHP1-7\php\extensions\php_curl.dll Could not find specified module

Same problem for php_domxml.dll  ,  php_ldap.dll

Thanks
--- End Message ---
--- Begin Message ---
Michel Gangloff wrote:
> I try to use some PHP extensions with EasyPHP 1.7 on Windows XP
>
> I have checked the path for extensions in the "php.ini" file ; it is
> correct
> But when I want do add some extensions , some work well , and others
> don't (they are in the same directory )
>
>
> I get the following message :
>
> Unable to load dynamic library C:\Program
> Files\EasyPHP1-7\php\extensions\php_curl.dll  Could not find specified
> module
>
> Same problem for php_domxml.dll  ,  php_ldap.dll

What are the extensions that DO work?

Are you sure they are not just built-in to PHP already?

Can you use http://php.net/dl on those extensions instead of the php.ini
settings?  That would help you to confirm/deny that you really are loading
the extensions you think you are loading.

I seem to recall that Apache and php.ini did not like directory names with
spaces in them -- Try moving your extensions directory to C:\php (you'll
need to create that directory) and re-start Apache.

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---

Reply via email to