php-general Digest 18 Aug 2003 21:22:03 -0000 Issue 2244

Topics (messages 159901 through 159951):

Re: Drawing tables using PDFlib
        159901 by: Director General: NEFACOMP

Fatal error: [] operator not supported for strings
        159902 by: Daniel
        159903 by: John W. Holmes

Removing empty array values.
        159904 by: zavaboy
        159906 by: Tom Rogers
        159908 by: David Otton
        159927 by: Johnson, Kirk
        159928 by: Curt Zirzow

FX.php question
        159905 by: Gremillion

Re: If you ever had a Vic20
        159907 by: Jay Blanchard

Re: Discussion: do you consider null a value or strictly  a type?
        159909 by: Jay Blanchard

Re: "Form Feeds" within a HTML table
        159910 by: Jay Blanchard

INFORMIX (PLEASE)
        159911 by: Davi José Faria Costa

Re: [php] explode that :) !
        159912 by: Ford, Mike               [LSS]

Re: problem with sessions - IE working after session.use_tr ans_sid enabled.
        159913 by: Ford, Mike               [LSS]

Re: Any IMAP portal system
        159914 by: Mark

NestedSet view only of active nodes
        159915 by: Fitzner Michael

using objects
        159916 by: Uros
        159917 by: Uros

PHP 4.3.3RC4 Released
        159918 by: Ilia Alshanetsky

Problem with the post variables.
        159919 by: Klaus Kaiser Apolinário
        159923 by: Hidayet Dogan
        159926 by: John W. Holmes
        159931 by: Wouter van Vliet
        159935 by: Chris Shiflett
        159936 by: Wouter van Vliet

Re:RE: [PHP] problem with   fsockopen  ............
        159920 by: fongming

.htaccess & an unsupportive ISP
        159921 by: Terry Thompson

getting value of item in list box.
        159922 by: Tim Winters
        159924 by: John W. Holmes

Re: PHP/JavaScript/HTML
        159925 by: Mauricio

XML Parser misbehaves with &
        159929 by: Jeff Bearer
        159932 by: Justin Farnsworth
        159941 by: Jeff Bearer

Problems with post (Again)
        159930 by: Klaus Kaiser Apolinário
        159934 by: Chris Shiflett

Re: Have I over done this?
        159933 by: Chris W. Parker

$GLOBAL question
        159937 by: Robin Kopetzky
        159938 by: Greg Beaver
        159939 by: Robin Kopetzky
        159940 by: Jonathan Pitcher

Q: How to get the value of a checkbox of which name without '[]'?
        159942 by: Dallas Thunder
        159943 by: Greg Beaver
        159944 by: John W. Holmes
        159946 by: Frode
        159948 by: John W. Holmes

need help with cookies
        159945 by: Dan Anderson

Re: READ RECEIPTS [WAS: $GLOBAL question]
        159947 by: Michael A Smith
        159949 by: Chris W. Parker
        159950 by: Dan Anderson
        159951 by: Robert Cummings

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 ---
__________________________________
NZEYIMANA Emery Fabrice
NEFA Computing Services, Inc.
P.O. Box 5078 Kigali
Office Phone: +250-51 11 06
Office Fax: +250-50 15 19
Mobile: +250-08517768
Email: [EMAIL PROTECTED]
http://www.nefacomp.net/

--- End Message ---
--- Begin Message ---
hi, how do i solve this error?

Fatal error: [] operator not supported for strings
in /var/www/html/p.../magazin/cos.php on line
13

line 13 is this line:

$_SESSION["id_produs"][]=$_POST["id_produs"];

no error when i run in local host , when i upload
in server (with PHP 4.2.2) only got this error.

first time click is fine, but when i click the
product once again, i got tat fatal error....how
can i solve it?? pls advice. thanks.





--- End Message ---
--- Begin Message --- Daniel wrote:

hi, how do i solve this error?

Fatal error: [] operator not supported for strings
in /var/www/html/p.../magazin/cos.php on line
13

line 13 is this line:

$_SESSION["id_produs"][]=$_POST["id_produs"];

no error when i run in local host , when i upload
in server (with PHP 4.2.2) only got this error.

first time click is fine, but when i click the
product once again, i got tat fatal error....how
can i solve it?? pls advice. thanks.

Sounds like you've already assigned a value to $_SESSION['id_produs'] and are now trying to turn it into an array.


$_SESSION['id_produs'] = 'string value';
$_SESSION['id_produs'][] = 'some other value';

Check your code...

--
---John Holmes...

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

PHP|Architect: A magazine for PHP Professionals – www.phparch.com





--- End Message ---
--- Begin Message ---
How do I remove empty array values?

-- 

- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com



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

Monday, August 18, 2003, 10:03:25 PM, you wrote:
z> How do I remove empty array values?

z> -- 

z> - Zavaboy
z> [EMAIL PROTECTED]
z> www.zavaboy.com


In a loop with unset()

foreach($array as $key=>$val){
  if(empty($val) unset($array[$key]);
}

-- 
regards,
Tom


--- End Message ---
--- Begin Message ---
On Mon, 18 Aug 2003 08:03:25 -0400, you wrote:

>How do I remove empty array values?

That could mean a lot of things. I'm going to assume you have a simple
indexed array and want to remove any entries where array[index] == FALSE,
and reindex the array.

The most elegant way is to copy all the values you want to keep to a new
array.

$a = array(FALSE, 2, 3, FALSE, 5, FALSE, 7, FALSE, FALSE, FALSE);
$b = array();
for ($i = 0; $i < sizeof ($a); $i++)
{
    if ($a[$i] !== FALSE)
    {
        $b[] = $a[$i];
    }
}
$a = $b;
print_r ($a);

If you don't want to reindex the array, you could use unset()

$a = array(FALSE, 2, 3, FALSE, 5, FALSE, 7, FALSE, FALSE, FALSE);
for ($i = 0; $i < sizeof ($a); $i++)
{
    if ($a[$i] === FALSE)
    {
        unset ($a[$i]);
    }
}
print_r ($a);


--- End Message ---
--- Begin Message ---
> On Mon, 18 Aug 2003 08:03:25 -0400, you wrote:
> 
> >How do I remove empty array values?

This will remove the empty values and re-index the array so there are no
"holes".

$new_array = array_values($old_array);

Kirk

--- End Message ---
--- Begin Message ---
* Thus wrote Johnson, Kirk ([EMAIL PROTECTED]):
> > On Mon, 18 Aug 2003 08:03:25 -0400, you wrote:
> > 
> > >How do I remove empty array values?
> 
> This will remove the empty values and re-index the array so there are no
> "holes".
> 
> $new_array = array_values($old_array);

I wouldn't suggest this, it removes all your index's (renaming them
to integers) plus it doesn't remove empty values.

$array = array ("size" => "XL", "color" => "gold", 'blah'=>'');
print_r(array_values ($array));

results:
Array
(
    [0] => XL
    [1] => gold
    [2] => 
)



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

--- End Message ---
--- Begin Message ---

I am working with FX.php to interface with a Filemaker database. I can add or edit db entries with a straight list of parameters, but it fails with a dynamically generated list of parameters here with a for loop, but the behavior is the same with foreach.

Any suggestions would be appreciated.

Randall Gremillion


$Add = new FX($serverIP); $Add->SetDBData("Account_Reports.fp5", "All"); $Add->AddDBParam('-recid', '3'); $Add->AddDBParam('week1.txt', 'tescddddxzt'); $Add->AddDBParam('week2.txt', 'tesxdzct'); $Add->AddDBParam('week3.txt', 'sds'); $Add->AddDBParam('week4.txt', 'tezxdscst'); $Updated = $Add->FMEdit();


if (count($updateEntries)>0) {
for ($i=0; $i<count($updateEntries); $i++) {
$Add = new FX($serverIP);
$Add->SetDBData("Account_Reports.fp5", "All");
$boo = $updateEntries[$i][0];
$Add->AddDBParam('-recid', $boo);
for ($j=0; $j<count($updateEntries[$i][$boo]); $j++) {
$Add->AddDBParam($updateEntries[$i][$boo][$j][0], $updateEntries[$i][$boo][$j][1]);
}
$Updated = $Add->FMEdit();
}
}






--- End Message ---
--- Begin Message ---
[snip]
:) Tried that:
[/snip]

Let's be more verbose and see what happens....

if(!($myconnection = mysql_pconnect($server,$user,$pass))){
        print("Failed to connect to database!\n");
        exit();
        }
if(!mysql_select_db($db,$myconnection)){
        print("Failed to select database!\n");
        exit();
        }

$query = "select StudentId from" . $table . "where StudentID = '" .
$StudentID . "' ";
if(!($news = mysql_query($query, $myconnection))){
    print("ERROR! " . mysql_error() . "\n");
    exit();
}

$howmany = mysql_num_rows($news);
echo "$howmany \n";

if ($howmany == 1){
    include ("/the/full/path/to/html/access_error.htm");
} else {
    include ("/the/full/path/to/html/registration.htm");
}

It is my guess that your query is failing, so $news is not a valid
resource. Anytime you do a query you should also do a mysql_error()
statement so that a better clue might be printed out.

--- End Message ---
--- Begin Message ---
[snip]
I also think, in discussing NULLs, that we hit a limit of language - we 
have to refer to this "not knowness" as something. Thus a variable set
to 
NULL is not like an empty bucket, more like a bucket with potential, but
if 
you examine it reveals not " " 's, or 0's, but a benign vacuum.
[/schnip]

NULL indicates a state of nothingness no matter how you slice it.
However it does appear as if PHP assigns a value to it, such as it is.
'' is a string value for nothingness, 0 is a number value for
nothingness (which brings up the question...do negative numbers indicate
something is less than nothing?).

--- End Message ---
--- Begin Message ---
[snip]

        I am creating a "report" that the user can download and it is a
HTML table.  Is there a way to put Page Breaks within the report so if
the user prints it, it will page break a predefined places?
         
        [/snip]
         
        Yes...it is called a Cascading Style Sheet (CSS). you can
research this at http://www.w3c.org 
         
        Have a pleasant day!
         
        P.S. Please set your e-mail program to plain text as many on the
list reject formatted e-mails which will reduce your chances of
receiving answers. 


--- End Message ---
--- Begin Message ---
Hello Everybody, 
I wait that somebody can help me, therefore already I depleted my possibilities. 
I need to develop a site in PHP with access to the Data base Informix. 
The such of the data base alone functions with NTFS (W2k, WNT). 
I installed the W2K Advanced Server in my house... and installed INFORMIX IDS 7.31. 
Now the problems start. 
 
IN THE INFORMIX 
- It does not obtain to initiate a ISM. service. (Informix Storage Manager). 
I do not know if this influences in some thing. 
 
- When time to create a new DATABASE... it is in the "RUNNING..." message and stops....
 Now it becomes a big problem! What´s happening? 
 
- Good... for creating database I was not obtaining success... but.. in databases that 
already 
they were created I obtained to make select, etc.. (this in the DBACCESS). 
So..I asked myself: "If I to obtain to connect to this database and to create a table 
inside already the created database
, could help me".. Correct? Theoretically yes. however in the time that I go to create 
database comes the message of the "RUNNING..."
and again.. freezee in this message.
 
IN THE PHP 
- Exactly that the bank does not make nothing. I tried to make the connection for the 
PHP. 
We have 2 ways: 
a) Functions IFX of php I take off the commentary of line EXTENSIONS in the PHP.ini 
where I meet DLL PHP_IFX.DLL. 
The DLL is exactly in the way that I passed, however gets an error (unable you load 
dynamic library) 
Piece o cake ah? 
Obs. I also have client in the INFORMIX installed certinho in mine máquinha. 
 
b) ODBC In the time that I thought about these solutions I had the certainty that my 
problems would go to finish. 
I was missed again..(smiles)
 i have create the ODBC correct and such. I called the function connection to the ODBC 
passing the DSN, USER, PASSWORD. 
And i got an error message. 
Warning: Error SQL: [ Informix][Odbc Informix Driver]Unable you load translation DLL, 
SQL state IM009 in SQLConnect in 
d:\inetpub\wwwroot\teste.php on line 3 
Now... my possibilities if had depleted... 
I do not know more what to make this to function... 
Somebody please, help me. 
 
My environment is the following one: 
- COMPUTER K6-2 500 
- HD 10GB, MEM RAM 64 MB 
- WINDOWS 2000 ADVANCED SERVER 
- INFORMIX NT 7.31 
 
Thanks!
 
Davi Costa

--- End Message ---
--- Begin Message ---
On 17 August 2003 08:34, Tom Rogers wrote:

> Hi,
> 
> Sunday, August 17, 2003, 12:58:23 PM, you wrote:
> > $P1OC1Q1 = "1¶some text or some comment";
> 
> > echo "<tr><td>Your score is: </td><td>";
> $score=split($P1OC1Q1,"¶"); echo $score[0]."</td></tr>\n";
> 
> > Do I have to go through all that to get score[0] ?
> 
> > John
> 
> 
> if the number is always first and an integer:
> 
> echo "<tr><td>Your score is:
> </td><td>".intval($P1OC1Q1)."</td></tr>\n";

Or  (int)$P1OC1Q1

Or  $P1OC1Q1+0

Cheers!

Mike

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

--- End Message ---
--- Begin Message ---
On 17 August 2003 12:38, anders thoresson wrote:

> Hi,
> 
>  I've had some problems with Internet Explorer not working on the
> site I'm building at the moment. At my local system it worked, but
> not on my ISP. After comparing the session settings, only
> use_trans_sid differed: enabled at my local system, disabled at
> remote. 
> 
>  Before I changed anything IE worked only when accessing the site at
> my local host, while Opera managed to access it both local and from
> my ISP. After enabling session.use_trans_sid in my .htaccess on my
> ISP, Internet Explorer can be used even there.
> 
>  Ok. I've solved my problem, but don't really understand how
> session.use_trans_sid made the difference?

Just a wild guess -- but has your IE got cookies blocked, whilst Opera is accepting 
them?

Cheers!

Mike

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

--- End Message ---
--- Begin Message ---
http://www.horde.org

--- Dasmeet <[EMAIL PROTECTED]> wrote:
> Hi! Is there any PHP Portal system (scripts) that have IMAP/SMTP,
> calendar, notebook and other utilities build in to it alongwith
> other 
> general portal utilities? Any information would be of great help.
> Thanks
> Dasmeet
> 
> 
> --
> Domainwala.com
> Domain Names from $7.99 at http://www.domainwala.com
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=====
Mark Weinstock
[EMAIL PROTECTED]
***************************************
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***************************************

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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

I plan to use the Pear DB_NestedSets Package for a CMS System. The structure of the Cms Site navigation should be readed from the NestedSet Tree, but only the nodes which are active. If a certain Node is inactive, then should the node and its subtree not be shown.
My Problem: I found nothing how to implement this in my application.


bye Mike Fitzner
--- End Message ---
--- Begin Message ---
Hello,

I'm developing web aplication and I have some questions how to use object
to get what  I want.

I have init.php file wher I prepare everything (DB,Auth....) so I have
several objects created.

Then I have index.php which gets all requests and load requested modules.
This modules have to use DB,  Auth, Smarty ......

init.php <

$db = new DB.....
$auth = new Auth....
$tpl = new Smarty...
------------------------
index.php <


$mod = loadModule('mod1');
$mod->getData().....

function loadModule($mod) {
   require $mod.'.php';
   $m =& new $mod;
   return $m
}
------------------------
mod1.php <

Class mod1 {
 // some property

 function getData() {
     // here I want to use $db or $auth
     // right now I have only solution
     // to use global $db
 }

}

I hope this code explains what my needs. What is the best way. Or am I
doing all wrong. Maybe some other ideas. What about global.

I don't like to use $GLOBALS, because I want to use those object like in
pear documentation, so without some strange coding, because this modules
will be developed from public. I also tried to pass those objects with
reference into Class when it was generated. But then I have to use
$this->db etc.

I search for this on the web but I couldn't find any good answers or
projects.

-- 
Best regards,
 Uros


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

I forgot to add.

>From this modules I want use same objects. So not generating new everytime
I load new module. If I change something in class mod1, this has to change
globaly, so mod2 must se the diference.


Monday, August 18, 2003, 3:41:02 PM, you wrote:

U> Hello,

U> I'm developing web aplication and I have some questions how to use object
U> to get what  I want.

U> I have init.php file wher I prepare everything (DB,Auth....) so I have
U> several objects created.

U> Then I have index.php which gets all requests and load requested modules.
U> This modules have to use DB,  Auth, Smarty ......

U> init.php <

U> $db = new DB.....
U> $auth = new Auth....
U> $tpl = new Smarty...
U> ------------------------
U> index.php <


U> $mod = loadModule('mod1');
$mod->>getData().....

U> function loadModule($mod) {
U>    require $mod.'.php';
U>    $m =& new $mod;
U>    return $m
U> }
U> ------------------------
U> mod1.php <

U> Class mod1 {
U>  // some property

U>  function getData() {
U>      // here I want to use $db or $auth
U>      // right now I have only solution
U>      // to use global $db
U>  }

U> }

U> I hope this code explains what my needs. What is the best way. Or am I
U> doing all wrong. Maybe some other ideas. What about global.

U> I don't like to use $GLOBALS, because I want to use those object like in
U> pear documentation, so without some strange coding, because this modules
U> will be developed from public. I also tried to pass those objects with
U> reference into Class when it was generated. But then I have to use
$this->>db etc.

U> I search for this on the web but I couldn't find any good answers or
U> projects.


--- End Message ---
--- Begin Message ---
RC3 did not prove as stable as I hoped it would be, so here we are 20+ bug 
fixes later with RC4. It is my sincere hope that RC4 will be the last RC 
before we can proceed with the final. Please test this release as much as 
possible, ideally you won't find any new bugs.

Once again I would like to ask that all developers refrain from making commits 
to the 4_3 tree until 4.3.3 final is released, unless a patch addresses a 
critical issue. Critical issues are defined as the following:
1) Security Fixes
2) Fixes for bugs introduced in 4.3.3X releases
3) Fixes for bugs that break backwards compatibility with older versions.

Ilia


--- End Message ---
--- Begin Message ---
Guys I have a problem here.
I'm using PHP 4.3.2 and httpd 1.3.28.
Look my exemple.
I have a page whith a Form method post, and I submit this page to teste2.php, but I 
dont can request de data from the text box...


#######################
This is the test page

<html>
<body>
<form action="teste2.php" method="post" enctype="multipart/form-data">
<input type="text" name="texto">
<input type="submit" value="ok">
</form>
</body>
</html>

#####################
Teste2.php

<?php
$string = $_POST['texto'];
echo "Var em post: ".$string."<br>";
echo "Var em get: ".$_GET['texto']."<br>";


//phpinfo();
?>
############################################

Some one can help me...???

Klaus Kaiser Apolinário
Curitiba online

--- End Message ---
--- Begin Message ---
Check your register_globals directive in php.ini file.

If its value is "Off", change your register_globals directive to "On", and
restart your web server.

Or add ini_set("register_globals", "1"); line top of your php file.

                                             Hidayet Dogan
                              [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
----------------------------------------------------------
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006

On Mon, 18 Aug 2003, [iso-8859-1] Klaus Kaiser Apolinário wrote:

> Guys I have a problem here.
> I'm using PHP 4.3.2 and httpd 1.3.28.
> Look my exemple.
> I have a page whith a Form method post, and I submit this page to teste2.php, but I 
> dont can request de data from the text box...
>
>
> #######################
> This is the test page
>
> <html>
> <body>
> <form action="teste2.php" method="post" enctype="multipart/form-data">
> <input type="text" name="texto">
> <input type="submit" value="ok">
> </form>
> </body>
> </html>
>
> #####################
> Teste2.php
>
> <?php
> $string = $_POST['texto'];
> echo "Var em post: ".$string."<br>";
> echo "Var em get: ".$_GET['texto']."<br>";
>
>
> //phpinfo();
> ?>
> ############################################
>
> Some one can help me...???
>
> Klaus Kaiser Apolinário
> Curitiba online


--- End Message ---
--- Begin Message ---
Wow... don't do either of those. First of all, you can't use ini_set to
affect the register global settings and you're using the $_POST/$_GET
superglobals, which work regardless of your setting. So that's not the
issue.

Does the phpinfo() function product any output? What if you view the source
of the "php" file, do you see your PHP code?

---John Holmes...

----- Original Message ----- 
From: "Hidayet Dogan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 18, 2003 10:47 AM
Subject: Re: [PHP] Problem with the post variables.


Check your register_globals directive in php.ini file.

If its value is "Off", change your register_globals directive to "On", and
restart your web server.

Or add ini_set("register_globals", "1"); line top of your php file.

                                             Hidayet Dogan
                              [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
----------------------------------------------------------
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006

On Mon, 18 Aug 2003, [iso-8859-1] Klaus Kaiser Apolinário wrote:

> Guys I have a problem here.
> I'm using PHP 4.3.2 and httpd 1.3.28.
> Look my exemple.
> I have a page whith a Form method post, and I submit this page to
teste2.php, but I dont can request de data from the text box...
>
>
> #######################
> This is the test page
>
> <html>
> <body>
> <form action="teste2.php" method="post" enctype="multipart/form-data">
> <input type="text" name="texto">
> <input type="submit" value="ok">
> </form>
> </body>
> </html>
>
> #####################
> Teste2.php
>
> <?php
> $string = $_POST['texto'];
> echo "Var em post: ".$string."<br>";
> echo "Var em get: ".$_GET['texto']."<br>";
>
>
> //phpinfo();
> ?>
> ############################################
>
> Some one can help me...???
>
> Klaus Kaiser Apolinário
> Curitiba online


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


--- End Message ---
--- Begin Message ---
The problem is probably in the 'enctype="multipart/form-data"'. You should
only use this enctype if you're gonna upload a file through the form. If
not, just leave it away or use text/plain

Wouter

-----Oorspronkelijk bericht-----
Van: Klaus Kaiser Apolinário [mailto:[EMAIL PROTECTED]
Verzonden: maandag 18 augustus 2003 16:04
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Problem with the post variables.


Guys I have a problem here.
I'm using PHP 4.3.2 and httpd 1.3.28.
Look my exemple.
I have a page whith a Form method post, and I submit this page to
teste2.php, but I dont can request de data from the text box...


#######################
This is the test page

<html>
<body>
<form action="teste2.php" method="post" enctype="multipart/form-data">
<input type="text" name="texto">
<input type="submit" value="ok">
</form>
</body>
</html>

#####################
Teste2.php

<?php
$string = $_POST['texto'];
echo "Var em post: ".$string."<br>";
echo "Var em get: ".$_GET['texto']."<br>";


//phpinfo();
?>
############################################

Some one can help me...???

Klaus Kaiser Apolinário
Curitiba online



--- End Message ---
--- Begin Message ---
--- Wouter van Vliet <[EMAIL PROTECTED]> wrote:
> The problem is probably in the 'enctype="multipart/form-data"'.
> You should only use this enctype if you're gonna upload a file
> through the form. If not, just leave it away or use text/plain

Posted data isn't text/plain, it's something like
application/x-www-form-urlencoded.

For the original poster, find a simple example and build on that rather than
trying to learn too many things at once. This might be a good start:

<form method="post">
<input type="text" name="foo" /><br />
<input type="submit" />
</form>
<p>$_POST array:</p>
<pre>
<? print_r($_POST); ?>
</pre>

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
ooooooops .. my mistake .. Usually I check thing before I post, forget it
once .. that's how I make mistakes.. Anyways, I still am pretty sure setting
enctype to multipart/form-data was the problem..

'application/x-www-form-urlencoded' is indeed the correct enctype for just
posting forms .. (checked it at www.handleidinghtml.nl, interesting for the
fellow dutchmen over here ;))

-----Oorspronkelijk bericht-----
Van: Chris Shiflett [mailto:[EMAIL PROTECTED]
Verzonden: maandag 18 augustus 2003 19:09
Aan: Wouter van Vliet; Klaus_Kaiser_Apolinario;
[EMAIL PROTECTED]
Onderwerp: RE: [PHP] Problem with the post variables.


--- Wouter van Vliet <[EMAIL PROTECTED]> wrote:
> The problem is probably in the 'enctype="multipart/form-data"'.
> You should only use this enctype if you're gonna upload a file
> through the form. If not, just leave it away or use text/plain

Posted data isn't text/plain, it's something like
application/x-www-form-urlencoded.

For the original poster, find a simple example and build on that rather than
trying to learn too many things at once. This might be a good start:

<form method="post">
<input type="text" name="foo" /><br />
<input type="submit" />
</form>
<p>$_POST array:</p>
<pre>
<? print_r($_POST); ?>
</pre>

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/



--- End Message ---
--- Begin Message ---
No,thanks.....I still got the cookies , and
could not block cookies, how comes that ?

the following is my  scripts:
--------------------------------------- 
 $fp = fopen("http://XXX.XXX.XXX","r";);
       
       while(!feof($fp))
            {
            echo fgets($fp,128);
            }
       fclose($fp);

----------------------------------------
>If you want to block the http headers sent back by >the web server,use
>fopen() instead.
> -----Original Message-----
> From: fongming [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 18, 2003 11:29 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] problem with fsockopen ............
> 
> 
> Hi,Sir:
> 
> Can I  block cookies  when I ftput headers ?
> following is my fsockopen() scripts,
> but it always send back "cookies".....
> Is there any way to prevent from it ? 
> thanks
> -------------------------------------------------
> 
>  $fp = fsockopen ("XXX.XXX.XXX.XXX", 80, $errno, $errstr, 30);
>    if (!$fp) {   echo "$errstr ($errno)<br>\n";}
>    else
>    {
>    fputs ($fp, "GET /index.php HTTP/1.0\r\");
>    fputs($fp,"Host: XXX.XXX.XXX.XXX\r\n");
>    fputs($fp,"Pragma: no-cache\r\n");
>    fputs($fp,"Connection: close\r\n\r\n");
>   }
> 
>    fclose ($fp);
> 
> -----------------------------------
> Fongming from Taiwan.
> 
> 
> ------------------------------------------
> ¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
> http://fonn.fongming.idv.tw
> [EMAIL PROTECTED]
> 
> -- 
> 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




-----------------------------------
Fongming from Taiwan.


------------------------------------------
¡»From: ¦¹«H¬O¥Ñ®ç¤p¹q¤l¶l¥ó1.5ª©©Òµo¥X...
http://fonn.fongming.idv.tw
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I've been successfully operating a web site for a while now, hosted by an
ISP. I'm escaping blocks of PHP code from .html files, and have been using
the following .htaccess file to force php to parse these files. I've also
been using .htaccess to help make my URL's more user-friendly:

AddType application/x-httpd-php .html
<Files articles>
  ForceType application/x-httpd-php
</Files>

My ISP has just updated and reconfigured their Apache server, and my
.htaccess file has stopped working altogether. Every request for *.html or
"articles" returns an Internal Server Error. I assume the problem is that
httpd.conf is now configured differently than it used to be, and the
AllowOverride setting is preventing my .htaccess file from working. The ISP
isn't fully acknowledging that this is the problem, but they do say they're
unwilling to change any of their settings due to security concerns.

My questions:

1. Is this necessarily a problem with AllowOverride? Or could there be some
other explanation? Anything I can do without help from my ISP?

2. Since my ISP has very little interest in helping, can anyone recommend a
web hosting service who provides php and mysql, allows ssh telnet access to
the command prompt, supports users' .htaccess files, and generally
understands and supports the needs of php developers? Any referrals are
greatly appreciated.

Thanks,
Terry








--- End Message ---
--- Begin Message ---
Hello,
 
I have a PHP page which pulls a bunch of data from a mySQL DB.  I have 2
list boxes in a form.  One is populated automatically by my PHP code.
But the second will be populated based on what is selected in the first.
 
I don't know how to get out the value of the first listbox using JS.
 
Can anyone help?
 
Thx
 
Tim Winters
Creative Development Manager
Sampling Technologies Incorporated
 
1600 Bedford Highway, Suite 212
Bedford, Nova Scotia
B4A 1E8
www.samplingtechnologies.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Office: 902 450 5500
Cell: 902 430 8498
Fax:: 902 484 7115
 

--- End Message ---
--- Begin Message ---
From: "Tim Winters" <[EMAIL PROTECTED]>

> I have a PHP page which pulls a bunch of data from a mySQL DB.  I have 2
> list boxes in a form.  One is populated automatically by my PHP code.
> But the second will be populated based on what is selected in the first.
>
> I don't know how to get out the value of the first listbox using JS.

This is a PHP list. If you have a JavaScript question, please find a
JavaScript list or forum. Thanks.

---John Holmes...


--- End Message ---
--- Begin Message ---
Perfect! That's all I had to do.

Thanks!

Maurício

-----Mensagem original-----
De: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Enviada em: terça-feira, 5 de agosto de 2003 16:30
Para: Mauricio; [EMAIL PROTECTED]
Assunto: Re: [PHP] PHP/JavaScript/HTML


From: "Mauricio" <[EMAIL PROTECTED]>
> On the Address Bar I can see: index.php?slcAdd=1&slcAdd=2&slcAdd=3
> But when I get the value using $HTTP_GET_VARS['slcAdd']; it returns just
the
> last value. What can I do to get them all?

Name your select box as "slcAdd[]" and you'll have all of the values in an
array.

---John Holmes...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 14/8/2003

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.510 / Virus Database: 307 - Release Date: 14/8/2003


--- End Message ---
--- Begin Message ---
I've come across this frustrating behavior with the XML parser when it
reads an escaped ampersand (&amp;)

If the xml being evaluated is:   <COLORS>Blue, Green &amp; Red</COLORS>

it calls the character data handler 3 times: 
the first time the $data is "Blue, Green "
the second time is "&"
and the third time is " Red"

Needless to say this is screwing up my parser, and the stuff I'm doing
won't make it easy to add this allowance.  I'm hoping somebody can point
out a way to turn off this behavior.  If this is the proper operation,
is it documented anywhere? I've been unable to find it.


-- 
Jeff Bearer, RHCE
Webmaster, PittsburghLIVE.com



--- End Message ---
--- Begin Message ---
This is normal.  You have illegal XML there, as it should be
in <![CDATA[ value ]]>.  I have run across this, and have
to clean it up with an awk script.  Ampersand is a no-no.

Just running xmllint on the file will tell you about the problem(s).

_justin

Jeff Bearer wrote:
> 
> I've come across this frustrating behavior with the XML parser when it
> reads an escaped ampersand (&amp;)
> 
> If the xml being evaluated is:   <COLORS>Blue, Green &amp; Red</COLORS>
> 
> it calls the character data handler 3 times:
> the first time the $data is "Blue, Green "
> the second time is "&"
> and the third time is " Red"
> 
> Needless to say this is screwing up my parser, and the stuff I'm doing
> won't make it easy to add this allowance.  I'm hoping somebody can point
> out a way to turn off this behavior.  If this is the proper operation,
> is it documented anywhere? I've been unable to find it.
> 
> --
> Jeff Bearer, RHCE
> Webmaster, PittsburghLIVE.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Justin Farnsworth
Eye Integrated Communications
321 South Evans - Suite 203
Greenville, NC 27858 | Tel: (252) 353-0722

--- End Message ---
--- Begin Message ---
The data contains escaped ampersands -> &amp;

Which is as far as I know the way one represents ampersands in their
data.  In my post below, the value of $data the second time is "&"
because it has been evaluated by the xml parser.

And btw xmllint has no problems with &amp; 

On Mon, 2003-08-18 at 12:41, Justin Farnsworth wrote:
> This is normal.  You have illegal XML there, as it should be
> in <![CDATA[ value ]]>.  I have run across this, and have
> to clean it up with an awk script.  Ampersand is a no-no.
> 
> Just running xmllint on the file will tell you about the problem(s).
> 
> _justin
> 
> Jeff Bearer wrote:
> > 
> > I've come across this frustrating behavior with the XML parser when it
> > reads an escaped ampersand (&amp;)
> > 
> > If the xml being evaluated is:   <COLORS>Blue, Green &amp; Red</COLORS>
> > 
> > it calls the character data handler 3 times:
> > the first time the $data is "Blue, Green "
> > the second time is "&"
> > and the third time is " Red"
> > 
> > Needless to say this is screwing up my parser, and the stuff I'm doing
> > won't make it easy to add this allowance.  I'm hoping somebody can point
> > out a way to turn off this behavior.  If this is the proper operation,
> > is it documented anywhere? I've been unable to find it.
> > 
> > --
> > Jeff Bearer, RHCE
> > Webmaster, PittsburghLIVE.com
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Jeff Bearer, RHCE
Webmaster, PittsburghLIVE.com



--- End Message ---
--- Begin Message ---
This is my log erros, I`ve changed my POST_MAX_SIZE in the php.in, and this value is 
constant.

Unknown(0) : Warning - Unknown(): POST Content-Length of 215 bytes 
exceeds the limit of -1048576 bytes

Klaus Kaiser Apolinario
Curitiba online

--- End Message ---
--- Begin Message ---
--- Klaus_Kaiser_Apolinário <[EMAIL PROTECTED]> wrote:
> This is my log erros, I`ve changed my POST_MAX_SIZE in the php.in,
> and this value is constant.
> 
> Unknown(0) : Warning - Unknown(): POST Content-Length of 215 bytes 
> exceeds the limit of -1048576 bytes

That looks like overflow of some sort, since it is thinking the limit is
negative. Try setting your POST_MAX_SIZE to something smaller, like a million
or less, and see if you get different results.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
John Taylor-Johnston <mailto:[EMAIL PROTECTED]>
    on Saturday, August 16, 2003 5:19 PM said:

> Have I over done this?

That I don't know.

> Can I clean up this code any?

Yes.

1. You can take your open/closeserver() functions one step farther and
create a query function (can be called something like dbQuery()).
Anytime you repeat code you should look into a way of turning that
repeating code into a function. For example you seem to follow this:

OpenServer();
$sql = "SELECT mystuff";
mysql_query($sql) or die(..);
CloseServer();

Turn that into a function instead and save yourself the hassle of typing
mysql_query(..) or die(..);


Function myQuery($sql)
{
        OpenServer();
        mysql_query($sql) or die(..);
        CloseServer();
}

Now all you have to do is this:

$sql = "SELECT mystuff";
myQuery($sql);

2. Only because it's redundant, you shouldn't Open/CloseServer() in each
code block. Instead, OpenServer() and the beginning of the page and
CloseServer() at the end of the page.


<?
        OpenServer();

// entire page content goes here

        CloseServer();
?>

That would turn the function I wrote above into this:

Function myQuery($sql)
{
        mysql_query($sql) or die(..);
}

3. In my limited experience with php I would recommend you create a
database class that will organize all your db functions into one object.
Shoot me an email offlist if you'd like to see what I've written.



HTH,
Chris.

--- End Message ---
--- Begin Message ---
Good Morning!!

I'm trying to print $GLOBALs this way and it doesn't work:
<?php
    $aTest = "This is a test";
    
    function GlobalCheck()
    {
        print "{$GLOBAL['aTest']}";
    }
    
    GlobalCheck();
?>
Does someone know the 'right' way to do this??

Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020 


--- End Message ---
--- Begin Message --- $GLOBALS not $GLOBAL

Greg
--
phpDocumentor
http://www.phpdoc.org

Robin Kopetzky wrote:

Good Morning!!

I'm trying to print $GLOBALs this way and it doesn't work:
<?php
$aTest = "This is a test";
function GlobalCheck()
{
print "{$GLOBAL['aTest']}";
}
GlobalCheck();
?>
Does someone know the 'right' way to do this??


Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020




--- End Message ---
--- Begin Message ---
DOH! Damned fat-fingering!!! Must learn to type s l o w l y...

Thanks!
Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020 




--- End Message ---
--- Begin Message --- Robin,

There are 2 problems with the example you provided.

One, $GLOBAL should be $GLOBALS.

Second you can't print a value that has not been set. See updated code for an example.

<?PHP
        $aTest = "This is a test";
        $GLOBALS['aTest'] = $aTest;

        function GlobalCheck()
        {
                print "{$GLOBALS['aTest']}";
        }

        GlobalCheck();
?>

HTH

Jonathan Pitcher

On Monday, August 18, 2003, at 12:40 PM, Robin Kopetzky wrote:

Good Morning!!

I'm trying to print $GLOBALs this way and it doesn't work:
<?php
    $aTest = "This is a test";

    function GlobalCheck()
    {
        print "{$GLOBAL['aTest']}";
    }

    GlobalCheck();
?>
Does someone know the 'right' way to do this??

Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020


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



--- End Message ---
--- Begin Message ---
Consider the following form in a HTML file:

...
<input type=checkbox name="box" value=1>
<input type=checkbox name="box" value=2>
<input type=checkbox name="box" value=3>
<input type=checkbox name="box" value=4>
...

Now I'm posting this form into a PHP script.  The problem is I can't change
that HTML file.  Which means I can't modify the code above into PHP prefered
style:

<input type=checkbox name="box[]" value=1>
<input type=checkbox name="box[]" value=2>
...

So, how can I get the correct values of the checkbox?  $_REQUEST['box'] is
not an array and only contains the last value.  Thanks!


--- End Message ---
--- Begin Message ---
You can try using $HTTP_RAW_POST_DATA and parsing it yourself - or grab
the get value directly from $_SERVER['QUERY_STRING']

Regards,
Greg

Dallas Thunder wrote:

> Consider the following form in a HTML file:
> 
> ...
> <input type=checkbox name="box" value=1>
> <input type=checkbox name="box" value=2>
> <input type=checkbox name="box" value=3>
> <input type=checkbox name="box" value=4>
> ...
> 
> Now I'm posting this form into a PHP script.  The problem is I can't change
> that HTML file.  Which means I can't modify the code above into PHP prefered
> style:
> 
> <input type=checkbox name="box[]" value=1>
> <input type=checkbox name="box[]" value=2>
> ...
> 
> So, how can I get the correct values of the checkbox?  $_REQUEST['box'] is
> not an array and only contains the last value.  Thanks!
> 


--- End Message ---
--- Begin Message ---
> Consider the following form in a HTML file:

>

> ...

> <input type=checkbox name="box" value=1>

> <input type=checkbox name="box" value=2>

> <input type=checkbox name="box" value=3>

> <input type=checkbox name="box" value=4>

> ...

>

> Now I'm posting this form into a PHP script.  The problem is I can't
change

> that HTML file.  Which means I can't modify the code above into PHP
prefered

> style:

>

> <input type=checkbox name="box[]" value=1>

> <input type=checkbox name="box[]" value=2>

> ...

>

> So, how can I get the correct values of the checkbox?  $_REQUEST['box'] is

> not an array and only contains the last value.  Thanks!



Parse the value of $_SERVER['QUERY_STRING'] yourself and make the array.



---John Holmes...


--- End Message ---
--- Begin Message ---
 
[...snip...]
Which means I can't modify the code above into PHP prefered
style:
 
<input type=checkbox name="box[]" value=1>
<input type=checkbox name="box[]" value=2>
....
 
[...snip...]

Why is this the preferred style, and where can I read more about it?

Frode Lillerud, Norway

--- End Message ---
--- Begin Message ---
----- Original Message ----- 
From: "Frode" <[EMAIL PROTECTED]>
[...snip...]
Which means I can't modify the code above into PHP prefered
style:

<input type=checkbox name="box[]" value=1>
<input type=checkbox name="box[]" value=2>
....

[...snip...]

> Why is this the preferred style, and where can I read more about it?

I don't know about preferred style or not, but if you want PHP to recognize
multiple values from a form or URL, then you must add the [] onto the name
so PHP will put it into an array. Otherwise you end up with
"box=1&box=2&box=3" and when PHP parses that, each overwrites the other, so
you end up with $box == 3 at the end and the other values are lost. I'm sure
it's discussed in the Form Handling section of the manual.

---John Holmes...


--- End Message ---
--- Begin Message ---
I need to grab cookies from a web page and pass those cookies back to
the web page when needed.  I downloaded the cURL program and was playing
with it, but don't understand how cURL functions correlate into the PHP
equivalents.

How would I strip the cookies from a web page, and send cookies?
More importantly, if I have cookies from domain x which provides y
cookies and go to a second web page from domain x which provides z
cookies, if I go to another web page on domain x should I concatanate
the y and z cookies, or just send the last z cookies recieved?

Thanks in advance,

Dan Anderson


--- End Message ---
--- Begin Message --- Would all who are, quit requesting "read receipts" on their messages? It's really annoying and I don't think you want to know of the 100+ users on this list how many read the message...

Thanks!
-Michael
Robin Kopetzky wrote:

Good Morning!!

I'm trying to print $GLOBALs this way and it doesn't work:
<?php
$aTest = "This is a test";
function GlobalCheck()
{
print "{$GLOBAL['aTest']}";
}
GlobalCheck();
?>
Does someone know the 'right' way to do this??


Robin 'Sparky' Kopetzky
Black Mesa Computers/Internet Service
Grants, NM 87020








--- End Message ---
--- Begin Message ---
Michael A Smith <mailto:[EMAIL PROTECTED]>
    on Monday, August 18, 2003 1:41 PM said:

> Would all who are, quit requesting "read receipts" on their messages?
> It's really annoying and I don't think you want to know of the 100+
> users on this list how many read the message...

Doesn't bother me.


Chris.

p.s. Is there not an option on your mail reader to automatically send
read receipts? I mean, can't you have it by default send the receipt
instead of requesting your intervention? If not, you might like to think
about getting a better client. thanks!

--- End Message ---
--- Begin Message ---
> p.s. Is there not an option on your mail reader to automatically send
> read receipts? I mean, can't you have it by default send the receipt
> instead of requesting your intervention? If not, you might like to think
> about getting a better client. thanks!

You ever open a spam and 30 seconds later get a follow up spam?  That's
what happens from automatically sending read reciepts.  Also, spammers
love to use them as a tool to figure out who actually reads spam -- even
if you just click on it for a second to press the DEL key.

However, so many people request read reciepts that even though I wish
they didn't exist I can't see complaining to a mailing list about them.

-Dan


--- End Message ---
--- Begin Message ---
This is pretty off topic -- but most clients also let you refuse to send
receipts automatically -- which is how I deal with them.

Cheers,
Rob.

On Mon, 2003-08-18 at 17:04, Dan Anderson wrote:
> > p.s. Is there not an option on your mail reader to automatically send
> > read receipts? I mean, can't you have it by default send the receipt
> > instead of requesting your intervention? If not, you might like to think
> > about getting a better client. thanks!
> 
> You ever open a spam and 30 seconds later get a follow up spam?  That's
> what happens from automatically sending read reciepts.  Also, spammers
> love to use them as a tool to figure out who actually reads spam -- even
> if you just click on it for a second to press the DEL key.
> 
> However, so many people request read reciepts that even though I wish
> they didn't exist I can't see complaining to a mailing list about them.
> 
> -Dan

-- 
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org   |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.    |
`---------------------------------------------'

--- End Message ---

Reply via email to