php-general Digest 24 Apr 2002 11:31:03 -0000 Issue 1305

Topics (messages 94284 through 94351):

Re: Wich Database abstration layer?
        94284 by: Manuel Lemos
        94285 by: Martin Towell
        94286 by: Manuel Lemos
        94287 by: Manuel Lemos

Re: Question for Linux users...
        94288 by: Mark Gallagher

Re: phpnuke still around?
        94289 by: Miguel Cruz
        94339 by: Maxim Maletsky \(PHPBeginner.com\)

how to give vars to a php(shell env) script?
        94290 by: Hermann Bier
        94291 by: Martin Towell
        94293 by: Hermann Bier
        94304 by: Ray Hunter
        94306 by: David Robley

4.2.0 release and bug #15983
        94292 by: Chris Cameron
        94296 by: John Holmes

file permissions on counter?
        94294 by: Antonio
        94295 by: Bogdan Stancescu
        94298 by: Tyler Longren

Re: authentication
        94297 by: Justin French

SQL Warning
        94299 by: Jennifer Downey
        94300 by: Jason Murray
        94301 by: Martin Towell
        94302 by: Miguel Cruz
        94303 by: Martin Towell

Re: Display large text fields in html
        94305 by: Ray Hunter

Arrays in forms {?!}
        94307 by: Liam MacKenzie
        94308 by: Miguel Cruz
        94325 by: Marcus Rasmussen

Help PHP 4.2: No more error messages
        94309 by: Mark W. Humphries
        94311 by: CC Zona
        94314 by: Mark W. Humphries

Combining Variables
        94310 by: Jason Soza
        94312 by: Jason Soza

Trimming text
        94313 by: Ashley M. Kirchner
        94331 by: liljim

Re: PHP session / JavaScript conflict
        94315 by: Yasuo Ohgaki

How to connect to mysql through JAVA?
        94316 by: Balaji Ankem

compiling php 4.2 with apache 2.0.35
        94317 by: Michal Dvoracek
        94318 by: Rasmus Lerdorf

RegEx and ?
        94319 by: Boaz Yahav
        94320 by: Marius Ursache
        94321 by: Marius Ursache
        94327 by: liljim
        94328 by: liljim

validating user input
        94322 by: DrouetL.ldnegoce.com
        94336 by: Adrian Ciutureanu

Re: Browser cache
        94323 by: José León Serna

comparing time
        94324 by: Cosmin
        94337 by: heinisch.creaction.de

Can't Load Data into Mysql Using "LOAD DATA"
        94326 by: Jack
        94329 by: Jason Wong

Re: Database and files
        94330 by: Richard Archer

Re: problem compiling Apche 2.0.35 and PHP 4.2.0
        94332 by: Jason Wong

Removing Irregular characters
        94333 by: Liam MacKenzie
        94338 by: liljim
        94344 by: heinisch.creaction.de

Once more: [PHP] Array indices - PLEASE HELP!!
        94334 by: esivertsen
        94340 by: Jason Wong

Re: Array indices
        94335 by: Tim Ward

Multi language support
        94341 by: Shailendra Mehta

Home Finance System / Bill Splitter
        94342 by: Dan Horth

Passing Variables with register_globals Off?
        94343 by: Smileyq
        94345 by: John Holmes

Re: security
        94346 by: Maxim Maletsky \(PHPBeginner.com\)

PHP Lists
        94347 by: Dan Horth
        94350 by: Liam MacKenzie
        94351 by: Maxim Maletsky \(PHPBeginner.com\)

Re: Empty $_SESSION and $_POST ??
        94348 by: Andre Dubuc

html mail
        94349 by: Wilbert Enserink

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

Javier wrote:
> 
> Can anybody recomend me a "nice" DB abstraction layer that is not
> included in phplib?

You may want to try looking at Metabase. It assures true database
portability.

http://www.phpclasses.org/metabase

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
I hope we're not going to get into the "this db class is better than that
one" thread again

-----Original Message-----
From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 9:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Wich Database abstration layer?


Hello,

Javier wrote:
> 
> Can anybody recomend me a "nice" DB abstraction layer that is not
> included in phplib?

You may want to try looking at Metabase. It assures true database
portability.

http://www.phpclasses.org/metabase

Regards,
Manuel Lemos

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

Javier wrote:
> 
> Can anybody recomend me a "nice" DB abstraction layer that is not
> included in phplib?

You may want to try looking at Metabase. It assures true database
portability.

http://www.phpclasses.org/metabase

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
Hello,

Martin Towell wrote:
> 
> I hope we're not going to get into the "this db class is better than that
> one" thread again

That was not what the original poster asked. Let him judge and ask
further questions if he wants to.

Regards,
Manuel Lemos

> 
> -----Original Message-----
> From: Manuel Lemos [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 24, 2002 9:28 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Wich Database abstration layer?
> 
> Hello,
> 
> Javier wrote:
> >
> > Can anybody recomend me a "nice" DB abstraction layer that is not
> > included in phplib?
> 
> You may want to try looking at Metabase. It assures true database
> portability.
> 
> http://www.phpclasses.org/metabase
> 
> Regards,
> Manuel Lemos
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Jason Soza wrote:
> Don't want to start a war or anything, so e-mail me your responses 
> offlist if necessary, but I'd like to know what Linux distro you like 
> best and why.

Wouldn't you rather ask a less inflammatory question - like "which is 
better?  Emacs or vi[0]?" :o)

<snip />

> Anyhow, I've used both Mandrake and Slackware distros, but am now 
> leaning toward Debian or SuSe. If you have other suggestions or 
> whatever, please share. Remember, NO HOLY WARS! Offlist is okay if you 
> think your comments might spark something. :)

Don't go for Mandrake.  Sure, it's a lot easier to use than the others, 
but... *shudder*.

I'm using Redhat currently, but just as a desktop computer (with 
theoretical links to my home network).  My site's host, though, uses 
Redhat on her servers IIRC, and has no problems.

Apparently Debian and SuSe are extremely good.



[0] Stupid question, anyway - everyone knows it's vi (well, Vim)

--- End Message ---
--- Begin Message ---
On Tue, 23 Apr 2002, Dennis Gearon wrote:
> http://www.phpnuke.org/ doesn't respond. Is it still a valid
> project/product? Where is it?

You just tried it this once, or over a period of days? Perhaps they're 
upgrading their web server at the moment. The machine is up.

miguel

--- End Message ---
--- Begin Message ---
Try looking on sourceforge (www.sf.net)


Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins




-----Original Message-----
From: Dennis Gearon [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 24, 2002 12:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP] phpnuke still around?


http://www.phpnuke.org/ doesn't respond. Is it still a valid
project/product? Where is it?

PLEASE cc me.
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

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


--- End Message ---
--- Begin Message ---
Hi NG!

how could i give some vars to a php script, that is directly executed by 
php-parser. for instance:

#!/usr/bin/php -q
<?
echo "$SOME_VAR";
?>

is it possible at all?

thanx for advance.

Hermann Bier

--- End Message ---
--- Begin Message ---
try setting an environment variable before calling your script


-----Original Message-----
From: Hermann Bier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 12:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] how to give vars to a php(shell env) script?


Hi NG!

how could i give some vars to a php script, that is directly executed by 
php-parser. for instance:

#!/usr/bin/php -q
<?
echo "$SOME_VAR";
?>

is it possible at all?

thanx for advance.

Hermann Bier


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


Martin Towell wrote:

> try setting an environment variable before calling your script
> 
> 
> -----Original Message-----
> From: Hermann Bier [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 24, 2002 12:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how to give vars to a php(shell env) script?
> 
> 
> Hi NG!
> 
> how could i give some vars to a php script, that is directly executed by 
> php-parser. for instance:
> 
> #!/usr/bin/php -q
> <?
> echo "$SOME_VAR";
> ?>
> 
> is it possible at all?
> 
> thanx for advance.
> 
> Hermann Bier
> 
> 
> 

so actually, i want to execute this ^^^^^ script from another php 
script, which gonna be executed by apache.

thx

Hermann Bier

--- End Message ---
--- Begin Message ---
Pass the variables at the command line...

$ARGV[i]

and

$ARGC deteremines the number of variables passed...

Try it and see what happens


"Hermann Bier" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi NG!
>
> how could i give some vars to a php script, that is directly executed by
> php-parser. for instance:
>
> #!/usr/bin/php -q
> <?
> echo "$SOME_VAR";
> ?>
>
> is it possible at all?
>
> thanx for advance.
>
> Hermann Bier
>


--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says...
> Hi NG!
> 
> how could i give some vars to a php script, that is directly executed by 
> php-parser. for instance:
> 
> #!/usr/bin/php -q
> <?
> echo "$SOME_VAR";
> ?>
> 
> is it possible at all?
> 
> thanx for advance.
> 
> Hermann Bier
> 
> 
Have a look at the section of the manual on Using PHP from the Command 
Line - there are examples of how to do what you want.


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
I was wondering if anyone could tell me if bug #15983 has been fixed in this
new PHP release. I'd check myself, but I'm a bit short on time (thanks to this
very bug).

http://bugs.php.net/bug.php?id=15983 Specifically.


If ever there was a more maddening bug to run across..


Thanks,
Chris

--- End Message ---
--- Begin Message ---
I read through the changelog (4.2 -> 4.0.6) and didn't see any mention
of it. 

---John Holmes...

> -----Original Message-----
> From: Chris Cameron [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 5:56 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] 4.2.0 release and bug #15983
> 
> I was wondering if anyone could tell me if bug #15983 has been fixed
in
> this
> new PHP release. I'd check myself, but I'm a bit short on time (thanks
to
> this
> very bug).
> 
> http://bugs.php.net/bug.php?id=15983 Specifically.
> 
> 
> If ever there was a more maddening bug to run across..
> 
> 
> Thanks,
> Chris
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
 Hi, I have to read a simple counter on my server, but the server
responses that I haven't permissions to open the file which contains the
data in write mode. This file (counter.txt) it has all the permissions
(777). I don't know how to do, could somebody help me?


I execute this file on server:


<HTML>
<HEAD>
<TITLE></TITLE>
<BODY>


<?php


$userip = $REMOTE_ADDR;


if ($file=fopen("counter.txt",  "w")) {
   $counter = fread($file, 10);
   $counter++;
   fwrite($file , $counter);
   fclose($file);
}

echo $counter;


?>


</body>
</html>
--- End Message ---
--- Begin Message ---
You should check the whole path and make sure Apache has enough rights 
to read through all directories.

Bogdan

Antonio wrote:

> Hi, I have to read a simple counter on my server, but the server
>responses that I haven't permissions to open the file which contains the
>data in write mode. This file (counter.txt) it has all the permissions
>(777). I don't know how to do, could somebody help me?
>
>
>I execute this file on server:
>
>
><HTML>
><HEAD>
><TITLE></TITLE>
><BODY>
>
>
><?php
>
>
>$userip = $REMOTE_ADDR;
>
>
>if ($file=fopen("counter.txt",  "w")) {
>   $counter = fread($file, 10);
>   $counter++;
>   fwrite($file , $counter);
>   fclose($file);
>}
>
>echo $counter;
>
>
>?>
>
>
></body>
></html>
>



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

try this for your fopen():
$file=fopen("counter.txt","r+")

Incase you're interested, here's the code I use whenever I need to use a
simple text-file based counter:
<?
$file = ".count.txt";
$fp = fopen("$file","r+");
$counter = fread($fp, filesize("$file"));
fclose($fp);
$counter +=1;
$fp = fopen("$file", "w+");
fputs($fp, $counter);
fclose($fp);
include("$file");
?>

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]

----- Original Message -----
From: "Antonio" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 8:48 PM
Subject: [PHP] file permissions on counter?


> Hi, I have to read a simple counter on my server, but the server
> responses that I haven't permissions to open the file which contains the
> data in write mode. This file (counter.txt) it has all the permissions
> (777). I don't know how to do, could somebody help me?
>
>
> I execute this file on server:
>
>
> <HTML>
> <HEAD>
> <TITLE></TITLE>
> <BODY>
>
>
> <?php
>
>
> $userip = $REMOTE_ADDR;
>
>
> if ($file=fopen("counter.txt",  "w")) {
>    $counter = fread($file, 10);
>    $counter++;
>    fwrite($file , $counter);
>    fclose($file);
> }
>
> echo $counter;
>
>
> ?>
>
>
> </body>
> </html>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I believe your choices are either:

1. use .htaccess authentication, which is usually constant for the time the
browser program is open.

2. develop your own user/pass system with sessions


I don't believe the two can work hand-in-hand.


Justin French
---------------------
http://indent.com.au
http://soundpimps.com
---------------------



on 24/04/02 2:52 AM, Fifield, Mike ([EMAIL PROTECTED]) wrote:

> I have one directory that is protected with an .htaccess file on my server
> where I store all member content. What I want to do is have a page where
> members can log in, and after they have entered there user name and password
> I what the php script to authenticate them against the .htaccess file. If
> they are authenticated I would like to keep track of that as one of there
> session variables, so that they do not have to re-authenticate when they try
> to access content in the protected directory. Essentially what I am trying
> to do is give them access to the .htaccess protected based from a "submit
> form". Instead of requiring that they get the standard user name and
> password pop up window that one gets when you try to access a directory that
> is password protected on Apache.
> 
> 
> 
> 

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

Would you please direct your attention to this URL

http://testphp.netfirms.com/code1.html

Look at the bottom where the big orange commented syntax is and explain what
is going on there?


Thanks
Jennifer
--
The sleeper has awaken


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002


--- End Message ---
--- Begin Message ---
> Would you please direct your attention to this URL
> 
> http://testphp.netfirms.com/code1.html
> 
> Look at the bottom where the big orange commented syntax is 
> and explain what is going on there?

{$config["prefix"]}

I think this should be

${config["prefix"]}

... also, it's handy to actually echo or print the SQL you're
executing, as you will be able to see if the SQL is correct
or not. 

The error on line 14 occurs because you're trying to execute 
mysql_fetch_array on a mysql result set that doesn't exist. 

The most likely reason it doesn't exist is because the SQL is 
wrong. Echo the SQL and you'll find out whats happening.

J
--- End Message ---
--- Begin Message ---
or make it
$config[prefix]


-----Original Message-----
From: Jason Murray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 1:51 PM
To: 'Jennifer Downey'; [EMAIL PROTECTED]
Subject: RE: [PHP] SQL Warning


> Would you please direct your attention to this URL
> 
> http://testphp.netfirms.com/code1.html
> 
> Look at the bottom where the big orange commented syntax is 
> and explain what is going on there?

{$config["prefix"]}

I think this should be

${config["prefix"]}

... also, it's handy to actually echo or print the SQL you're
executing, as you will be able to see if the SQL is correct
or not. 

The error on line 14 occurs because you're trying to execute 
mysql_fetch_array on a mysql result set that doesn't exist. 

The most likely reason it doesn't exist is because the SQL is 
wrong. Echo the SQL and you'll find out whats happening.

J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
On Wed, 24 Apr 2002, Jason Murray wrote:
> {$config["prefix"]}
> 
> I think this should be
> 
> ${config["prefix"]}

Those are equivalent.

miguel

--- End Message ---
--- Begin Message ---
The reason why I said that is 'cause the array was inside quotes, so quoting
again would break out of the original quotes

-----Original Message-----
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 2:03 PM
To: Jason Murray
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] SQL Warning


On Wed, 24 Apr 2002, Jason Murray wrote:
> {$config["prefix"]}
> 
> I think this should be
> 
> ${config["prefix"]}

Those are equivalent.

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
What type of database are you using?

You might want to look into the creating temp tables and accessing them...

"Jan Peuker" <[EMAIL PROTECTED]> wrote in message
00e101c1eb0a$9a50c730$7ca990d4@toshiba">news:00e101c1eb0a$9a50c730$7ca990d4@toshiba...
> Ok, but true frames load very slow - not on an intra, but on internet.
> The select is not the problem, I use cursors to output every line. At
first
> I did an implementation like yours but users said it's to uncomfortable
> (they like static VB-Tools). Then I asked JS to reload a frameset using a
> LIMIT-query from 50 +/- of selectedIndex and then just reload if a new
index
> is out of this range, but for me there is no ability to hide/show these
> fields from JS. So i think i would have to use an Applett?
>
> Jan
>
> ----- Original Message -----
> From: "Julio Nobrega Trabalhando" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 23, 2002 11:05 PM
> Subject: [PHP] Re: Display large text fields in html
>
>
> >   If you have over 1000 entries, each one with ~10 lines of text, I
would
> go
> > with frames. Not inline-frames, but a true frames. So each change can
load
> > the frame and show the information.
> >
> >   Also, a <select> with 1000 entries? Break it apart. For example make
one
> > with (imagine this is a select in your browser):
> >
> > /------------------------------\
> > Abba .... Bee Gees                |V|
> > Beethoven .... Coolio                |
> > ManyOptions .... ZillionOptions |
> > \-------------------------------/
> >
> >   It's an interval of choices, first the user selects the interval,
which
> > loads another select with only these "in between" entries.
> >
> >
> >
> > --
> >
> > Julio Nobrega.
> >
> > Um dia eu chego lá:
> > http://sourceforge.net/projects/toca
> >
> > Ajudei? Salvei? Que tal um presentinho?
> > http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
> >
> >
> > "Jan Peuker" <[EMAIL PROTECTED]> wrote in message
> > 006c01c1eb07$28d79500$7ca990d4@toshiba">news:006c01c1eb07$28d79500$7ca990d4@toshiba...
> > > Hi List,
> > >
> > > I want to display large text fields if a user changes wants to, like a
> > > dictionary. for example, a php-database generated page hosts a
combobox
> > > filled with ids, if a user changes it, a text otherwhere changes.
Simple
> > > Javascript would you say, but what's if this combobox has about >1000
> > > entries(every entry about 10lines of text)? The page loads and runs
very
> > > slow. But I don't want to reload the page everytime the user changes
the
> > > field. Do you know any solution?
> > > I know a few: a) As is said, a 2nd textbox filled with value coming
from
> > > array.
> > > b) The box is filled by a set of textfiles which are generated before
> > > c) above but w/ layer
> > > d) no box but an image, b/w-gif generated by php
> > > e) inline-frameset which is reloaded
> > > f) an applett which get its resource by getURL
> > > g) ...
> > > As I said, do you know which would be the best?
> > > Thanks a lot,
> > >
> > > Jan
> > >
> > > PS. Yes, I think this is rather a PHP question.
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


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

I have a form, with about 40 checkboxes, I want to write a PHP document that
processes the submission and displays the values of the checkboxes that were
checked.
Pretty basic stuff, I've tried a few different things, some work but display
"Array" at the top of the list of values.


<Snippet of HTML>
<td>
<input type="checkbox" name="games[]" value="Counter-Strike">
</td>
<td>Counter-Strike</td>
<td>
<input type="checkbox" name="games[]" value="Total Annihilation">
</td>
<td>Total Annihilation</td>
</tr>
</Snippet of HTML>



<Snippet of PHP>
while ( $element = each( $games ) )
{
  echo $element["value"];
  echo "<br>";
}
</Snippet of PHP>



I tried this too, it gave the same results as the above...



if (is_array($games)) {
 for ($z=0;$z<count($games);$z++) {
  echo "$games[$z]<BR>";
 }
}
else {
 echo "$games";
}


I'm missing something real stupid, please help me out

Thanks,
Liam



--- End Message ---
--- Begin Message ---
On Wed, 24 Apr 2002, Liam MacKenzie wrote:
> <Snippet of PHP>
> while ( $element = each( $games ) )
> {
>   echo $element["value"];
>   echo "<br>";
> }
> </Snippet of PHP>
> 
> I tried this too, it gave the same results as the above...
> 
> if (is_array($games)) {
>  for ($z=0;$z<count($games);$z++) {
>   echo "$games[$z]<BR>";
>  }
> }
> else {
>  echo "$games";
> }

foreach ($games as $key => $value)
        echo "<br>$key -- $value";

miguel

--- End Message ---
--- Begin Message ---
1) The example you have shown should work. Take a look at the foreach controle 
structure. (Link at bottom of mail.)
2) You cannot assign a value to a checkbox. It can only be set by the "checked" 
keyword (ie: <input type="checkbox" name="foo" checked>.)
3) The value of a checked checkbox is "on". If a checkbox is not checked it will not 
be passed to you by the clients browser. So if you where wondering why you could not 
get the value of some of the checkboxes, then that was why.
4) If you don't have to give the user a more thorough description then why not make a 
multiselect select box instead.

Example on a multiselect selectedbox

<select name="foo[]" size=20 multiple>
        <option value="bar1">desc</option>
        <option value="bar2" selected>desc</option>
        ...
</select>

The above selectbox will display 20 rows in the box and if there is more than 20 
selections you will be able to scroll it.

You can get more information at:
http://www.php.net/manual/en/control-structures.foreach.php
http://www.php.net/manual/en/language.variables.external.php
_________________________________________________
Marcus Rasmussen

-------------------------------------------------------------
On 24-04-02 at 15:19 Liam MacKenzie wrote:
-------------------------------------------------------------

>Hi all,
>
>I have a form, with about 40 checkboxes, I want to write a PHP document
>that
>processes the submission and displays the values of the checkboxes that
>were
>checked.
>Pretty basic stuff, I've tried a few different things, some work but
>display
>"Array" at the top of the list of values.
>
>
><Snippet of HTML>
><td>
><input type="checkbox" name="games[]" value="Counter-Strike">
></td>
><td>Counter-Strike</td>
><td>
><input type="checkbox" name="games[]" value="Total Annihilation">
></td>
><td>Total Annihilation</td>
></tr>
></Snippet of HTML>
>
>
>
><Snippet of PHP>
>while ( $element = each( $games ) )
>{
>  echo $element["value"];
>  echo "<br>";
>}
></Snippet of PHP>
>
>
>
>I tried this too, it gave the same results as the above...
>
>
>
>if (is_array($games)) {
> for ($z=0;$z<count($games);$z++) {
>  echo "$games[$z]<BR>";
> }
>}
>else {
> echo "$games";
>}
>
>
>I'm missing something real stupid, please help me out
>
>Thanks,
>Liam
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
I am running PHP 4.2 and Apache 1.3.23 on Win2k.
I am generating png files. Before upgrading to PHP 4.2 whenever I had a bug
in a png generating script I would get back an error message, now I only get
back a blank page. I have error reporting set to E_ALL.

Thanks,
 Mark

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Mark W. Humphries) wrote:

> I am running PHP 4.2 and Apache 1.3.23 on Win2k.
> I am generating png files. Before upgrading to PHP 4.2 whenever I had a bug
> in a png generating script I would get back an error message, now I only get
> back a blank page. I have error reporting set to E_ALL.

Check the value of display_errors too.

-- 
CC
--- End Message ---
--- Begin Message ---
CC,

 Thanks! That was what I needed.

Cheers,
 Mark

-----Original Message-----
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 2:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Help PHP 4.2: No more error messages


In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Mark W. Humphries) wrote:

> I am running PHP 4.2 and Apache 1.3.23 on Win2k.
> I am generating png files. Before upgrading to PHP 4.2 whenever I had a
bug
> in a png generating script I would get back an error message, now I only
get
> back a blank page. I have error reporting set to E_ALL.

Check the value of display_errors too.

--
CC

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


--- End Message ---
--- Begin Message ---
Okay, I think this is an easy thing but I can't figure it out:

I have a script that will be uploading (up to) 4 files:
$file1
$file2
$file3
$file4

Each $file variable has associated $original_name, $filesize, and $filename
variables. Each file:

$original_name = $HTTP_POST_FILES['userfile1']['name'];

that gets uploaded needs to 1) have the filename modified:



Jason Soza
'98 Black Grand Cherokee "IAMB4U"
'92 Classic Red Miata "IMB4U2"
Juneau, Alaska
http://www.phrog-net.com/miata/

--- End Message ---
--- Begin Message ---
Well that was embarrassing. I guess [CTRL]+[ENTER] sends mail in Outlook!
Let's try that again:

Okay, I think this is an easy thing but I can't figure it out:

I have a script that will be uploading (up to) 4 files:
$file1
$file2
$file3
$file4

Each $file variable has associated $original_name, $filesize, and $filename
variables. Each file:

$original_name = $HTTP_POST_FILES['userfile1']['name'];

that gets uploaded needs to 1) have the filename modified:

$filename1 = ereg_replace("[^a-z0-9._]", "",
             ereg_replace (" ", "_",
             ereg_replace("%20", "_",
             strtolower($orig_name))));

2) the extension compared to a list of 'forbidden' extensions,
3) the filename compared to filenames already in existence in the upload
directory,
and 4) uploaded.

Can I do this without writing separate filename, extension, existing, and
uploading scripts? Can someone point me in the right direction here?

Thanks,
Jason Soza

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

    I have a variable ($description) that contains text data (pulled from an MySQL 
DB).  I need to delete the last few lines from that data.  Prior to the data getting 
submitted to the DB (during a different routine), the following information gets added:

    $description .= "\n\n< span class=gensmall >Modified by ".$userdata[username]."< 
/span >.";
    (spaces added so the tags don't get parsed)

    Later in the routine, that data gets pulled back up for modification and I need to 
delete that last bit from it.  From the starting '\n' till the end '< /span >.'...

    What's the best, and or easiest way to do this?

--
H | "Life is the art of drawing without an eraser." - John Gardner
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin    .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave, #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.


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

<?
$string = trim($string);
$string = preg_replace("/<span class[^>]+>modified by.*?<\/span>\.$/is", "",
$string);
                                // remove the \. if it doesn't end in a full
stop    ^
?>

Try that.

James

"Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>     I have a variable ($description) that contains text data (pulled from
an MySQL DB).  I need to delete the last few lines from that data.  Prior to
the data getting submitted to the DB (during a different routine), the
following information gets added:
>
>     $description .= "\n\n< span class=gensmall >Modified by
".$userdata[username]."< /span >.";
>     (spaces added so the tags don't get parsed)
>
>     Later in the routine, that data gets pulled back up for modification
and I need to delete that last bit from it.  From the starting '\n' till the
end '< /span >.'...
>
>     What's the best, and or easiest way to do this?
>
> --
> H | "Life is the art of drawing without an eraser." - John Gardner
>   +--------------------------------------------------------------------
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   Director of Internet Operations / SysAdmin    .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave, #6
>   http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
>
>


--- End Message ---
--- Begin Message ---
Larry Linthicum wrote:
> I am finding that the simple <? session_start(); ?>
> 
> is causing pages with JavaScript menus to load with 'error on page" and the
> JavaScript to not work
> 
> the session without the JavaScript seems fine, as does the JavaScript
> without the session ( I can do other things in PHP without conflict)
> 
> Lastly... "refreshing" the page causes it to load fine...with the session
> started
> 
> Ideas?  on what I might be doing wrong?   I have used php sessions without
> problem for some time, the JavaScript is "generated" by DreamWeaver
> 

Turn off trans-sid feature.

--
Yasuo Ohgaki

--- End Message ---
--- Begin Message ---
Hi,
  What is the command to connect to mysql through java.

Thanks and Regards
Balaji

**************************Disclaimer************************************
Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.
********************************************************************
--- End Message ---
--- Begin Message ---
Hello,

i have problem with %subj%.

It's possible to build php without apxs2 ?
Building php with apxs2 - apxs must be instaled before (e.g. apache
must be instaled first ?)

Regards,
Michal Dvoracek                          [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
No, you need to install Apache first if you want to build PHP as an Apache
module.

I'd suggest sticking with Apache 1.3.x for now though.

-Rasmus

On Wed, 24 Apr 2002, Michal Dvoracek wrote:

> Hello,
>
> i have problem with %subj%.
>
> It's possible to build php without apxs2 ?
> Building php with apxs2 - apxs must be instaled before (e.g. apache
> must be instaled first ?)
>
> Regards,
> Michal Dvoracek                          [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
When i try to use preg_match on strings that have "?" inside them it
seems to not work.
Any ideas how to bypass this?
 
thanks
 
berber
--- End Message ---
--- Begin Message ---


Boaz Yahav a écrit :

> When i try to use preg_match on strings that have "?" inside them it
> seems to not work.
> Any ideas how to bypass this?
>
> thanks
>
> berber

--
  Marius Ursache (3563 || 3494)

                           \|/ ____ \|/
                           "@'/ ,. \`@"
                           /_| \__/ |_\
                              \__U_/


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

use \? instead of ?

Boaz Yahav a écrit :

> When i try to use preg_match on strings that have "?" inside them it
> seems to not work.
> Any ideas how to bypass this?
>
> thanks
>
> berber

--
  Marius Ursache (3563 || 3494)

                           \|/ ____ \|/
                           "@'/ ,. \`@"
                           /_| \__/ |_\
                              \__U_/


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

you generally need to do some string replacements on the text you're using
to put through the match before you actually do the match (and same for
replacements).  Just have a look at the pattern syntax in the manual for the
characters you need to do the replacement on... e.g

$string = "Will this work?";
$criteria = "work?";

$criteria = str_replace("?", "\?", $criteria);

if (preg_match("/" . $criteria . /is", $string))
{
    echo "Bingo.";
}

I usually make a function that will replace all the special characters. The
only one that stands out against the rest is the $, because escaped once in
a pcre function means that it is a variable - you need to escape it twice.
Here's some of what I tend to use (cut out a function - the rest of the
function won't mean much to you ;)):

  // Clear up the special characters in the $criteria.
  $criteria = str_replace("^", "\^", $criteria);
  $criteria = str_replace("[", "\[", $criteria);
  $criteria = str_replace("]", "\]", $criteria);
  $criteria = str_replace("*", "\*", $criteria);
  $criteria = str_replace("+", "\+", $criteria);
  $criteria = str_replace("{", "\}", $criteria);
  $criteria = str_replace("}", "\}", $criteria);
  $criteria = str_replace("?", "\?", $criteria);
  $criteria = str_replace("|", "\|", $criteria);

  // The $ is a little tricky, since it is used for end of string / line,
  // and for use with variables when escaped. It therefore needs two
  // backslashes.
  $criteria = str_replace("$", "\\$", $criteria);

  // We're using ! as a delimiter, so that must be replaced, too.
  $criteria = str_replace("!", "\!", $criteria);

There's probably bits missing from that, since that's from a script in
development, but you get the idea.

Hope it's of some help,

James

"Boaz Yahav" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
When i try to use preg_match on strings that have "?" inside them it
seems to not work.
Any ideas how to bypass this?

thanks

berber



--- End Message ---
--- Begin Message ---
What d'ya know. I should read the manual more regularly.

http://www.php.net/manual/en/function.preg-quote.php

~J


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

Hi the M.L.

I have to validate forms user inputs before the construction of my query to
my Oracle DB

Does anybody know the list of characters that should be rejected (for
example ;) ?

Do you have a function to validate it ?


regards
Laurent Drouet


--- End Message ---
--- Begin Message ---
No validating user input is needed if you are using OCIBindByName.
See also the Avertisment at www.php.net/OCIBindByName

<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Hi the M.L.
>
> I have to validate forms user inputs before the construction of my query
to
> my Oracle DB
>
> Does anybody know the list of characters that should be rejected (for
> example ;) ?
>
> Do you have a function to validate it ?
>
>
> regards
> Laurent Drouet
>
>


--- End Message ---
--- Begin Message ---
I think the right answer (at least the right for me) is adding a rand value
to the link of the image, that makes the browser load it every time.

Thanks a lot for your help!.

Best Regards.
----------------------------------------------------
QaDRAM Studio, RAD Development for the WEB
http://studio.qadram.com

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

How can I compare time? So I have to check a difference of 12 or 24 hours
this mean I have to compare the time between the days too..

How I can make this comparing
just comparing hour with hou and then minute with minute or is possible
all of them at the same time?

Thanks

Cosmin


--- End Message ---
--- Begin Message ---
At 24.04.2002  11:05, you wrote:
>Hello,
>
>How can I compare time? So I have to check a difference of 12 or 24 hours
>this mean I have to compare the time between the days too..
>
>How I can make this comparing
>just comparing hour with hou and then minute with minute or is possible
>all of them at the same time?
use mktime() to convert your dates in Unix-imestamps, then you can do 
whatever you like
to make them "human" readable used date().
Oliver

--- End Message ---
--- Begin Message ---
Dear all
 I'm trying to load data from a test.csv file into myql database, but it
seems the data didn't get into the table!!

I use a GUI Program which i type in the Mysql Command to it and execute it,
so i type in the following command :
"Load Data Local infile 'c:\test.csv' into to table testdeposite lines
terminated by ","
it shows the command had successfully executed, by when i type "select *
from testdeposite" which want to check if the data is successfully inserted,
it say no record exist in table!

Could someone pls tell me what happen here?


--
Thx a lot!
Jack
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
On Wednesday 24 April 2002 16:19, Jack wrote:
> Dear all
>  I'm trying to load data from a test.csv file into myql database, but it
> seems the data didn't get into the table!!
>
> I use a GUI Program which i type in the Mysql Command to it and execute it,
> so i type in the following command :
> "Load Data Local infile 'c:\test.csv' into to table testdeposite lines
> terminated by ","
> it shows the command had successfully executed, by when i type "select *
> from testdeposite" which want to check if the data is successfully
> inserted, it say no record exist in table!
>
> Could someone pls tell me what happen here?

Dunno. Maybe you posted to the wrong list. The mysql list is what you want.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Nezvannyi gost'--khuzhe tatarina.
        [An uninvited guest is worse than the Mongol invasion]
                -- Russian proverb
*/
--- End Message ---
--- Begin Message ---
At 3:19 PM +0200 22/4/02, Maxim Maletsky \(PHPBeginner.com\) wrote:

>PostgreSQL is the best choice on my opinion. mySQL might fail on a large
>DB.

I'd love to see an example or detailed anecdote of MySQL failing on a
large DB. I keep seeing comments saying MySQL is not robust, but in my
experience it's nearly bulletproof.

I have thrown some pretty large tasks at it, and even on my lowly
server it has handled everything with great agility.

The only times it has caused me problems are when:

1. a hard crash corrupted a table. Easily fixed once the problem was
pinpointed.

2. a mysql_pconnect escaped into a live site and every apache process
finished up holding open a connection to the database. This is nothing
less than a DB misconfiguration -- the default timeout for pconnections
is like 8 hours when 2 minutes would be more appropriate.

 ...R.
--- End Message ---
--- Begin Message ---
On Wednesday 24 April 2002 04:46, Michael Geier wrote:
> I definitely think MySQL could be the problem...
>
> RPM installation of 3.23.

You need to install:

MySQL-devel-3.23.X

if you haven't already done so.

> Does anyone have any suggestions (other than installing from source)?  I
> have a few databases running on that machine right now and would rather not
> have to port them over to a new installation, if I can help it.
>
> A 'whereis mysql' returned 'mysql: /usr/bin/mysql /usr/lib/mysql
> /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz'
>
> installing with '--with-mysql=[insert dir from above]' failed on the first

If you want php's built-in mysql support just use:

--with-mysql 

Otherwise:

--with-mysql=/usr


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Staff meeting in the conference room in %d minutes.
*/
--- End Message ---
--- Begin Message ---
Hello

I have a form that is to entered into a MySQL database.
A couple of the feilds must contain irregular characters, such as
(/\+;]{'.,<:"?>}|_~`)

What MySQL Field type should I use?
varchar doesn't work.


Thanks, Liam



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

varchar WILL work. Just ensure that you're applying addslashes() to the
input before putting it into the database.

http://www.php.net/addslashes

James

"Liam Mackenzie" <[EMAIL PROTECTED]> wrote in message
00a501c1eb6f$08a6f060$0400a8c0@enigma">news:00a501c1eb6f$08a6f060$0400a8c0@enigma...
> Hello
>
> I have a form that is to entered into a MySQL database.
> A couple of the feilds must contain irregular characters, such as
> (/\+;]{'.,<:"?>}|_~`)
>
> What MySQL Field type should I use?
> varchar doesn't work.
>
>
> Thanks, Liam
>
>
>


--- End Message ---
--- Begin Message ---
At 24.04.2002  19:03, you wrote:
>
>Hello
>
>I have a form that is to entered into a MySQL database.
>A couple of the feilds must contain irregular characters, such as
>(/\+;]{'.,<:"?>}|_~`)
>
>What MySQL Field type should I use?
>varchar doesn't work.


Even this is a definitive mysql-question, try to addslashes() before you
insert your data in the DB, then varchar, text, mediumtext shall work.
Oliver

--- End Message ---
--- Begin Message ---
Does nobody have a suggestion to the below?
Perhaps there is an easy solution, but I cant see it at the time.

        Eivind

> Hi all,
> I have a question regarding array indices:
> 
> At a certain point in code, I run array_diff() on two arrays to produce a reduced 
>version of one of the argument arrays.
> Problem is, I dont want the key-value associations to be preserved. 
> I need that the returned array has new (integer, not string) indices in numerical 
>order from 0...N without holes.
> 
> Does anybody know how to do this? I have looked at different sort functions etc, but 
>I'd rather not do a sort to the array.
> The code is for random selection with reduction of the sample set (i.e. with 
>withdrawal).


--- End Message ---
--- Begin Message ---
On Wednesday 24 April 2002 17:14, esivertsen wrote:
> Does nobody have a suggestion to the below?
> Perhaps there is an easy solution, but I cant see it at the time.
>
>         Eivind
>
> > Hi all,
> > I have a question regarding array indices:
> >
> > At a certain point in code, I run array_diff() on two arrays to produce a
> > reduced version of one of the argument arrays. Problem is, I dont want
> > the key-value associations to be preserved. I need that the returned
> > array has new (integer, not string) indices in numerical order from 0...N
> > without holes.
> >
> > Does anybody know how to do this? I have looked at different sort
> > functions etc, but I'd rather not do a sort to the array. The code is for
> > random selection with reduction of the sample set (i.e. with withdrawal).

just run your array through a foreach loop assigning each key-value pair to a 
new array.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Be not anxious about what you have, but about what you are.
                -- Pope St. Gregory I
*/
--- End Message ---
--- Begin Message ---
Why not just...
Foreach (array_diff($array1, $array2) as $value)
{       $newarray[] = $value;
}

or am I missing something?

Tim Ward
Internet Chess www.chessish.com <http://www.chessish.com> 

        ----------
        From:  esivertsen [SMTP:[EMAIL PROTECTED]]
        Sent:  23 April 2002 13:09
        To:  php-general
        Subject:  Array indices

        Hi all,
        I have a question regarding array indices:

        At a certain point in code, I run array_diff() on two arrays to
produce a reduced version of one of the argument arrays.
        Problem is, I dont want the key-value associations to be preserved. 
        I need that the returned array has new (integer, not string) indices
in numerical order from 0...N without holes.

        Does anybody know how to do this? I have looked at different sort
functions etc, but I'd rather not do a sort to the array.
        The code is for random selection with reduction of the sample set
(i.e. with withdrawal).

        All the best, 

                        Eivind


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

What needs to be done for multi language support in PHP.
I am using redhat linux & new to HTML programming.
I want to know the mechanism to make the output available in different
languages.
Thanks in advance for any help!!!!

--Shailendra S. Mehta 
Senior Engineer (Design & Development), 
TATA Infotech Ltd, 
Mapusa-GOA. 


--- End Message ---
--- Begin Message ---
Hi - I share a house with two other people and have set up a spreadsheet in the past 
allowing me to track bills (rent, electricity, phone, etc) including who paid what and 
how much each person owes in total. Unfortunately I had my laptop stolen around 
christmas and lost my spreadsheet with it. :(

I was about to set up a spreadsheet again - but since I've started getting into 
learning PHP - and have recently set up our home linux server - thought that it would 
be a lot more exciting / functional to have a system running on the server that would 
allow each person to log in, track the current bill status, pay a bill, enter new 
bills, etc. 

I was wondering if anyone knew of an existing system that would do this for me, or if 
anyone had ideas as to exisiting systems that came close to the functionality I'm 
after - that I could tweak.

I'd also be interested in hearing from anyone who would be interested in such a 
system, or developing one, or collaborating on a PHP newbie on putting together such a 
beast.

Thanks!

- dan.
--- End Message ---
--- Begin Message ---
I've noticed with the release of PHP 4.2.0 that the register_globals has 
been turned off by default. While this is a wonderful thing for security 
it makes passing data between pages difficult link to link. While I am 
familiar with using sessions I was wondering if there were any tricks to 
passing data between pages using links like you would in this example.

http://blalba.com/test.php?db=camperboy

With the release of PHP 4.2.0 and register globals being off this no 
longer works. My menus are driven by posted variables and I would like 
to figure out a way to both pass the data but be secure about it too. 
Any help would be great thanks!.

-Smileyq
--- End Message ---
--- Begin Message ---
It still works, the value is in $_GET["db"]

---John Holmes...

----- Original Message ----- 
From: "Smileyq" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 24, 2002 6:09 AM
Subject: [PHP] Passing Variables with register_globals Off?


> I've noticed with the release of PHP 4.2.0 that the register_globals has 
> been turned off by default. While this is a wonderful thing for security 
> it makes passing data between pages difficult link to link. While I am 
> familiar with using sessions I was wondering if there were any tricks to 
> passing data between pages using links like you would in this example.
> 
> http://blalba.com/test.php?db=camperboy
> 
> With the release of PHP 4.2.0 and register globals being off this no 
> longer works. My menus are driven by posted variables and I would like 
> to figure out a way to both pass the data but be secure about it too. 
> Any help would be great thanks!.
> 
> -Smileyq
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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


Was the question "is it neccessary" or "how to do it secure"?

I myself don't tlike the idea,
But if needed, then this could be a way.


Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 3:51 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: [PHP] security


At 22.04.2002  15:17, you wrote:
>
>Search archives, as a tip I'd suggest to encrypt the Credit Card
>numbers with RC4 or some other algorithm.

Maxim,

I don´t agree your suggestion, as I mentioned earlier on the list, avoid

storing CC numbers
unless it´s absolutely necessary, you´ve got a good insurance, and are
your own ISP knowing a lot of network security. Your suggestions may
make php-coder think that it is possible to store these data secure. But
that´s 
not only
depending on php. If you store any data in an ISP-environment, you
cannot be shure that this is secure, as you don´t know how they set up
their servers, 
firewalls ...

I wouldn´t give this suggestion without any word on this.

Oliver


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



--- End Message ---
--- Begin Message ---
Hi - being new to the lists and noticing that the first few posts that came through 
have been reasonably specific and implementation based I was wondering if there were 
any other more general php solution type lists - or is it appropriate to post "is 
there a php solution for this" type questions to this list too?

Also being new to PHP development I was wondering if someone could point me in the 
direction of:

1) list archives for this list
2) good php script repository sites
3) any other php development related sites or lists that will help get me going!

thanks in advance, dan.
--- End Message ---
--- Begin Message ---
This is a PHP help list, if you've got a question, by all means just post it
here.  BUT!!  You will be given a short shift if it's obvious that you
haven't read the documentation first.


Download this, it's the most useful doovey I've ever downloaded:
http://www.php.net/download-docs.php

List Archives:
http://www.php.net/mailing-lists.php

Script sites:
http://www.hotscripts.com
http://www.phpclasses.org
The two best I rekon



----- Original Message -----
From: "Dan Horth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 24, 2002 8:55 PM
Subject: [PHP] PHP Lists


Hi - being new to the lists and noticing that the first few posts that came
through have been reasonably specific and implementation based I was
wondering if there were any other more general php solution type lists - or
is it appropriate to post "is there a php solution for this" type questions
to this list too?

Also being new to PHP development I was wondering if someone could point me
in the direction of:

1) list archives for this list
2) good php script repository sites
3) any other php development related sites or lists that will help get me
going!

thanks in advance, dan.

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



--- End Message ---
--- Begin Message ---
Dan,

PHP General is pretty much about anything related to PHP in General -)
There are also other lists, look at php.net under support.

As of your questions:

1) List archives (the wildest ones) are on:
        groups.google.com
        marc.theaimsgroup.com

2) That could be hotscripts.com and sourceofrge.com. Also the very nice
PHP Objects (classes) repository is at phpclasses.org.

3) Nice and educative sites on the web are a lot. I recommend you mine
as the start though: www.PHPBeginner.com. Also, check out
newbienetwork.net and devshed.com




Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins






-----Original Message-----
From: Dan Horth [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 24, 2002 12:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP Lists


Hi - being new to the lists and noticing that the first few posts that
came through have been reasonably specific and implementation based I
was wondering if there were any other more general php solution type
lists - or is it appropriate to post "is there a php solution for this"
type questions to this list too?

Also being new to PHP development I was wondering if someone could point
me in the direction of:

1) list archives for this list
2) good php script repository sites
3) any other php development related sites or lists that will help get
me going!

thanks in advance, dan.

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


--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 05:34 pm, you wrote:
> On Monday, April 22, 2002, at 03:47  PM, Andre Dubuc wrote:
> > I tried what you suggested, and indeed globals are off. Perhaps my
> > problem
> > stems from my use of the $_GET[] with $vars. I guess I don't really
> > understand what I'm doing. If you would take a peek at this code [I
> > think
> > I've introduced a security hole, and I'm mixing up things]:
>
> I think the problem you're having is basically understanding what
> register_globals does, and why some people might want to turn it off.
>
> register_globals takes a variable (doesn't matter if it's a server
> variable, a cookie variable, a post variable, or a get variable) and
> registers it as global throughout the script.  This means that if
> someone types
>
> http://www.domain.com/index.php?firstname=andre&lastname=dubuc
>
> into the "Address" bar of her browser, she has just requested the
> "index.php" resource from the server at "www.domain.com" using the HTTP
> protocol and sent two variables to the server using the GET method:
>
> $firstname = 'andre'
> $lastname = 'dubuc'
>
> If you have register_globals turned on, then your script can look like
> this:
>
> if ($firstname == 'andre' && $lastname == 'dubuc') {
>    // do something
> }
>
> and it still works.  However, if you have register_globals turned off,
> then the above 'if test' won't work.  This is because these variables
> are not $firstname and $lastname, they are $_GET['firstname'] and
> $_GET['lastname'].  To do an 'if test' with register_globals off, you
> should do:
>
> if ($_GET['firstname'] == 'andre' && $_GET['lastname'] == 'dubuc') {
>    // do something
> }
>
> There's really not much of a difference.  The thing is that instead of
> being a global variable, the data that you passed is now an element of
> the $_GET array.  So you use the standard element notation, using the
> associative index of the variable name.
>
> If you do this:
>
> $firstname = $_GET['firstname'];
> $lastname = $_GET['lastname'];
>
> ...you make your code simpler to understand, but be careful that you
> don't do something in the same script like
>
> $lastname = $row['last_name'];
>
> (which could happen if you were trying to simplify your MySQL result
> data.)
>
> I'll take a look at what you've got....
>
> > On page 1:
> >
> > <?php session_start(); ob_start(); ?>
> > // ob_start(); so I can have html headers on this page & redirect later
> > // some other code
> > <form action="page2.php" method="get">
> > <?php
> > // The following line is where I think I've caused myself grief.
> >
> > <input type=text size=20 name=bozo>
> >
> > <input type=submit name=submit value="Agree">
> > ?>
>
> Yeah, I'd say you've caused yourself some grief.  This isn't even
> related to register_globals -- you've got two HTML input tags in the
> middle of your PHP block.  You need to print() or echo these, not just
> type them in directly.
>
> print("<input type='text' size='20' name='bozo' />");
> print("<input type='submit' name='submit' value='Agree'>");
>
> > $bozo = $_GET['bozo'];
> >
> > /* Now is this correct? Am I exposing 'bozo'  to a security hole? For
> > the
> > rest of the script, with each $_GET['var'] from the previous page I do
> > the
> > same. Somehow, I don't think I've grasped what to do with $vars. From my
> > reading elsewhere, should I, for example, in page 1 use something like
> >
> >         <input type=text size=20 name="<?php  echo
> > $_SESSION['bozo'] ?>">
>
> I prefer to do it the way that you have read elsewhere, but it really
> doesn't matter.  Either way, you have a variable in your script that
> points to some user-specified data.  What you've done is simplified the
> results, similar to what some people do when they pull data out of a
> result set with mysql_fetch_array().  The only security hole is if you
> have written your script to do something unsafe with the $bozo variable.
>
> HOWEVER... bear in mind that now that you are referring to this variable
> in this fashion, you could end up inadvertently overwriting this
> variable with a new variable, by doing something like
>
> $bozo = $row['bozo'];
>
>   -- something that is far less likely to occur when referring to it as
> $_GET['bozo'].
>
> It really depends on how organized your code is.  If I were you, I would
> probably get into the habit of calling it $_GET['bozo'], since that just
> saves you time and stress in the long run.  The only security hole would
> be this:
>
> $_SESSION['admin'] = 'yes'; // indicates that user is an administrator
> $admin = $_SESSION['admin']; // simplify our variable name
>
> if ($admin == 'yes') { // if user is an administrator
>    // display some sensitive data
> }
>
> // for some stupid reason we do this
> $admin = $_GET['admin']; // obviously you wouldn't do something like this
>
> if ($admin == 'yes') {
>    // display some sensitive data
> }
>
> Essentially, in the above code, you've given the value of a GET variable
> called "admin" the same power as a session variable called "admin".
> This is bad practice in general, and I'm sure you wouldn't make this
> mistake.
>
> Simply making $admin = $_SESSION['admin'] does NOT mean that someone can
> type "admin=yes" into the querystring and automatically become the
> admin, because register_globals is OFF -- this means that
>
> $admin != $_GET['admin']
>
> unless you set it so.
>
> > Once I figure out how I'm supposed to write the variables in the
> > scripts,
> > I'll be OK. But I'm so CONFUSED!  */
> >
> > if  ($bozo == "") die ("Please enter your 'First Name'. <br><br> Click
> > 'Back" in your browser to enter this information.");
>
> This is fine.
>
> > /* This page is actually a confirmation page, I've tried to collect the
> > info
> > from page 1 ($bozo) and page 2 ($dodo) and print them to screen as in */
> >
> > $bozo = $_GET['bozo'];
> > $dodo = $_GET['dodo'];
> >
> > print $bozo $dodo;
> >
> > /* I've also tried $_SESSION['bozo'], $_GET['bozo'], left out the
> > '$bozo = $_GET['bozo']' etc, etc, etc. -- I don't know what I'm doing
> > here!! Help! !  */
> > ?>
>
> What seems to be the problem here?
>
>
>
> Erik
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]


Thanks Eric,

That clears up a lot. I sort of thought doing:

$bozo = $_GET['bozo']; 

would be OK. It seems it's the ONLY way my script will allow the array to be 
put into the database (PostgreSQL). If I type into the INSERT command 

        .... $bozo, $next_var, $next_next_var  // it works
        .... $_GET['bozo'], $_GET['next_var'], etc  // I get T_Variable undefined


**********************************************************

> > /* This page is actually a confirmation page, I've tried to collect the
> > info
> > from page 1 ($bozo) and page 2 ($dodo) and print them to screen as in */
> >
> > $bozo = $_GET['bozo'];
> > $dodo = $_GET['dodo'];
> >
> > print $bozo $dodo;
> >
> > /* I've also tried $_SESSION['bozo'], $_GET['bozo'], left out the
> > '$bozo = $_GET['bozo']' etc, etc, etc. -- I don't know what I'm doing
> > here!! Help! !  */
> > ?>
>
> What seems to be the problem here?

************************************************************

The problem here is that $_SESSION['anything'] or $_GET['anything'] doesn't 
work. It refuses to print or pass anything. Why? I can't figure that out?

I've tried a simple test, and yes the globals are off. But using the 

$bozo = $_GET['bozo'];  approach, at least it writes to the database, but I 
cannot access the arrays at all??? And, I HAVE to write these for ALL the 
variables, else it doesn't get passed to the db. 

Sigh. So where am I messing up?

Your help is great, btw. Thanks,
Andre


-- 
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.

May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/
--- End Message ---
--- Begin Message ---
Hi all,


I'm studying some mail scripts written in php. When sending html mail the scripts all 
use a method that involves sending an html file as attachment. 

Why not use the mailsend function and send a string containing the whole html code?


a code snippet example from a mail script:
----------------------------------
 $file = "mail.html";
        $mail->Body( "This mail is formatted in HTML - shame on me" );
        // inline intructs the mail client to display the HTML if it can
        $mail->Attach( $file, "text/html", "inline" );
----------------------------------



What I want is to send personalized html mail to users in a db-table. 
So the body of the mail starts with something like 


Dear "user"

I mail you because you are interested in: "interests"

and so on.....

I hope my question is a bit clear to everyone.

happy greetings,


Wilbert



-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---

Reply via email to