Re: [PHP] $HTTP_GET_VARS

2003-01-18 Thread Philip Olson

Everyone from this thread needs to reread this:

  http://www.php.net/variables.external

Regards,
Philip


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




Re: [PHP] Acessing $DOCUMENT_ROOT

2003-01-18 Thread Philip Olson
> How do I access $DOCUMENT_ROOT when register_gobals is set off?  I think
> there's an array, something like $HTTP_ENV_VARS['DOCUMENT_ROOT'] but I can't
> find it in the documentation.

http://www.php.net/variables.predefined

Regards,
Philip


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




[PHP] Unsupported operand types

2003-01-18 Thread Brian T. Allen
Hi,

I've just spent the night upgrading my RedHat 6.2 server to:

Apache1.3.27
PHP4.3.0
MySQL3.23.54a
Mod_SSL2.8.12
OpenSSL0.9.7
ZendOptimizer2.1.0

Now I'm getting (inconsistently):

PHP Fatal error:  Unsupported operand types in
/web/domain/html/includes/item.inc on line 35

That line contains:
$variable1 = $variable2 - 1;

Both variables may be unassigned prior to this line, or may have numeric
values.

In a related piece of weirdness, I have this included at the bottom of
every file:

");
?>

Which normally returns something like:

-
Errors:
1062:Duplicate entry '[EMAIL PROTECTED]' for key 1

Query:


Page:   /account/new.html 
Date:   Friday January 17, 200312:42 PM

But now it returns:

Errors:
Saturday January 18, 20033:18 AM:Saturday January 18, 20033:18
AM

Query:
Array

Page:   /community/newsletter.html/2001-03-01 
Date:   Array
-

How can $date be an array, when it gets assigned right above where it
gets called?

What am I missing in this new version of PHP that is making my scripts
seemingly incompatible?

Thanks,
Brian Allen


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




Re: [PHP] Ever complained about lousy PHP programmers?

2003-01-18 Thread olinux
I prefer single quotes on stuff that doesn't need to
be parsed. In most cases this is more efficient,
though  probably not noticed except on a large scale.
I also think it makes it easier to include html
strings (because double quotes don't need to be
escaped) and I find it easier to work my code in
Homesite.

echo ''.$something.' '.$something_else.'';
rather than 
echo "$something $something_else";



--- Peter Hutnick <[EMAIL PROTECTED]> wrote:
> Well, here's your chance to criticize a newbie.
> 
> As an exercise in learning PHP I have written a
> rot-13 script.  It is at
> http://hutnick.com/rot13/index.html?show_content=1 .
> 
> I'm soliciting comments on style, technique, etc. 
> Be brutal, but don't
> get your feelings hurt if I don't take your comments
> as gospel. 
> References will help me take comments to heart.
> 
> It will be easier on me if you send or CC comments
> to [EMAIL PROTECTED]
> 
> Thanks a million!
> 
> -Peter
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Re: PHP Review Site

2003-01-18 Thread Manuel Lemos
Hello,

On 01/17/2003 11:40 PM, Stephen wrote:

I was just wondering if there were any PHP review sites that review free 
and paid scripts? If so, where?

If your script is in the form of a PHP class of objects, you may want to 
try uploading it to the PHP Classes site. You will not get explict 
reviews, bu your work is exposed to tens of thousands of PHP users eager 
to learn about new classes.

http://www.phpclasses.org/


--

Regards,
Manuel Lemos


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



[PHP] Free PHP Hosts?

2003-01-18 Thread JJ Harrison
Until now I haven't had the need for a free PHP host because what I have
done has been commercial.

However, In this case I am doing the website for my PC Gaming clan. We are
one step below needing php to do alot of stuff.

Does anyone know of a free php webhost? (Banners, poop-ups etc are
exceptable).


--
---
JJ Harrison
[EMAIL PROTECTED]



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




[PHP] Re: occasional mcrypt problems

2003-01-18 Thread Steve Yates
"Steve Yates" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> After much testing, I think I may have it.  It appears that MySQL is
> dropping a trailing space from the value being inserted into the database!
> For example if the encrypted string is "(.A®¢m¸"¼'À " MySQL stores the
> value without the trailing space (and it is a space).  Why is that?

As with many "bugs" it's because I told it to!  To my surprise, MySQL
varchar fields have their trailing spaces removed on insertion.  Tinyblob or
Tinytext fields do not, so one needs to use those (or their larger brethren)
when saving encrypted or binary data to MySQL.  Thanks to those who tried to
help!

 - Steve Yates
 - Computers make very fast, very accurate mistakes.

~ Taglines by Taglinator - www.srtware.com ~



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




[PHP] Upload multiple files

2003-01-18 Thread Antti
I want to do this for multiple files. I tried to do this with a foreach 
-loop but I think I made some mistakes with the array "userfile". In 
this example userfile is just the "name" in the input tag. When 
uploading multiple files userfile is -ofcourse- an array like this: 
name='userfile[]'. Now I want to know how to handle with that array in 
somekind of a loop. For one file the script is this:

if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
   $namename=$_FILES['userfile']['name'];
move_uploaded_file($_FILES['userfile']['tmp_name'],"/path/$namename");
if (rename("/path/$namename", "/path/$uartist-$usong.mp3"))
{
 $query = "INSERT INTO table (column1,column2,column3) values 
('$value1','$value2','$value3')";
 mysql_query($query) or die ("Couldn't make query!");
 print "File Upload and rename succesful!";
} else { print "File Upload failed!"; }

}

antti


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



[PHP] Check for start_sessoin without causing header problems

2003-01-18 Thread SLanger
Hello

I checked the PHP manual and couldn't find anything on this...

When I call session_register() an implicit call to session_start() is 
executed. So if the session handling uses cookies to track the session and 
the call to session_register() is not before any output this will cause a 
header allready sent problem. Is this correct? 

If so how can I call a register session from within a class and make sure 
that the session is allready active and if not just print a warning. 

For background information: The class mentioned above is part of a 
classlib used by others and I can not guarantee that they call 
session_start since I have no controll over how my class lib gets 
included. 
So the issue here is if it is possible to create a backup for this problem 
or if I just have to rely on the user of the classlib to understand the 
mechanisms of session tracking. 
Any ideas on this? What do you consider best practice in this matter?

Thanks for all the advice I have received so far

Stefan


[PHP] Re: PUT uploads

2003-01-18 Thread Chris Jarecki
my php version is 4.3.0 :)



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




[PHP] Result in the same page

2003-01-18 Thread Ezequiel Sapoznik
It is possible to run a query in php when the user press a button an return
the result in the same page?

Thanks!

Ezequiel



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




Re: [PHP] Result in the same page

2003-01-18 Thread Jason Wong
On Saturday 18 January 2003 20:11, Ezequiel Sapoznik wrote:
> It is possible to run a query in php when the user press a button an return
> the result in the same page?

Yes.

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

/*
An idea is not responsible for the people who believe in it.
*/


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




RE: [PHP] Result in the same page

2003-01-18 Thread Cal Evans
Yes, just user $_SERVER['PHP_SELF'] as the action of your form. This will
cause the page to call itself. Then you can branch your processing on the
existence of a SUBMIT button (or whatever) and handle the query.

I do all my pages this way because it keeps all the code in a single page.
It's easier for me to find it that way.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Ezequiel Sapoznik [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 6:11 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Result in the same page


It is possible to run a query in php when the user press a button an return
the result in the same page?

Thanks!

Ezequiel



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




RE: [PHP] Ever complained about lousy PHP programmers?

2003-01-18 Thread Cal Evans
Since no one else has asked, I'll bite.  Why not just use str_rot13()?


The biggest problem I have with your code is that you didn't learn enough
about the language to know that this was already in the code. As a newb, you
need to set down with your favorite version of the manual (I keep the
windows help version open at all times) and familiarize yourself with the
language.  You do not need to memorize each function' signature but it would
help if you read the description of each function.  You'll be surprised what
you find in there.


=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Peter Hutnick [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 10:40 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Ever complained about lousy PHP programmers?


Well, here's your chance to criticize a newbie.

As an exercise in learning PHP I have written a rot-13 script.  It is at
http://hutnick.com/rot13/index.html?show_content=1 .

I'm soliciting comments on style, technique, etc.  Be brutal, but don't
get your feelings hurt if I don't take your comments as gospel.
References will help me take comments to heart.

It will be easier on me if you send or CC comments to [EMAIL PROTECTED]

Thanks a million!

-Peter



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.


Don't pick me
Pick me


Selecting both results in:

$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread John W. Holmes
> Is there any way to get all of the elements in a SELECT MULTIPLE box,
not
> just the ones that are selected?  Thanks!

No. You create the box, so you should know all of the possible values. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




php-general Digest 18 Jan 2003 14:53:08 -0000 Issue 1830

2003-01-18 Thread php-general-digest-help

php-general Digest 18 Jan 2003 14:53:08 - Issue 1830

Topics (messages 132074 through 132093):

Re: Gridwidget - javascript
132074 by: David Rice
132077 by: Jason Wong

Select multiple boxes
132075 by: Gregory Chagnon
132092 by: Cal Evans
132093 by: John W. Holmes

Re: Sessions or Cookies?
132076 by: Peter Janett

Re: $HTTP_GET_VARS
132078 by: Philip Olson

Re: Acessing $DOCUMENT_ROOT
132079 by: Philip Olson

Unsupported operand types
132080 by: Brian T. Allen

Re: Ever complained about lousy PHP programmers?
132081 by: olinux
132091 by: Cal Evans

Re: PHP Review Site
132082 by: Manuel Lemos

Free PHP Hosts?
132083 by: JJ Harrison

Re: occasional mcrypt problems
132084 by: Steve Yates

Upload multiple files
132085 by: Antti

Check for start_sessoin without causing header problems
132086 by: SLanger.spirit21.de

Re: PUT uploads
132087 by: Chris Jarecki

Result in the same page
132088 by: Ezequiel Sapoznik
132089 by: Jason Wong
132090 by: Cal Evans

Administrivia:

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

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

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---
Hi:
I believe that if you reference the form element like:

document.forms['mycell[]'].value

you will get what you want.
HTH
David

On Friday, January 17, 2003, at 08:33 PM, Nico Jansen - NiRo IT 
Consultants B.V. wrote:


Hi all,

I'm trying to write a grid widget in php. When the user changes the 
value of
a cell the totals must be recalculated at the client side.
I can write a javascript when I use simple variables like A1, B1.


onChange="njrecalculate()">

onChange="njrecalculate()">

This javascript will do the trick:

function njrecalculate()
{
 document.forms[0].mytot.value = 
Math.round(document.forms[0].A1.value)
+ Math.round(document.forms[0].B1.value)   ;

}

But now I want to create a dynamice grid by using the array variable 
e.g.
mycell[]:

echo "
onChange='njrecalculate()' value=$mycel[0]>";
echo "
onChange='njrecalculate()' value=$mycel[1]>";
echo "
onChange='njrecalculate()' value=$mytot>";
?>

Does anybody know how to access these mycell form fields on the client 
side
using javascript.


Nico Jansen



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



--- End Message ---
--- Begin Message ---
On Saturday 18 January 2003 10:50, David Rice wrote:

> > I'm trying to write a grid widget in php. When the user changes the
> > value of
> > a cell the totals must be recalculated at the client side.
> > I can write a javascript when I use simple variables like A1, B1.
> >
> >  > onChange="njrecalculate()">
> >  > onChange="njrecalculate()">
> >
> > This javascript will do the trick:
> >
> > function njrecalculate()
> > {
> >  document.forms[0].mytot.value =
> > Math.round(document.forms[0].A1.value)
> > + Math.round(document.forms[0].B1.value)   ;
> >
> > }
> >
> > But now I want to create a dynamice grid by using the array variable
> > e.g.
> > mycell[]:
> >  > echo " > onChange='njrecalculate()' value=$mycel[0]>";
> > echo " > onChange='njrecalculate()' value=$mycel[1]>";
> > echo " > onChange='njrecalculate()' value=$mytot>";
> > ?>
> >
> > Does anybody know how to access these mycell form fields on the client
> > side
> > using javascript.

> I believe that if you reference the form element like:
>
> document.forms['mycell[]'].value
>
> you will get what you want.

Which means you have to give your text elements unique names. IE mycel[0] 
instead of mycel[] etc.


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

/*
Today is a good day for information-gathering.  Read someone else's mail file.
*/


--- End Message ---
--- Begin Message ---
Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



--- End Message ---
--- Begin Message ---
use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.


Don't pick me
Pick me


Selecting both results in:

$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



-

RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
whoops. Sorry, didn't read the question. Wrong answer. John gave the correct
answer.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 8:41 AM
To: Gregory Chagnon; [EMAIL PROTECTED]
Subject: RE: [PHP] Select multiple boxes


use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.


Don't pick me
Pick me


Selecting both results in:

$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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



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




Re: [PHP] Ever complained about lousy PHP programmers?

2003-01-18 Thread michael kimsal
Olinux wrote:

I prefer single quotes on stuff that doesn't need to
be parsed. In most cases this is more efficient,
though  probably not noticed except on a large scale.
I also think it makes it easier to include html
strings (because double quotes don't need to be
escaped) and I find it easier to work my code in
Homesite.

echo ''.$something.' '.$something_else.'';
rather than 
echo "$something $something_else";



Both the zend accelerator (lower price for small businesses now)
and the ioncube system (free) optimize any minor
double-quote performance out after the first run, so it
should be a non-issue for more and more people.  Additionally,
as you mention, it's really only an issue on largescale
system (or systems under heavy load).

It's completely a comfortability issue - I personally
find the double-quoted version easier both to read and
to type.  It's not my favorite use of time to do extra
typing just to try to shave off 2 tenths of a millisecond
for the processor - computers are here to make life
easier (supposedly!)  :0

Michael Kimsal
LogiCreate
http://www.phpappserver.com
734-480-9961


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




Re: [PHP] Sessions or Cookies?

2003-01-18 Thread Chris Hewitt
Peter Janett wrote:


Sessions themselves use cookies, though, right?  So, if you want your app to
work for those who don't have cookies, you have to pass the session data in
the url string, at least that's my understanding.


With sessions, its only the session ID that is put in the cookie or url 
string. The session data stays on the server (usually in a file in 
/tmp). Its more secure than putting your data out to the client browser 
where it could be altered before being returned.

Regards

Chris


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



Re: [PHP] Select multiple boxes

2003-01-18 Thread Gregory Chagnon
The problem is I have 2 seelect boxes...it's for creating a user and adding
them to a list of available groups...so I have one select box that is
initially empty called memberOf and another box that has all of the
available groups listed in it called availableGroups.  I have a script that
can move items back and forth and when the form is submitted I want to be
able to get all the items that are in the memberOf box..anyh ideas on how to
to this?  THanks.
-Greg


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000501c2bf01$46464cc0$7c02a8c0@coconut">news:000501c2bf01$46464cc0$7c02a8c0@coconut...
> > Is there any way to get all of the elements in a SELECT MULTIPLE box,
> not
> > just the ones that are selected?  Thanks!
>
> No. You create the box, so you should know all of the possible values.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread John W. Holmes
> The problem is I have 2 seelect boxes...it's for creating a user and
> adding
> them to a list of available groups...so I have one select box that is
> initially empty called memberOf and another box that has all of the
> available groups listed in it called availableGroups.  I have a script
> that
> can move items back and forth and when the form is submitted I want to
be
> able to get all the items that are in the memberOf box..anyh ideas on
how
> to
> to this?  THanks.

Well, you create the "memberOf" box, right? How do you do that? At the
same time, create a javascript or hidden variable that has its contents
to be passed along with the form. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] Select multiple boxes

2003-01-18 Thread Cal Evans
What you are describing is a "2 List Mover". PHP is a server-side language
and as such knows nothing about what is going on on the client. Therefore
you have limited options. My favorite is :

In your form's onSubmit() put code to load all the values into a hidden
field. (Assuming you have defined the hidden field)



in your JavaScript put things like

document.mainForm.storeStuffHere.value += "storeStuffHere[1]='Value1'";
document.mainForm.storeStuffHere.value += "storeStuffHere[2]='Value2'";
document.mainForm.storeStuffHere.value += "storeStuffHere[3]='Value3'";

Then, when the form is submitted use:

parse_str($_POST['storeStuffHere']);

This will create the array storeStuffHere with the 3 values.

HTH,
=C=
*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 9:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Select multiple boxes


The problem is I have 2 seelect boxes...it's for creating a user and adding
them to a list of available groups...so I have one select box that is
initially empty called memberOf and another box that has all of the
available groups listed in it called availableGroups.  I have a script that
can move items back and forth and when the form is submitted I want to be
able to get all the items that are in the memberOf box..anyh ideas on how to
to this?  THanks.
-Greg


"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
000501c2bf01$46464cc0$7c02a8c0@coconut">news:000501c2bf01$46464cc0$7c02a8c0@coconut...
> > Is there any way to get all of the elements in a SELECT MULTIPLE box,
> not
> > just the ones that are selected?  Thanks!
>
> No. You create the box, so you should know all of the possible values.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>



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




[PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread -<[ Rene Brehmer ]>-
Hi gang

Been trying to figure out this session stuff, but since I was unable to
make the manual sample into something workable, I instead decided to
actually try and make the session do what I need it for: Passing the URL
of the caller page to the page that's being called.

1. Only I can't figure out if there's a function to just pull the current
URL and plop it into a session variable. The thing is that these pages are
all built by using a bunch of GET variables in the URL, so it would be
easiest to just do something like:

  $_SESSION['mother'] = $currentURL;

And then in the called, daughter, page do this:

>Get back to where you
came from

As the only other way I've found is to have it use the string-functions
and re-build the current URL throughout the if-tree that builds the page.
I need to pass the mother URL to the daughter pages because there's two
main entry-points into the daugther pages, and one of them can have 10-15
different states...

But how do you pull the current url? ParseURL just smacks it into an
array, and I'll then have to rebuild it anyway ... which makes it about
just as simple as running it through the if-tree. Whether or not the
session-id is inside the URL is not essential to me, but dunno if php
cares about it.

2. Since the above is required to function at all times, I need to
override the expiration time. I can't do it in the ini file, 'cause I
can't modify the server where it's to run, and it's set to 0 there... (not
sure if that means it expires right away, or not at all)

Anyway to do this???

TIA

Rene
-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




RE: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread Cal Evans
I guess I'm dense this morning. In response to 1:

$_SESSION['mother']=$_SERVER['PHP_SELF'];

and then

Go Back

or better yet...
Go Back

as to #2:
I usually just pass this kind of info around on the URL.

http://mypage.com/mypage.php?prevURL=http://mypage.com/lastpage.php

if I have to pass a full query string then I urlencode() it first and
urldecode() it on the other side.

This survives sessions expiring.
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: -<[ Rene Brehmer ]>- [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 10:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 2 Qs: Passing current URL with session and how to avoid
session timeout???


Hi gang

Been trying to figure out this session stuff, but since I was unable to
make the manual sample into something workable, I instead decided to
actually try and make the session do what I need it for: Passing the URL
of the caller page to the page that's being called.

1. Only I can't figure out if there's a function to just pull the current
URL and plop it into a session variable. The thing is that these pages are
all built by using a bunch of GET variables in the URL, so it would be
easiest to just do something like:

  $_SESSION['mother'] = $currentURL;

And then in the called, daughter, page do this:

>Get back to where you
came from

As the only other way I've found is to have it use the string-functions
and re-build the current URL throughout the if-tree that builds the page.
I need to pass the mother URL to the daughter pages because there's two
main entry-points into the daugther pages, and one of them can have 10-15
different states...

But how do you pull the current url? ParseURL just smacks it into an
array, and I'll then have to rebuild it anyway ... which makes it about
just as simple as running it through the if-tree. Whether or not the
session-id is inside the URL is not essential to me, but dunno if php
cares about it.

2. Since the above is required to function at all times, I need to
override the expiration time. I can't do it in the ini file, 'cause I
can't modify the server where it's to run, and it's set to 0 there... (not
sure if that means it expires right away, or not at all)

Anyway to do this???

TIA

Rene
--
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




Re: [PHP] Sessions or Cookies?

2003-01-18 Thread Brad Pauly
> Sessions themselves use cookies, though, right?  So, if you want your app to
> work for those who don't have cookies, you have to pass the session data in
> the url string, at least that's my understanding.

Cookies are used by default. However, if cookies are disabled in a
client, a session identifier will be passed via URL variable unless
session.use_only_cookies is enabled in php.ini.

Brad



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




[PHP] Can I use php to load a icon?????(.ico .exe .....)

2003-01-18 Thread hei
Can I use php to load a icon?(.ico .exe .)



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




Re: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread -<[ Rene Brehmer ]>-
Hi Ian M. Evans,

On Fri, 17 Jan 2003 14:04:15 -0500, you wrote about "[PHP] Converting
accented characters or numeric equivalents to non-accented" something that
looked like this:

>Does anyone have a quick PHP function for converting accented characters to
>their non-accented forms? It would really help a lot with Amazon searches,
>etc.

Not sure about quick, but the only way I've found that works with 100%
guarantee everytime is to take the string and check it character by
character, and if the ascii value is > 128, simply replace it with the
ascii value marker...

something like this (untested):

for ($i = 0; $i < strlen($string_to_parse); $i++) {
  $char = substr($string_to_parse, $i, 1);
  if (ord($char) > 128) {
$output_string .= "&#".ord($char).";";
  }
  else {
$output_string .= $char;
  }
}

You may need to test for value 127 ... not sure if it starts on 0 or 1
that is...

The above structure is what I use constantly to do this...

HTH

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




RE: [PHP] Can I use php to load a icon?????(.ico .exe .....)

2003-01-18 Thread Cal Evans
exactly how do you "load" an icon?  What are you loading it into?

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*
 

-Original Message-
From: hei [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 31, 2001 3:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Can I use php to load a icon?(.ico .exe .)


Can I use php to load a icon?(.ico .exe .)



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




[PHP] Does remote file(image) exist ?

2003-01-18 Thread Stephen of Blank Canvas
Hi Everyone,
 
Sorry I have no example code at all for this at all, I know some people
don't like that but I just do not know where to start so am asking for
help.
 
I have a system there users can put a picture of themselves by method of
URL in a MySQL field, however many of this image URL's do not work as
users type them in wrong.  So what I wanted to do was find a way to test
to see if the image can be accessed, then if not display a default
image.
 
Hope that makes sense, anyone already done something like this and want
to share code :-)
 
Stephen



Re: [PHP] Does remote file(image) exist ?

2003-01-18 Thread Andrew Brampton
If you looked at the usercomments for file_exists you would see it saying to
look at the fopen page for a example
In the usercomments for fopen there is a post saying this:

jamie.watt at murchison.com.au
03-Feb-2000 01:39
To check if a file exists using http or ftp use the following:


$fp = @fopen("http://www.someurl.com/testfile.php3","r";);
if ($fp)
{ print"The file exists!"; }
else
{ print"The file does not exist"; }


Note: The "@" in front of fopen suppresses the error output of the function.

I hope this clears up some confusion.

There is your answer :)


- Original Message -
From: "Stephen of Blank Canvas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 4:42 PM
Subject: [PHP] Does remote file(image) exist ?


> Hi Everyone,
>
> Sorry I have no example code at all for this at all, I know some people
> don't like that but I just do not know where to start so am asking for
> help.
>
> I have a system there users can put a picture of themselves by method of
> URL in a MySQL field, however many of this image URL's do not work as
> users type them in wrong.  So what I wanted to do was find a way to test
> to see if the image can be accessed, then if not display a default
> image.
>
> Hope that makes sense, anyone already done something like this and want
> to share code :-)
>
> Stephen
>


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




Re: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Chris Hewitt
-<[ Rene Brehmer ]>- wrote:


something like this (untested):

for ($i = 0; $i < strlen($string_to_parse); $i++) {
 $char = substr($string_to_parse, $i, 1);
 if (ord($char) > 128) {
   $output_string .= "&#".ord($char).";";
 }
 else {
   $output_string .= $char;
 }
}

You may need to test for value 127 ... not sure if it starts on 0 or 1
that is...


127 is the last of the 7bit numbers (0111), 128 has the 8th bit on 
(1000), so perhaps you want to test for > 127 rather than > 128.

Regards

Chris


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



Re: [PHP] Number Sign in String Variables

2003-01-18 Thread Joab Stieglitz
OK.  I found the problem, and it isn't PHP or MySQL related.  It's an HTML
problem.  I'm passing the string from one script to another, and the # sign
is screwing up the URL.

For example, this URL:

add_to_cart.php?item_num=SOU3432410&quantity=1&sale_price=24.92&unit=BX
&short_desc=ENVELOPE,25%COT 24#,IY&wholesaler=US&cost=18.690

gets cut off at the # sign, so $wholesaler and $cost come out empty.

Any suggestions to get around this?



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




Re: [PHP] Does remote file(image) exist ?

2003-01-18 Thread pan
reply to both mail list and O.P.

- Original Message - 
From: "Stephen of Blank Canvas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 08:42
Subject: [PHP] Does remote file(image) exist ?


> Hi Everyone,
>  
> Sorry I have no example code at all for this at all, I know some people
> don't like that but I just do not know where to start so am asking for
> help.
>  
> I have a system there users can put a picture of themselves by method of
> URL in a MySQL field, however many of this image URL's do not work as
> users type them in wrong.  So what I wanted to do was find a way to test
> to see if the image can be accessed, then if not display a default
> image.
>  
> Hope that makes sense, anyone already done something like this and want
> to share code :-)
>  
> Stephen
> 

Use curl, 
or
write a script that executes a telnet session that issues
HEAD commands

The key command is the "HEAD path-to-resource HTTP/1.0"

Most servers are HTTP/1.1, but using 1.0 keeps backward compatibility.

The path-to-resource is whatever the path is that would appear after the
domain in the url.

You would want to split the submitted URL into domain and path.

You issue the telnet to $domain at port 80
"telnet $domain 80"

You issue the HEAD command
"HEAD /path-to-resource HTTP/1.0"

What follows is the servers response. I've included live
examples of both a 200 response (resource exists)
and a 404 response (resource does not exist).

Parse the responses and you will know that something
exists or not.

# telnet $domain 80
Trying {ip address}...
Connected to $domain
Escape character is '^]'.
HEAD /pov/box.png HTTP/1.0

HTTP/1.1 200 OK
Date: Sat, 18 Jan 2003 17:30:12 GMT
Server: Apache/1.3.27 (Unix) PHP/4.2.3
Last-Modified: Fri, 13 Dec 2002 23:29:56 GMT
ETag: "32e005-8c1d-3dfa6d74"
Accept-Ranges: bytes
Content-Length: 35869
Connection: close
Content-Type: image/png

Connection closed by foreign host.
# telnet $domain 80
Trying {ip address}...
Connected to $domain
Escape character is '^]'.
HEAD /pov/box1.png HTTP/1.0

HTTP/1.1 404 Not Found
Date: Sat, 18 Jan 2003 17:30:58 GMT
Server: Apache/1.3.27 (Unix) PHP/4.2.3
Connection: close
Content-Type: text/html; charset=iso-8859-1

Connection closed by foreign host.


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




[PHP] hyperlink and mySQL

2003-01-18 Thread M.E. Suliman
Hi

I have created a simple script that pulls the three latest news entries from
a mySQL database and displays it on a webpage.   At the end of the preview
paragraph of the news story there is a hyperlink to access the full text
specific to that preview.  How would I do this?  Any ideas would be
appreciated.

Mohamed


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




Re: [PHP] Number Sign in String Variables

2003-01-18 Thread Brad Pauly
> For example, this URL:
> 
> add_to_cart.php?item_num=SOU3432410&quantity=1&sale_price=24.92&unit=BX
> &short_desc=ENVELOPE,25%COT 24#,IY&wholesaler=US&cost=18.690
> 
> gets cut off at the # sign, so $wholesaler and $cost come out empty.
> 
> Any suggestions to get around this?

You could use urlencode() and urldecode().

http://www.php.net/manual/en/function.urlencode.php
http://www.php.net/manual/en/function.urldecode.php

Brad



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




RE: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Ian M. Evans
Rene:

Thanks for the response. I guess I wasn't too clear in my original post. I'm
not looking to turn an accented letter into its numeric equivalent, I'm
looking to strip the accent so that Renée Zellweger becomes Renee Zellweger.

Any thoughts there?


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




Re: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Ernest E Vogelsinger
At 17:25 18.01.2003, -<[ Rene Brehmer ]>- said:
[snip]
>Not sure about quick, but the only way I've found that works with 100%
>guarantee everytime is to take the string and check it character by
>character, and if the ascii value is > 128, simply replace it with the
>ascii value marker...
>
>something like this (untested):
>
>for ($i = 0; $i < strlen($string_to_parse); $i++) {
>  $char = substr($string_to_parse, $i, 1);
>  if (ord($char) > 128) {
>$output_string .= "&#".ord($char).";";
>  }
>  else {
>$output_string .= $char;
>  }
>}
>
>You may need to test for value 127 ... not sure if it starts on 0 or 1
>that is...
[snip] 

preg_replace('([\x80-\xff])/e', '&#'.ord('\1').';', $string_to_parse);



-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Ernest E Vogelsinger
At 19:11 18.01.2003, Ian M. Evans said:
[snip]
>Thanks for the response. I guess I wasn't too clear in my original post. I'm
>not looking to turn an accented letter into its numeric equivalent, I'm
>looking to strip the accent so that Renée Zellweger becomes Renee Zellweger.
[snip] 

$chars_in = array('Á',''á','É','é');  // you get it
$chars_out = array('A','a','E','e');  // this too
preg_replace($chars_in, $chars_out, $string_to_parse);


-- 
   >O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Ian M. Evans
Ernest E. Vogelsinger suggested:
>$chars_in = array('Á',''á','É','é');  // you get it
>$chars_out = array('A','a','E','e');  // this too
>preg_replace($chars_in, $chars_out, $string_to_parse);

I initially got a 'no ending delimiter' error but after adding /'s to the
$chars_in it was just what the doctor ordered.

I'm actually a little surprised that there isn't a built-in function, say,
strip_accent(). I'd assume a lot of people would need this at some time or
another.


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




[PHP] Logfile statistics - get words from position between other words

2003-01-18 Thread Svein O. Bennæs
I'm trying to write a script that extracts some search-queries from a
logfile, but I'm having problems finding the right function to solve this
problem.

Below you'll find 4 lines from the log - the words I'm trying to extract are
(for now) written in capital letters, and they are always found between the
expression "query=" and "&hits=".

Straightforward; I am trying to get everything between "query=" and "&hits="
on each line, and output statistics on different search queries on a web
page. Probably an easy thing to do, but I'm kinda stuck on this one...

*

192.168.0.1 - - [20/Dec/2002:12:19:24 +0100] "GET
/cgi-bin/search?query=WORD&hits=10&offset=0&clustering=yes&type=all&version=
3.1.0 HTTP/1.1" 200 917 ""0.0310 0. 0. 0

192.168.0.1 - - [20/Dec/2002:12:19:25 +0100] "GET
/cgi-bin/search?query=ANOTHERWORD&hits=10&offset=0&clustering=yes&type=all&v
ersion=3.1.0 HTTP/1.1" 200 917 ""0.0150 0. 0. 0

192.168.0.1 - - [20/Dec/2002:12:19:27 +0100] "GET
/cgi-bin/search?query=YETANOTHERWORD&hits=10&offset=0&clustering=yes&type=al
l&version=3.1.0 HTTP/1.1" 200 917 ""0.0310 0. 0. 0

192.168.0.1 - - [20/Dec/2002:12:19:53 +0100] "GET
/cgi-bin/search?query=AGAINWITHTHEWORD&hits=10&offset=0&qtf_lemmatize=true&r
pf_clustering:enabled=1&rpf_clustering:root=%2A&clustering=yes&type=all&vers
ion=3.1.0 HTTP/1.1" 200 980 ""0.0310 0. 0. 0

*

TIA

[EMAIL PROTECTED]



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




Re: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Paul Roberts
another one for you

function removeaccents($string) {
   return strtr($string,
 "SOZsozY¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ",
 "SOZsozYYuAAACDNOOYsaaaconooyy");
}

Best Wishes & Happy New Year

Paul Roberts
[EMAIL PROTECTED]

- Original Message - 
From: "Ian M. Evans" <[EMAIL PROTECTED]>
To: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 6:41 PM
Subject: RE: [PHP] Converting accented characters or numeric equivalents to 
non-accented


Ernest E. Vogelsinger suggested:
>$chars_in = array('Á',''á','É','é');  // you get it
>$chars_out = array('A','a','E','e');  // this too
>preg_replace($chars_in, $chars_out, $string_to_parse);

I initially got a 'no ending delimiter' error but after adding /'s to the
$chars_in it was just what the doctor ordered.

I'm actually a little surprised that there isn't a built-in function, say,
strip_accent(). I'd assume a lot of people would need this at some time or
another.


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




Re: [PHP] Logfile statistics - get words from position between otherwords

2003-01-18 Thread Sean Burlington
Svein O. Bennæs wrote:

I'm trying to write a script that extracts some search-queries from a
logfile, but I'm having problems finding the right function to solve this
problem.

Below you'll find 4 lines from the log - the words I'm trying to extract are
(for now) written in capital letters, and they are always found between the
expression "query=" and "&hits=".

Straightforward; I am trying to get everything between "query=" and "&hits="
on each line, and output statistics on different search queries on a web
page. Probably an easy thing to do, but I'm kinda stuck on this one...

*

192.168.0.1 - - [20/Dec/2002:12:19:24 +0100] "GET
/cgi-bin/search?query=WORD&hits=10&offset=0&clustering=yes&type=all&version=
3.1.0 HTTP/1.1" 200 917 ""0.0310 0. 0. 0

192.168.0.1 - - [20/Dec/2002:12:19:25 +0100] "GET
/cgi-bin/search?query=ANOTHERWORD&hits=10&offset=0&clustering=yes&type=all&v
ersion=3.1.0 HTTP/1.1" 200 917 ""0.0150 0. 0. 0

192.168.0.1 - - [20/Dec/2002:12:19:27 +0100] "GET
/cgi-bin/search?query=YETANOTHERWORD&hits=10&offset=0&clustering=yes&type=al
l&version=3.1.0 HTTP/1.1" 200 917 ""0.0310 0. 0. 0

192.168.0.1 - - [20/Dec/2002:12:19:53 +0100] "GET
/cgi-bin/search?query=AGAINWITHTHEWORD&hits=10&offset=0&qtf_lemmatize=true&r
pf_clustering:enabled=1&rpf_clustering:root=%2A&clustering=yes&type=all&vers
ion=3.1.0 HTTP/1.1" 200 980 ""0.0310 0. 0. 0

*


try this



$line = '192.168.0.1 - - [20/Dec/2002:12:19:27 +0100] 
"GET/cgi-bin/search?query=YETANOTHERWORD&hits=10&offset=0&clustering=yes&type=all&version=3.1.0 
HTTP/1.1" 200 917 ""0.0310 0. 0. 0';
preg_match("/query=([^&]*)/", $line, $matches);

echo $matches[1];

?>





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



[PHP] passing variables to a sql statement

2003-01-18 Thread jennifer
hi, i'm hoping someone can help me out here - im trying to pass a variable from a 
string in the href tag, however my sql breaks when i put a var in the statment.
when i replace $foo with a number, the page works fine. can someone please tell me 
what im doing wrong?

here is the error i get:

Warning: Supplied argument is not a valid MySQL result resource in 
/home/villany2k1/www.villany2k1.com/htdocs/projects/projects_descrip.php on line 11



here is my code:

descrip;

echo("");
echo("" . "$foo" . " | ");
echo("");

  }


?>

thanks in advance, 
jennifer



[PHP] Multiple sizes for products

2003-01-18 Thread [EMAIL PROTECTED]
Hi all,

I'm making this web site, where the owner or administrator will be able to
upload new products and these products come in different sizes. Now, I made
a table in MySQL o store the products but only with a VARCHAR field where
the administrator will store the sizes like "12, 14, 16 and 18".

I would like to store the sizes for each product in a different table, but
my question refers on how to do this... one product per row with all the
different sizes (which will leave too many blank fields in every row) or
one size per row, making several rows per product.

Thanks in advance,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


mail2web - Check your email from the web at
http://mail2web.com/ .



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




[PHP] Auto Incrementing in PHP

2003-01-18 Thread Don Mc Nair
Hi

Is there a way for a php page to automatically increment a number and store
it every time the page is loaded.

I want to generate an invoice number that goes up 1 everytime the HTML form
is sent to it.

Thanks


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.435 / Virus Database: 244 - Release Date: 01/01/2003



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




Re: [PHP] passing variables to a sql statement

2003-01-18 Thread Jason Wong
On Sunday 19 January 2003 03:50, jennifer wrote:
> hi, i'm hoping someone can help me out here - im trying to pass a variable
> from a string in the href tag, however my sql breaks when i put a var in
> the statment. when i replace $foo with a number, the page works fine. can
> someone please tell me what im doing wrong?

Do you mean $foo or $foobar? In the URL below it seems as if you really mean 
$foobar?

And please give an example of where $foo (or $foobar) passed in the URL 
doesn't work.

> here is the error i get:
>
> Warning: Supplied argument is not a valid MySQL result resource in

Search the archives to find out the common causes of this error (it's an 
__extremely__ FAQ).

Read up on the uses of mysql_error().


> here is my code:
>
>  $hostName="localhost";
> $userName="";
> $password="";
> $database= "projects";
> $tableName="project_descrip";
>
> $descripQuery = "SELECT descrip from project_descrip where rowid=$foo";
> mysql_connect($hostName, $userName, $password);
> $descripResult = mysql_db_query($database,$descripQuery);
>while($row = mysql_fetch_object($descripResult)){
>
> $foo = $row->descrip;
>
> echo("");
> echo("" . "$foo" . " | ");
> echo("");
>
>   }
>
>
> ?>

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

/*
There is something in the pang of change
More than the heart can bear,
Unhappiness remembering happiness.
-- Euripides
*/


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




RE: [PHP] Converting accented characters or numeric equivalents to non-accented

2003-01-18 Thread Ian M. Evans
>return strtr($string, "SOZsozY...

Just curious why the search starts with unaccented "SOZsozY"?

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




Re: [PHP] Sessions or Cookies?

2003-01-18 Thread Chris Shiflett
--- Peter Janett <[EMAIL PROTECTED]> wrote:
> Sessions themselves use cookies, though, right?
> So, if you want your app to work for those who
> don't have cookies, you have to pass the session
> data in the url string, at least that's my
> understanding.

That's not quite right.

Session management requires an existing method of state
management. The default state management mechanism used by
PHP is indeed cookies, but that is not the only way. All
that is required for state management is that you assign
the Web client a unique identifier that it includes on
subsequent requests. Cookies make this easy and are
somewhat "automatic" in PHP, but GET and POST variables can
also be used.

For example, say you normally depend on a cookie to
identify the client. This will probably be something like
PHPSESSID=12345. The following link would send the same
unique identifier as a GET variable:

Click Here

Unless you have PHP configured to only use cookies to
identify the client (which I think is not the default
setting anyway), it will use the PHPSESSID when sent on the
URL like this. In fact, you can configure PHP to append the
unique identifier to the URL automatically if the client
does not accept cookies. Just set session.use_trans_sid to
1 in your php.ini file if you compiled PHP with
--enable_trans_sid.

As I hope is clear, none of this requires that any client
data be passed on the URL, in cookies, or anything else.
The only data that should be sent by the client is data
necessary for client identification. All other data can
(and should in most cases) be stored on the server.

Chris

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




Re: [PHP] Check for start_sessoin without causing header problems

2003-01-18 Thread Chris Shiflett
--- [EMAIL PROTECTED] wrote:
> how can I call a register session from within a
> class and make sure that the session is allready
> active and if not just print a warning.

This is closely related; you can check to see whether
headers have already been sent:

http://www.php.net/manual/en/function.headers-sent.php

If they have not, it does not matter if you start the
session or use an existing one.

You can probably use session_name() to check for an
existing session. It is worth experimenting with anyway.

Chris

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




RE: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread Chris Shiflett
--- Cal Evans <[EMAIL PROTECTED]> wrote:
> I usually just pass this kind of info around on the URL.
> 
>
http://mypage.com/mypage.php?prevURL=http://mypage.com/lastpage.php
> 
> if I have to pass a full query string then I urlencode()
> it first and urldecode() it on the other side.

Just as a bit of advice, you should always URL encode any
data you want to append to the URL like that. Also,
decoding it is superfluous, because the Web server will do
that for you (since URL data is supposed to be URL
encoded).

Chris

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




[PHP] PGP signing text from called from PHP

2003-01-18 Thread {R}ichard Ashton
Using PHP 4.1.2  I need to PGP sign a piece of text and detached the signature. I have 
read a lot in the archives and and about the better exec() calls in 4.3.

However I cannot find a reference that indicates the best way to pass a set of 
arguments out of a PHP script to PGP.

I need to use pgp2.6.3i the pgp command line looks like a bit this

pgp -sabf -u "pgpuser"  "pgppassphrase"  <"text"   >"pgpsignature" 

This has to be given to the Bash Shell with whatever works exec() system() or 
passthrough(), any output can be retrieved later . 

It is possible, if anyone knows how, to set ENV variable in the shell to preload the 
passphrase and the pgpuser into ENV variables.

Has anyone cracked this? Any pointers to archived messages I have missed.

Any suggestions at all would be most welcome.

{R}



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




RE: [PHP] Auto Incrementing in PHP

2003-01-18 Thread John W. Holmes
> Is there a way for a php page to automatically increment a number and
> store
> it every time the page is loaded.
> 
> I want to generate an invoice number that goes up 1 everytime the HTML
> form
> is sent to it.

I assume you're talking about incrementing for everyone that accesses
your site. For that you need a database to keep track of the number for
all users. You'd be replicating an "Application Variable" that other
languages have.

If you're talking about incrementing on a per user basis, i.e. each time
a specific user goes to the form, increment their number, then use
sessions to keep a count.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] Multiple sizes for products

2003-01-18 Thread John W. Holmes
> I'm making this web site, where the owner or administrator will be
able to
> upload new products and these products come in different sizes. Now, I
> made
> a table in MySQL o store the products but only with a VARCHAR field
where
> the administrator will store the sizes like "12, 14, 16 and 18".
> 
> I would like to store the sizes for each product in a different table,
but
> my question refers on how to do this... one product per row with all
the
> different sizes (which will leave too many blank fields in every row)
or
> one size per row, making several rows per product.

Sounds like you want a SET column, where you can define the different
values it can contain and it can contain any of those values.

So, if you have a SET(12,14,16,18) column, it can have values like
'12,18' and '14,16,18' and '12', etc...

You can then use functions such as FIND_IN_SET to quickly look for
specific values. Note that this would be quicker than using a plain
VARCHAR column to store a comma separated string. 

Or, you could have a 'size' table where you store the Item_ID and a
size. So you'd have rows like this:

+--+--+
| Item | Size |
+--+--+
| 1|12|
| 1|14|
| 2|14|
| 3|16|
| 3|18|
+--+--+

And do JOINs to find your relevant data.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] passing variables to a sql statement

2003-01-18 Thread John W. Holmes
> hi, i'm hoping someone can help me out here - im trying to pass a
variable
> from a string in the href tag, however my sql breaks when i put a var
in
> the statment.
> when i replace $foo with a number, the page works fine. can someone
please
> tell me what im doing wrong?
> 
> here is the error i get:
> 
> Warning: Supplied argument is not a valid MySQL result resource in
>
/home/villany2k1/www.villany2k1.com/htdocs/projects/projects_descrip.php
> on line 11

That means your query failed. Use mysql_error() to find out why. 
 
> here is my code:
> 
>  $hostName="localhost";
> $userName="";
> $password="";
> $database= "projects";
> $tableName="project_descrip";
> 
> $descripQuery = "SELECT descrip from project_descrip where
rowid=$foo";
> mysql_connect($hostName, $userName, $password);
> $descripResult = mysql_db_query($database,$descripQuery);
>while($row = mysql_fetch_object($descripResult)){

You shouldn't be using mysql_db_query() for one, it's depreciated. Use
mysql_select_db() along with mysql_query().

If rowid is an integer, then you don't need quotes around $foo,
otherwise, if it's a string, then you do.

where rowid='$foo'

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] File perms when dir already exists

2003-01-18 Thread rw

Hello all!

I have a number of scripts that upload 5 files at a time each.
The first one creates the dir using umask(000)and mkdir($dir,0777)
which gives the first five files perms 777, which is what I want.

I have the subsequent scripts check if the dir exists and if not does the same
thing with umask and mkdir.  The problem is the uploaded files in scripts 2
through 5 do not inherit the perms 777.

The script:

if (!is_dir("/mnt/ls6/17/169//htdocs/2003/uploads/$mls")){
umask(000);
mkdir($dir,0777)or die("couldn't create directory");
}
$path1=$dir . "/1.jpg"; 
move_uploaded_file( $upload1, $path1)or die("couldn't upload photo");   
$sql = (" UPDATE gallery SET img1 = '1' WHERE mls = '$mls';"); 

Is there a parameter I can include in move_uploaded_file() to set the perms on
the remaining files?

Any help is greatly appreciated.

RW

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




Re: [PHP] Number Sign in String Variables

2003-01-18 Thread Joab Stieglitz
OK.  I urlencoded the URL and now the URL passes correctly...

add_to_cart.php%3Fitem_num%3DSTT32700%26quantity%3D1%26sale_price%3D52.78%26
unit%3DBX%26short_desc%3DENVELOPE%2C100%25COT%2024%23%2CGY%26wholesaler%3DUS
%26cost%3D37.700

... but I get the following error:

Forbidden
You don't have permission to access
/carmae/add_to_cart.php?item_num=STT32700&quantity=1&sale_price=52.78&unit=B
X&short_desc=ENVELOPE,100%COT 24#,GY&wholesaler=US&cost=37.700 on this
server.

I've never seen anything like this before.

Suggestions?

"Brad Pauly" <[EMAIL PROTECTED]> wrote in message
1042912825.15063.33.camel@earth">news:1042912825.15063.33.camel@earth...
> > For example, this URL:
> >
> > add_to_cart.php?item_num=SOU3432410&quantity=1&sale_price=24.92&unit=BX
> > &short_desc=ENVELOPE,25%COT 24#,IY&wholesaler=US&cost=18.690
> >
> > gets cut off at the # sign, so $wholesaler and $cost come out empty.
> >
> > Any suggestions to get around this?
>
> You could use urlencode() and urldecode().
>
> http://www.php.net/manual/en/function.urlencode.php
> http://www.php.net/manual/en/function.urldecode.php
>
> Brad
>
>



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




[PHP] Re: hyperlink and mySQL

2003-01-18 Thread Bobby Patel
I have done something similar:
write a script that takes an Article ID, and displays the text. So to
displat article #3, you would call it like getArticle.php?id=3.
Skelton for getArticle.php
- take id and store in $id
- Select FullBody from Articles where ID = $id
- $body = query['FullBody']
- then echo $body

That's the basic idea, if you have any problems email me and post to the
list.




"M.E. Suliman" <[EMAIL PROTECTED]> wrote in message
000f01c2bf1b$e95fff40$4abe1fc4@b1s0n2">news:000f01c2bf1b$e95fff40$4abe1fc4@b1s0n2...
> Hi
>
> I have created a simple script that pulls the three latest news entries
from
> a mySQL database and displays it on a webpage.   At the end of the preview
> paragraph of the news story there is a hyperlink to access the full text
> specific to that preview.  How would I do this?  Any ideas would be
> appreciated.
>
> Mohamed
>



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




RE: [PHP] Number Sign in String Variables

2003-01-18 Thread John W. Holmes
> OK.  I urlencoded the URL and now the URL passes correctly...
> 
>
add_to_cart.php%3Fitem_num%3DSTT32700%26quantity%3D1%26sale_price%3D52.7
8%
> 26
>
unit%3DBX%26short_desc%3DENVELOPE%2C100%25COT%2024%23%2CGY%26wholesaler%
3D
> US
> %26cost%3D37.700
> 
> ... but I get the following error:
> 
> Forbidden
> You don't have permission to access
>
/carmae/add_to_cart.php?item_num=STT32700&quantity=1&sale_price=52.78&un
it
> =B
> X&short_desc=ENVELOPE,100%COT 24#,GY&wholesaler=US&cost=37.700 on this
> server.
> 
> I've never seen anything like this before.

And the line you get that error looks like? It looks like you're trying
to fopen() a file that's made up of PHP_SELF and the QUERY_STRING.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




[PHP] Re: Auto Incrementing in PHP

2003-01-18 Thread Bobby Patel
One quick note, if you DO NOT have access to a database, you could store
that incremented number to a file. And open and retrieve, and increment
every time you need. If you need to take this approach checkout php.net and
search for "fopen".



"Don Mc Nair" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> Is there a way for a php page to automatically increment a number and
store
> it every time the page is loaded.
>
> I want to generate an invoice number that goes up 1 everytime the HTML
form
> is sent to it.
>
> Thanks
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.435 / Virus Database: 244 - Release Date: 01/01/2003
>
>



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




RE: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread John W. Holmes
1. You can "create" the current page with a combination of PHP_SELF,
QUERY_STRING, etc... Take a look at a phpinfo() page to see all of the
variables. 

2. You can use ini_set() in your code to change the settings for your
sessions or an .htaccess file if your on *nix. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: -<[ Rene Brehmer ]>- [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 18, 2003 11:04 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] 2 Qs: Passing current URL with session and how to avoid
> session timeout???
> 
> Hi gang
> 
> Been trying to figure out this session stuff, but since I was unable
to
> make the manual sample into something workable, I instead decided to
> actually try and make the session do what I need it for: Passing the
URL
> of the caller page to the page that's being called.
> 
> 1. Only I can't figure out if there's a function to just pull the
current
> URL and plop it into a session variable. The thing is that these pages
are
> all built by using a bunch of GET variables in the URL, so it would be
> easiest to just do something like:
> 
>   $_SESSION['mother'] = $currentURL;
> 
> And then in the called, daughter, page do this:
> 
> >Get back to where you
> came from
> 
> As the only other way I've found is to have it use the
string-functions
> and re-build the current URL throughout the if-tree that builds the
page.
> I need to pass the mother URL to the daughter pages because there's
two
> main entry-points into the daugther pages, and one of them can have
10-15
> different states...
> 
> But how do you pull the current url? ParseURL just smacks it into an
> array, and I'll then have to rebuild it anyway ... which makes it
about
> just as simple as running it through the if-tree. Whether or not the
> session-id is inside the URL is not essential to me, but dunno if php
> cares about it.
> 
> 2. Since the above is required to function at all times, I need to
> override the expiration time. I can't do it in the ini file, 'cause I
> can't modify the server where it's to run, and it's set to 0 there...
(not
> sure if that means it expires right away, or not at all)
> 
> Anyway to do this???
> 
> TIA
> 
> Rene
> --
> Rene Brehmer
> 
> This message was written on 100% recycled spam.
> 
> Come see! My brand new site is now online!
> http://www.metalbunny.net
> 
> --
> 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




[Fwd: Re: [PHP] Number Sign in String Variables]

2003-01-18 Thread Brad Pauly
Oops...

-Forwarded Message-

From: Brad Pauly <[EMAIL PROTECTED]>
To: Joab Stieglitz <[EMAIL PROTECTED]>
Subject: Re: [PHP] Number Sign in String Variables
Date: 18 Jan 2003 16:40:40 -0700

> OK.  I urlencoded the URL and now the URL passes correctly...
> 
> add_to_cart.php%3Fitem_num%3DSTT32700%26quantity%3D1%26sale_price%3D52.78%26
> unit%3DBX%26short_desc%3DENVELOPE%2C100%25COT%2024%23%2CGY%26wholesaler%3DUS
> %26cost%3D37.700
> 
> ... but I get the following error:
> 
> Forbidden
> You don't have permission to access
> /carmae/add_to_cart.php?item_num=STT32700&quantity=1&sale_price=52.78&unit=B
> X&short_desc=ENVELOPE,100%COT 24#,GY&wholesaler=US&cost=37.700 on this
> server.

Your web server is trying to find a directory with that long name. If
you encode the entire string, you need to pass it in a new variable,
then break it apart again.
 
> Suggestions?

Sorry, I gave some bad advice the first time. All you need to do is
urlencode each of the variables individually. Something like this:

$item_num_encoded = urlencode($item_num);
[...]

Then your link will be something like this:

add_to_cart.php?item_num=$item_num_encoded


Brad







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




[PHP] Re: passing variables to a sql statement

2003-01-18 Thread Bobby Patel
It seems that error is from an ill-formed MySql statement. Try this,
$descripQuery = "SELECT descrip from project_descrip where rowid=$foo";
echo $descripQuery ; // put in this echo after the query.
$descripResult = mysql_query($descripQuery);
echo mysql_error(); file://put this echo after query execution

Now, run it and see on screen what query is actually executed.

"Jennifer" <[EMAIL PROTECTED]> wrote in message
003401c2bf2b$0a042d20$8101a8c0@fvcrx01">news:003401c2bf2b$0a042d20$8101a8c0@fvcrx01...
> hi, i'm hoping someone can help me out here - im trying to pass a variable
from a string in the href tag, however my sql breaks when i put a var in the
statment.
> when i replace $foo with a number, the page works fine. can someone please
tell me what im doing wrong?
>
> here is the error i get:
>
> Warning: Supplied argument is not a valid MySQL result resource in
/home/villany2k1/www.villany2k1.com/htdocs/projects/projects_descrip.php on
line 11
>
>
>
> here is my code:
>
>  $hostName="localhost";
> $userName="";
> $password="";
> $database= "projects";
> $tableName="project_descrip";
>
> $descripQuery = "SELECT descrip from project_descrip where rowid=$foo";
> mysql_connect($hostName, $userName, $password);
> $descripResult = mysql_db_query($database,$descripQuery);
>while($row = mysql_fetch_object($descripResult)){
>
> $foo = $row->descrip;
>
> echo("");
> echo("" . "$foo" . " |
");
> echo("");
>
>   }
>
>
> ?>
>
> thanks in advance,
> jennifer
>



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




Re: [PHP] Number Sign in String Variables

2003-01-18 Thread Steve Edberg
You need to urlencode() selectively; in this case, only the 
short_desc needs to be encoded, so you would have a statement 
something like

	echo
	"add_to_cart.php?item_num=$item_num&quantity=$quantity".
	"&sale_price=$sale_price&unit=$unit&short_desc=".
	url_encode($short_desc)."&wholesaler=$wholesaler&cost=$cost"
	;

You need to encode any parameter (everything to the right of that 
first '?') that might include the '?', '&'. '#' or space characters, 
since those all mean something special in a URL. To be safe, it's 
best to encode everything - or at least all strings. However, you 
have to encode them individually, since you need the UNencoded '&' 
between them to delimit parameters, and you need that '?' there to 
indicate the start of the parameters.

I don't know the details of your program design, but there may be no 
reason to pass all the item details (description, sale price, etc.) 
in the URL anyway. Can't you just look them up in the add_to_card.php 
page, based on the item_num? Thus, all you need to pass are the 
quantity & item_number:

	echo "add_to_cart.php?item_num=$item_num&quantity=$quantity";

For one thing, that would eliminated the possibility of someone 
trying to get everything for free by manually typing a URL like

	add_to_cart.php?item_num=SOU3432410&quantity=1&sale_price=0&unit=...

-steve


At 6:29 PM -0500 1/18/03, Joab Stieglitz wrote:
OK.  I urlencoded the URL and now the URL passes correctly...

add_to_cart.php%3Fitem_num%3DSTT32700%26quantity%3D1%26sale_price%3D52.78%26
unit%3DBX%26short_desc%3DENVELOPE%2C100%25COT%2024%23%2CGY%26wholesaler%3DUS
%26cost%3D37.700

... but I get the following error:

Forbidden
You don't have permission to access
/carmae/add_to_cart.php?item_num=STT32700&quantity=1&sale_price=52.78&unit=B
X&short_desc=ENVELOPE,100%COT 24#,GY&wholesaler=US&cost=37.700 on this
server.

I've never seen anything like this before.

Suggestions?

"Brad Pauly" <[EMAIL PROTECTED]> wrote in message
1042912825.15063.33.camel@earth">news:1042912825.15063.33.camel@earth...

 > For example, this URL:
 >

 > > add_to_cart.php?item_num=SOU3432410&quantity=1&sale_price=24.92&unit=BX
 > > &short_desc=ENVELOPE,25%COT 24#,IY&wholesaler=US&cost=18.690

 >
 > gets cut off at the # sign, so $wholesaler and $cost come out empty.
 >
 > Any suggestions to get around this?

 You could use urlencode() and urldecode().

 http://www.php.net/manual/en/function.urlencode.php
 http://www.php.net/manual/en/function.urldecode.php

 Brad






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



--
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| SETI@Home: 1001 Work units on 23 oct 2002  |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
++

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




Re: [PHP] Number Sign in String Variables

2003-01-18 Thread Joab Stieglitz
All I'm doing is making a hyperlink that sends the selected item from the
catalog to the add to shopping cart script.  The code now looks like this...

  $value = rawurlencode("add_to_cart.php?item_num=" . $item_num .
"&quantity=1&sale_price=" . $our_price .
"&unit=" . $unit .
"&short_desc=" . $short_desc .
"&wholesaler=" . $wholesaler .
"&cost=" . $cost);

  echo "Add\n";

... and executes the link when the user clicks on the shopping cart icon.

"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
002301c2bf4b$bc44c0b0$7c02a8c0@coconut">news:002301c2bf4b$bc44c0b0$7c02a8c0@coconut...

> And the line you get that error looks like? It looks like you're trying
> to fopen() a file that's made up of PHP_SELF and the QUERY_STRING.
>
> ---John W. Holmes...



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




[PHP] SQL+php

2003-01-18 Thread Paul Marinas
Dose anyone know how to search and replace a string in a
mysql_query output.

Thanks, Paul

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




Re: [PHP] Multiple sizes for products

2003-01-18 Thread Hugh Danaher
If your customer views these items as different products then store them as
separate records in the same table.
My $0.02
Hugh
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 18, 2003 11:55 AM
Subject: [PHP] Multiple sizes for products


Hi all,

I'm making this web site, where the owner or administrator will be able to
upload new products and these products come in different sizes. Now, I made
a table in MySQL o store the products but only with a VARCHAR field where
the administrator will store the sizes like "12, 14, 16 and 18".

I would like to store the sizes for each product in a different table, but
my question refers on how to do this... one product per row with all the
different sizes (which will leave too many blank fields in every row) or
one size per row, making several rows per product.

Thanks in advance,

Cesar L. Aracena
[EMAIL PROTECTED]
[EMAIL PROTECTED]
(0299) 156-356688
Neuquén (8300) Capital
Argentina


mail2web - Check your email from the web at
http://mail2web.com/ .



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




RE: [PHP] SQL+php

2003-01-18 Thread John W. Holmes
>   Dose anyone know how to search and replace a string in a
> mysql_query output.

Yes. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] SQL+php

2003-01-18 Thread Sean Malloy
I see a lot of these type of answers on the list at the moment.

I'm sick of receiving smart ass answers from people. It wastes my time, and
my bandwidth.

Either answer the fucking question, even if it hasn't been asked correctly,
or don't reply at all.

Given you are a 'PHP Professional' John, I would expect a little more from
you.

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 19 January 2003 11:42 AM
To: 'Paul Marinas'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] SQL+php


>   Dose anyone know how to search and replace a string in a
> mysql_query output.

Yes.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] SQL+php

2003-01-18 Thread John W. Holmes
How about you describe exactly what you're trying to do and why and then
someone can help you. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: Paul Marinas [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 18, 2003 7:46 PM
> To: John W. Holmes
> Subject: RE: [PHP] SQL+php
> 
> 
> what number? .. i really need that .
> On Sat, 18 Jan 2003, John W. Holmes wrote:
> 
> > >   Dose anyone know how to search and replace a string in a
> > > mysql_query output.
> >
> > Yes.
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> > today. http://www.phparch.com/
> >
> >
> >
> > --
> > 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




Re: [PHP] 2 Qs: Passing current URL with session and how to avoidsession timeout???

2003-01-18 Thread Justin French
1. If you require the back button to work forever, then do not use sessions,
because they're not designed to be a forever thing.


2. I do this sort of stuff by building my own URL from $_SERVER components:



The reason why I base64_encode() it is so that the vars=values of the
previous page don't affect the next page.

I the link to the second page might be something like:

click

on page.php, to establish a back button:


go back


3.  This way, the referring/mother URL is always attached to that URL... if
they bookmark it, of give it to a friend, it's always there... sessions
don't achieve this, and cookies usually can, apart from the usual cookie
problems.


CHeers,

Justin


on 19/01/03 3:03 AM, -<[ Rene Brehmer ]>- ([EMAIL PROTECTED]) wrote:

> Hi gang
> 
> Been trying to figure out this session stuff, but since I was unable to
> make the manual sample into something workable, I instead decided to
> actually try and make the session do what I need it for: Passing the URL
> of the caller page to the page that's being called.
> 
> 1. Only I can't figure out if there's a function to just pull the current
> URL and plop it into a session variable. The thing is that these pages are
> all built by using a bunch of GET variables in the URL, so it would be
> easiest to just do something like:
> 
> $_SESSION['mother'] = $currentURL;
> 
> And then in the called, daughter, page do this:
> 
> >Get back to where you
> came from
> 
> As the only other way I've found is to have it use the string-functions
> and re-build the current URL throughout the if-tree that builds the page.
> I need to pass the mother URL to the daughter pages because there's two
> main entry-points into the daugther pages, and one of them can have 10-15
> different states...
> 
> But how do you pull the current url? ParseURL just smacks it into an
> array, and I'll then have to rebuild it anyway ... which makes it about
> just as simple as running it through the if-tree. Whether or not the
> session-id is inside the URL is not essential to me, but dunno if php
> cares about it.
> 
> 2. Since the above is required to function at all times, I need to
> override the expiration time. I can't do it in the ini file, 'cause I
> can't modify the server where it's to run, and it's set to 0 there... (not
> sure if that means it expires right away, or not at all)
> 
> Anyway to do this???
> 
> TIA
> 
> Rene


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




RE: [PHP] SQL+php

2003-01-18 Thread Paul Marinas
i am trying to select some fields form a database but in there the data is
something like "172.10.192.22:100", not very frendly, and instad of those
numbers i whant to display on my web page something like  "july"...that's
it ..:)

On Sat, 18 Jan 2003, John W. Holmes wrote:

> How about you describe exactly what you're trying to do and why and then
> someone can help you.
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
> > -Original Message-
> > From: Paul Marinas [mailto:[EMAIL PROTECTED]]
> > Sent: Saturday, January 18, 2003 7:46 PM
> > To: John W. Holmes
> > Subject: RE: [PHP] SQL+php
> >
> >
> > what number? .. i really need that .
> > On Sat, 18 Jan 2003, John W. Holmes wrote:
> >
> > > > Dose anyone know how to search and replace a string in a
> > > > mysql_query output.
> > >
> > > Yes.
> > >
> > > ---John W. Holmes...
> > >
> > > PHP Architect - A monthly magazine for PHP Professionals. Get your
> copy
> > > today. http://www.phparch.com/
> > >
> > >
> > >
> > > --
> > > 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




Re: [PHP] Auto Incrementing in PHP

2003-01-18 Thread Justin French
on 19/01/03 9:59 AM, John W. Holmes ([EMAIL PROTECTED]) wrote:

>> Is there a way for a php page to automatically increment a number and
>> store
>> it every time the page is loaded.
>> 
>> I want to generate an invoice number that goes up 1 everytime the HTML
>> form
>> is sent to it.
> 
> I assume you're talking about incrementing for everyone that accesses
> your site. For that you need a database to keep track of the number for
> all users. 

Or use a file-based counter.  There are 1000's of counter scripts out there
both file based and database based.


Justin


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




Re: [PHP] Free PHP Hosts?

2003-01-18 Thread David T-G
JJ --

...and then JJ Harrison said...
% 
...
% Does anyone know of a free php webhost? (Banners, poop-ups etc are
% exceptable).

You should ask google first:

  Advanced SearchPreferencesLanguage ToolsSearch Tips
  free web hosting php___ Google Search
  ...
  Searched the web for free web hosting php.  Results 1 - 10 of about
  1,520,000. Search took 0.18 seconds.

Doesn't seem too difficult...


% --
% ---
% JJ Harrison
% [EMAIL PROTECTED]


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg93490/pgp0.pgp
Description: PGP signature


RE: [PHP] SQL+php

2003-01-18 Thread Sean Malloy
If you want to do it within the query itself, take a look at the mysql
replace command

REPLACE(str,from_str,to_str)

SELECT REPLACE(,,) FROM table

or you can do it using PHP once the query has executed, on a record by
record basis, within a while/for loop or whatever.

-Original Message-
From: Paul Marinas [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 19 January 2003 11:07 AM
Cc: [EMAIL PROTECTED]
Subject: [PHP] SQL+php


Dose anyone know how to search and replace a string in a
mysql_query output.

Thanks, Paul

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




RE: [PHP] SQL+php

2003-01-18 Thread Paul Marinas
something like that only i don't whant to alter the database, the fields
in the database must remains unchanged, only, on page i  whant to display
diferent data.

 On Sun, 19 Jan 2003, Sean Malloy wrote:

> If you want to do it within the query itself, take a look at the mysql
> replace command
>
> REPLACE(str,from_str,to_str)
>
> SELECT REPLACE(,,) FROM table
>
> or you can do it using PHP once the query has executed, on a record by
> record basis, within a while/for loop or whatever.
>
> -Original Message-
> From: Paul Marinas [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, 19 January 2003 11:07 AM
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] SQL+php
>
>
>   Dose anyone know how to search and replace a string in a
> mysql_query output.
>
> Thanks, Paul
>
> --
> 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




Re: [PHP] SQL+php

2003-01-18 Thread Justin French
where the F*** are you getting july from???  which number do you want to
convert to a month, or am i totally missing it?

you need to be DESCRIPTIVE in what you want to acheive.

we're not a mind readers!


Justin


on 19/01/03 11:59 AM, Paul Marinas ([EMAIL PROTECTED]) wrote:

> i am trying to select some fields form a database but in there the data is
> something like "172.10.192.22:100", not very frendly, and instad of those
> numbers i whant to display on my web page something like  "july"...that's
> it ..:)
> 
> On Sat, 18 Jan 2003, John W. Holmes wrote:
> 
>> How about you describe exactly what you're trying to do and why and then
>> someone can help you.
>> 
>> ---John W. Holmes...
>> 
>> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
>> today. http://www.phparch.com/
>> 
>>> -Original Message-
>>> From: Paul Marinas [mailto:[EMAIL PROTECTED]]
>>> Sent: Saturday, January 18, 2003 7:46 PM
>>> To: John W. Holmes
>>> Subject: RE: [PHP] SQL+php
>>> 
>>> 
>>> what number? .. i really need that .
>>> On Sat, 18 Jan 2003, John W. Holmes wrote:
>>> 
> Dose anyone know how to search and replace a string in a
> mysql_query output.
 
 Yes.
 
 ---John W. Holmes...
 
 PHP Architect - A monthly magazine for PHP Professionals. Get your
>> copy
 today. http://www.phparch.com/
 
 
 
 --
 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




Re: [PHP] SQL+php

2003-01-18 Thread Paul Marinas
:)))
.it's an log for a VoIp network, evrey voip has an ip and i whant
that instad of the VoIp's IP to put his name, instad of "1.1.1.1:xxx" must
be "jhon doe form yyy city", it's easier to read for the people who that
follow the logs. .. that's it ...

 On Sun, 19 Jan 2003, Justin French wrote:

> where the F*** are you getting july from???  which number do you want to
> convert to a month, or am i totally missing it?
>
> you need to be DESCRIPTIVE in what you want to acheive.
>
> we're not a mind readers!
>
>
> Justin
>
>
> on 19/01/03 11:59 AM, Paul Marinas ([EMAIL PROTECTED]) wrote:
>
> > i am trying to select some fields form a database but in there the data is
> > something like "172.10.192.22:100", not very frendly, and instad of those
> > numbers i whant to display on my web page something like  "july"...that's
> > it ..:)
> >
> > On Sat, 18 Jan 2003, John W. Holmes wrote:
> >
> >> How about you describe exactly what you're trying to do and why and then
> >> someone can help you.
> >>
> >> ---John W. Holmes...
> >>
> >> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> >> today. http://www.phparch.com/
> >>
> >>> -Original Message-
> >>> From: Paul Marinas [mailto:[EMAIL PROTECTED]]
> >>> Sent: Saturday, January 18, 2003 7:46 PM
> >>> To: John W. Holmes
> >>> Subject: RE: [PHP] SQL+php
> >>>
> >>>
> >>> what number? .. i really need that .
> >>> On Sat, 18 Jan 2003, John W. Holmes wrote:
> >>>
> > Dose anyone know how to search and replace a string in a
> > mysql_query output.
> 
>  Yes.
> 
>  ---John W. Holmes...
> 
>  PHP Architect - A monthly magazine for PHP Professionals. Get your
> >> copy
>  today. http://www.phparch.com/
> 
> 
> 
>  --
>  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




[PHP] Changing order of just one array item?

2003-01-18 Thread Leif K-Brooks
I need to change where one item is ordered in an array.  I know how to 
sory an array, but I need to move one item up/down in the array.  Example:
$array is:
0 => "element one"
1 => "element two"
2 => "element three"
3 => "element four"
I call array_order_up($array[1]) and $array is now:
0 => "element one"
2 => "element three"
1 => "element two"
3 => "element four"

If there aren't any native functions to do this, can anyone think of a 
way to make my own function to do this?

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



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



RE: [PHP] Changing order of just one array item?

2003-01-18 Thread Timothy Hitchens \(HiTCHO\)
This would do it:




Timothy Hitchens (HiTCHO)
Open Source Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] 
> Sent: Sunday, 19 January 2003 12:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Changing order of just one array item?
> 
> 
> I need to change where one item is ordered in an array.  I 
> know how to 
> sory an array, but I need to move one item up/down in the 
> array.  Example: $array is: 0 => "element one" 1 => "element 
> two" 2 => "element three" 3 => "element four" I call 
> array_order_up($array[1]) and $array is now: 0 => "element 
> one" 2 => "element three" 1 => "element two" 3 => "element four"
> 
> If there aren't any native functions to do this, can anyone 
> think of a 
> way to make my own function to do this?
> 
> -- 
> The above message is encrypted with double rot13 encoding.  
> Any unauthorized attempt to decrypt it will be prosecuted to 
> the full extent of the law.
> 
> 
> 
> -- 
> 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




Re: [PHP] passing variables to a sql statement

2003-01-18 Thread Tom Rogers
Hi,

Sunday, January 19, 2003, 5:50:51 AM, you wrote:
j> hi, i'm hoping someone can help me out here - im trying to pass a variable from a 
string in the href tag, however my sql breaks when i put a var in the statment.
j> when i replace $foo with a number, the page works fine. can someone please tell me 
what im doing wrong?

j> here is the error i get:

j> Warning: Supplied argument is not a valid MySQL result resource in 
/home/villany2k1/www.villany2k1.com/htdocs/projects/projects_descrip.php on line 11



j> here is my code:

j>  $hostName="localhost";
j> $userName="";
j> $password="";
j> $database= "projects";
j> $tableName="project_descrip";

j> $descripQuery = "SELECT descrip from project_descrip where rowid=$foo";
j> mysql_connect($hostName, $userName, $password);
j> $descripResult = mysql_db_query($database,$descripQuery);
j>while($row = mysql_fetch_object($descripResult)){

$foo = $row->>descrip;

j> echo("");
j> echo("" . "$foo" . " | ");
j> echo("");

j>   }


?>>

j> thanks in advance, 
j> jennifer

You need to put $foo in quotes like

 $descripQuery = "SELECT descrip from project_descrip where rowid='$foo'";

-- 
regards,
Tom


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




php-general Digest 19 Jan 2003 03:23:15 -0000 Issue 1831

2003-01-18 Thread php-general-digest-help

php-general Digest 19 Jan 2003 03:23:15 - Issue 1831

Topics (messages 132094 through 132157):

Re: Select multiple boxes
132094 by: Cal Evans
132097 by: Gregory Chagnon
132098 by: John W. Holmes
132099 by: Cal Evans

Re: Ever complained about lousy PHP programmers?
132095 by: michael kimsal

Re: Sessions or Cookies?
132096 by: Chris Hewitt
132102 by: Brad Pauly
132125 by: Chris Shiflett

2 Qs: Passing current URL with session and how to avoid session timeout???
132100 by: -<[ Rene Brehmer ]>-
132101 by: Cal Evans
132127 by: Chris Shiflett
132137 by: John W. Holmes
132147 by: Justin French

Can I use php to load a icon?(.ico .exe .)
132103 by: hei
132105 by: Cal Evans

Re: Converting accented characters or numeric equivalents to non-accented
132104 by: -<[ Rene Brehmer ]>-
132108 by: Chris Hewitt
132113 by: Ian M. Evans
132114 by: Ernest E Vogelsinger
132115 by: Ernest E Vogelsinger
132116 by: Ian M. Evans
132118 by: Paul Roberts
132124 by: Ian M. Evans

Does remote file(image) exist ?
132106 by: Stephen of Blank Canvas
132107 by: Andrew Brampton
132110 by: pan

Re: Number Sign in String Variables
132109 by: Joab Stieglitz
132112 by: Brad Pauly
132133 by: Joab Stieglitz
132135 by: John W. Holmes
132140 by: Steve Edberg
132141 by: Joab Stieglitz

hyperlink and mySQL
132111 by: M.E. Suliman
132134 by: Bobby Patel

Logfile statistics - get words from position between other words
132117 by: Svein O. Bennæs
132119 by: Sean Burlington

passing variables to a sql statement
132120 by: jennifer
132123 by: Jason Wong
132131 by: John W. Holmes
132139 by: Bobby Patel
132157 by: Tom Rogers

Multiple sizes for products
132121 by: icaam.icaam.com.ar
132130 by: John W. Holmes
132143 by: Hugh Danaher

Auto Incrementing in PHP
132122 by: Don Mc Nair
132129 by: John W. Holmes
132136 by: Bobby Patel
132149 by: Justin French

Re: Check for start_sessoin without causing header problems
132126 by: Chris Shiflett

PGP signing text from called from PHP
132128 by: {R}ichard Ashton

File perms when dir already exists
132132 by: rw.xend.net

Re: Number Sign in String Variables]
132138 by: Brad Pauly

SQL+php
132142 by: Paul Marinas
132144 by: John W. Holmes
132145 by: Sean Malloy
132146 by: John W. Holmes
132148 by: Paul Marinas
132151 by: Sean Malloy
132152 by: Paul Marinas
132153 by: Justin French
132154 by: Paul Marinas

Re: Free PHP Hosts?
132150 by: David T-G

Changing order of just one array item?
132155 by: Leif K-Brooks
132156 by: Timothy Hitchens \(HiTCHO\)

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 ---
whoops. Sorry, didn't read the question. Wrong answer. John gave the correct
answer.

=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Cal Evans [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 18, 2003 8:41 AM
To: Gregory Chagnon; [EMAIL PROTECTED]
Subject: RE: [PHP] Select multiple boxes


use [] in your select box name. When it comes back in the $_POST array you
will have an array of options.  It breaks HTML standard therefore it is a
Bad Thing (tm) but it does work.


Don't pick me
Pick me


Selecting both results in:

$_POST['mySelect'][1] == "Don't pick me"
$_POST['mySelect'][2] == "Pick me"

HTH,
=C=

*
* Cal Evans
* Stay plugged into your audience.
* http://www.christianperformer.com
*


-Original Message-
From: Gregory Chagnon [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Select multiple boxes


Hi-
Is there any way to get all of the elements in a SELECT MULTIPLE box, not
just the ones that are selected?  Thanks!
-Greg



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



--- End Message ---
--- Begin Message ---
The problem is I have 2 seelect boxes...it's for creating a user and adding
them to a list of available groups...so I have one select box that is
initially empty called memberOf and another box that has all of the
available groups listed in it called availableGroups.  I have a script that
can move items back and forth and when the form is submitted

Re: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread -<[ Rene Brehmer ]>-
Hi Cal Evans,

On Sat, 18 Jan 2003 10:17:01 -0600, you wrote about "RE: [PHP] 2 Qs:
Passing current URL with session and how to avoid session timeout???"
something that looked like this:

>I guess I'm dense this morning. In response to 1:
>
>$_SESSION['mother']=$_SERVER['PHP_SELF'];

Didn't know the server array existed ... where I'd find that in the
manual??? Only doc I've got to run from...

>and then
>
>Go Back
>
>or better yet...
>Go Back

Wouldn't that produce a link to the current url, rather than the previous?

>as to #2:
>I usually just pass this kind of info around on the URL.
>
>http://mypage.com/mypage.php?prevURL=http://mypage.com/lastpage.php
>
>if I have to pass a full query string then I urlencode() it first and
>urldecode() it on the other side.

I can't do that reliably, my URLs are simply too long on some occasions
... so the URL ends up getting the end cut off...

But apparently the sessions expiring isn't an issue afterall ... have had
the page loaded for several hours, and the recursive linkage still works
... Will have to upload to my webhost though before I can be absolutely
certain ... Retaining matching settings in my test-enviro is not entirely
possible because their Apache is older than mine...and they run with
globals on, and I design for them off, just to be safe...

Rene
-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




Re: [PHP] 2 Qs: Passing current URL with session and how to avoid session timeout???

2003-01-18 Thread -<[ Rene Brehmer ]>-
Hi Justin French,

On Sun, 19 Jan 2003 12:01:45 +1100, you wrote about "Re: [PHP] 2 Qs:
Passing current URL with session and how to avoid session timeout???"
something that looked like this:

>1. If you require the back button to work forever, then do not use sessions,
>because they're not designed to be a forever thing.

I only need the session to pass the url on to the next page ... once there
the old URL will be written into the HTML code... The only reasons I need
to do it with sessions is because my urls are too long for the encoded url
to be transfered reliably within the url...

>2. I do this sort of stuff by building my own URL from $_SERVER components:

I haven't found the server array in the manual (yet anyway), so I'm not
sure what exactly it is you're doing ... so a bit of 'splaining would be
nice ... I'm only on my 4th month of PHP'ing afterall ... 

>$script = $_SERVER['PHP_SELF'];
>$qs = $_SERVER['QUERY_STRING'];
>$currentURL = base64_encode($script."?".$qs);
>?>
>
>The reason why I base64_encode() it is so that the vars=values of the
>previous page don't affect the next page.

I don't have that problem. Variables aren't reausable because I'm doing
divide and conquer design ... that way I can prevent the code from being
too complex and requiring to many variables to work. Thus my variables
differ from master page to master page, all the common ones are rewritten
on each page load (as it only controls the menu links to be linked
correctly up/down folder levels).

>I the link to the second page might be something like:
>
>click
>
>on page.php, to establish a back button:
>
>
>go back
>
>3.  This way, the referring/mother URL is always attached to that URL... if
>they bookmark it, of give it to a friend, it's always there... sessions
>don't achieve this, and cookies usually can, apart from the usual cookie
>problems.

Apparently the trans_sid being on (or 1 as it is) makes the sid transfer
correctly everytime, atleast with my current setup ... which is this:

On mother:

  $_SESSION['mother'] = "girlz.php?locat=$loc&list=$list&year=$year";

On child:
  
if ($name != "") {
  $backlink = "Back to where you came from";
  echo($backlink);
}

And before you ask, the reason the backlink is in a variable is because
it's reused a couple times down the page.

The above is, of course, only part of the code. It checks for alot more
stuff in the child file. Still have to work out how to ensure that the
backlink will produce a workable return link even when the page is
launched without a call from a mother page...

But that'll have to wait until morning ... it's 4.45 AM here now ;-) ...
gotta get some snooze...

Rene

-- 
Rene Brehmer

This message was written on 100% recycled spam.

Come see! My brand new site is now online!
http://www.metalbunny.net

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




Re: [PHP] 2 Qs: Passing current URL with session and how to avoidsession timeout???

2003-01-18 Thread Justin French
on 19/01/03 2:45 PM, -<[ Rene Brehmer ]>- ([EMAIL PROTECTED]) wrote:

> I haven't found the server array in the manual (yet anyway), so I'm not
> sure what exactly it is you're doing ... so a bit of 'splaining would be
> nice ... I'm only on my 4th month of PHP'ing afterall ...

http://www.php.net/manual/en/language.variables.predefined.php


Justin


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




Re: [PHP] Can I use php to load a icon?????(.ico .exe .....)

2003-01-18 Thread hei
I mean how can I edit icon???



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




RE: [PHP] SQL+php

2003-01-18 Thread John W. Holmes
> .it's an log for a VoIp network, evrey voip has an ip and i whant
> that instad of the VoIp's IP to put his name, instad of "1.1.1.1:xxx"
must
> be "jhon doe form yyy city", it's easier to read for the people who
that
> follow the logs. .. that's it ...

So where do you get the name from. You're still not being descriptive
enough.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP] SQL+php

2003-01-18 Thread John W. Holmes
> I see a lot of these type of answers on the list at the moment.
> 
> I'm sick of receiving smart ass answers from people. It wastes my
time,
> and
> my bandwidth.
> 
> Either answer the fucking question, even if it hasn't been asked
> correctly,
> or don't reply at all.
> 
> Given you are a 'PHP Professional' John, I would expect a little more
from
> you.

It's _for_ PHP Professionals. If I read a Woman's magazine, does that
make me a woman?

Anyhow, answers like this are a good way for people to learn not to ask
Yes or No questions. There's even a funny FAQ on this, but I can't find
the link anywhere. 

---John Holmes...

> 
> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, 19 January 2003 11:42 AM
> To: 'Paul Marinas'
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] SQL+php
> 
> 
> > Dose anyone know how to search and replace a string in a
> > mysql_query output.
> 
> Yes.
> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> today. http://www.phparch.com/
> 
> 
> 
> --
> 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




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




Re: [PHP] Free PHP Hosts?

2003-01-18 Thread JJ Harrison
I did do that, and have yet to turn up a useful result. That is why I asked.

"David T-G" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...



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




RE: [PHP] SQL+php

2003-01-18 Thread Sean Malloy
I apologise for calling you a PHP Professional, clearly I was mistaken.


;)

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 19 January 2003 4:36 PM
To: 'Sean Malloy'; [EMAIL PROTECTED]
Subject: RE: [PHP] SQL+php


It's _for_ PHP Professionals. If I read a Woman's magazine, does that
make me a woman?

Anyhow, answers like this are a good way for people to learn not to ask
Yes or No questions. There's even a funny FAQ on this, but I can't find
the link anywhere. 

---John Holmes...


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




[PHP] CVS In PHP

2003-01-18 Thread Trilochan
Hello
Every body , I have written some programs in c , I want to run those
programs in my PHP script. Is there any way to do that .

Any suggestion is highly appreciated.


Regards
Trilochan



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




[PHP] File Upload

2003-01-18 Thread Trilochan
Hello
Every body , I want to make a provision for the suer , by which , they can
select number of files from a list box and  upload  them to the server in
PHP.

Any suggestion is highly appreciated.


Regards
Trilochan



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




[PHP] whois script or class

2003-01-18 Thread Ashley M. Kirchner

   I'm looking for a script, or class, that I can feed a domain name to 
and get back whois information, preferably already parsed into things 
like, the registrar, the registrant, ns servers, created/expire dates... 
Regardless of who the registrar is.  Anyone?

--
M | I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner    .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



smime.p7s
Description: S/MIME Cryptographic Signature


RE: [PHP] File Upload

2003-01-18 Thread John W. Holmes
> Every body , I want to make a provision for the suer , by which , they
can
> select number of files from a list box and  upload  them to the server
in
> PHP.

They have to select each file individually. Each file must be uploaded
through it's own  input element. 

The details of how to do these things are in the manual, the chapter
titled Handling File Uploads.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP] whois script or class

2003-01-18 Thread Jason k Larson
http://phpwhois.org/

Ashley M. Kirchner wrote:


   I'm looking for a script, or class, that I can feed a domain name to 
and get back whois information, preferably already parsed into things 
like, the registrar, the registrant, ns servers, created/expire dates... 
Regardless of who the registrar is.  Anyone?




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