Re: [PHP] Whats more efficient? ( echo ; or ?php echo ? )

2003-10-22 Thread Jordan S. Jones
I believe I read someplace once that it is more efficient to have your 
php embedded in your HTML where required. Something to do with the 
amount of parsing that the engine has to do.  However, to reiterate what 
Captain John W. Holmes said, using a templating engine does allow you to 
better manage the project especially in dealing with maintenance down 
the road.  I personally prefer to let the business logic create XML and 
employ XSLT to do my Html rendering.  It may not be the quickest or most 
memory efficient, but, in my humble opinion, it is one of the easiest to 
maintain.

Jordan S. Jones

Ryan A wrote:

Hi everyone,
Just a simple doubt and basically your opinion needed.
I have an option box on a webpage and have around 10 options on it and have
run into a doubt,
which is more efficient to do:
1.
option value=1?php if($th_order==1){echo  SELECTED; }
?Something1/option
option value=2?php if($th_order==2){echo  SELECTED; }
?Something2/option
(or)

2.
instead of having the ?php and ? mixed in the  HTML is it better to
echo/print the whole lines?
Thanks,
-Ryan
 



--
I am nothing but a poor boy. Please Donate..
https://www.paypal.com/xclick/business=list%40racistnames.comitem_name=Jordan+S.+Jonesno_note=1tax=0currency_code=USD
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] help me

2003-10-22 Thread Dave
Hi I need to edit my php.ini file. I tried to do this through ftp but no go. I am 
really desperate. How do I do it through putty. Ie
I log in
su to root
NOW WHAT?
Please give me step by step instructions including how to save and make my changes.
 I need to do the following
I need to change my php ini file as follows 
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Chance It To  

; Maximum allowed size for uploaded files.
upload_max_filesize = 9M

Please Help me I am so desperate. :(

Re: [PHP] help me

2003-10-22 Thread Jordan S. Jones
Dave,

First thing you need to do is find the location of your php.ini file. I 
typically create a document with the function phpinfo (); and load it up 
in the browser. This will tell you the location of the php.ini file. 
From there you need to use your favorite command line editor to open 
the php.ini file.  I prefer to use VI, so I will give you instructions 
for that. (I will list the actual keystrokes you need to press to 
open/save the file. E.g. Enter would be pressing the enter key and / 
would be pressing the / key.)

1. vi /location/to/php.ini
2. /upload_max_filesizeEnter
3. Arrow keys to the the position where the 2 (or whatever number it is) is.
4. x
5. i
6. 99 (or what ever value you want)
7.Esc:wqEnter (Escape, colon, w, q, Enter)
From there you will want to reload apache or whatever webserver you are 
using.

HTH
Jordan S. Jones
Feel free to donate
https://www.paypal.com/xclick/business=list%40racistnames.comitem_name=Jordan+S.+Jonesno_note=1tax=0currency_code=USD
Dave wrote:

Hi I need to edit my php.ini file. I tried to do this through ftp but no go. I am really desperate. How do I do it through putty. Ie
I log in
su to root
NOW WHAT?
Please give me step by step instructions including how to save and make my changes.
I need to do the following
I need to change my php ini file as follows 
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Chance It To  

; Maximum allowed size for uploaded files.
upload_max_filesize = 9M
Please Help me I am so desperate. :(
 

--
I am nothing but a poor boy. Please Donate..
https://www.paypal.com/xclick/business=list%40racistnames.comitem_name=Jordan+S.+Jonesno_note=1tax=0currency_code=USD
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Korean mbstring settings?

2003-10-22 Thread Rasmus Lerdorf
Any Korean users using --with-mbstring=kr ?

What do your mbstring.* settings in your php.ini file look like?  I am
assuming you don't need any output encoding translation but are you using
input encoding translation?

Or if you aren't using mbstring at all, but iconv or something else, I'd 
like to hear about that too.  You can email me privately and I will 
summarize for the list.

-Rasmus

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



Re: [PHP] set the PHP to look at library files.

2003-10-22 Thread jsWalter

Robert Cummings [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 See the include_path setting in your php.ini file.

Right!

I have many classes I've pulled from phpclasses.org.

They all sit in a CLASSES directory inside my PHP directory.

Just like PEAR, same format as well.

Just modify your 'include_path' variable in your php.ini file and your in
business!

Walter

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



[PHP] there has to be a better way...

2003-10-22 Thread jsWalter
I need to read (write comes later) from a config file that we used to handle
manually.

I'm getting lazy, so I'm writing a web interface for this.

What I have does this...
  - open a given file
  - dump entire file into a string
  - explode string into an array at the EOL marker
  - walk down this new array
  - decide if there is anything in current element
  - decide if current line is a comment
  - split line at '=' into 2 variables
  - add new key and value from these variables back into array
  - kill original array element

There must be a better way to do this.

All this seems a bit over kill to me.

Does anyone have any ideas on this?

Thanks

Walter

This is what I have...

?php

$config = $list . '/home/walter/vmd/config';

// Open the file
$handle = fopen ($config, r);

// Read entire file into var
$content = fread($handle, filesize($config));

// convert var into array and explode file via line break
$content = split(\r\n, $content);

// close file
fclose($handle);

// Loop through file contents array
foreach ($content as $i = $value)
{
   // If we have any data in this line
   if (! empty ($value))
   {
  // If this line is not a comment
  if ( $value{0} != '#')
  {
 list($a, $b) = split(=, $value);
 $content[$a] = $b;
  }

  // kill original array element
  unset($content[$i]);
   }
}

// show me what I have
echo 'pre';
echo print_r($content);
echo '/pre';

?

# Sample config file data, just 2 lines from the file...
#
# The Personal Name of the list, used in outgoing headers.
# If empty, default is the same as the list's username.
# if explicitly `false', then it is redefined empty.
LIST_NAME=RMT Working Group

# The address of the list's admin or owner.
# if explicitly `false', then it is redefined empty.
[EMAIL PROTECTED]

...

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread - Edwin -
On Wed, 22 Oct 2003 03:10:44 -0500
jsWalter [EMAIL PROTECTED] wrote:

[snip]
 There must be a better way to do this.
[/snip]

  http://www.php.net/manual/en/function.parse-ini-file.php ?

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] there has to be a better way...

2003-10-22 Thread Nick JORDAN
jsWalter [EMAIL PROTECTED] wrote on 22/10/2003 09:10:44:

 I need to read (write comes later) from a config file that we used to 
handle
 manually.

 There must be a better way to do this.

Check out the parse_ini_file() function.

Nick

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



Re: [PHP] Whats more efficient? (Conclusion)

2003-10-22 Thread Mika Tuupola
On Wed, 22 Oct 2003, Ryan A wrote:

 what do you suggest? and any urls for reading up on caching?

Some benchmarks on content and bytecode caching:

http://www.appelsiini.net/~tuupola/articles/benchmarking-phpa/

-- 
Mika Tuupola  http://www.appelsiini.net/~tuupola/

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



[PHP] Problem in 2 dimensional Array

2003-10-22 Thread khuram noman
Dear Members

i have 2 problems in 2 dimensional array .

1. how to declare global 2 dimensional array in php
2. how to pass 2 dimensional array in function

Waiting for ur soon reply

Khuram Noman

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] get back to index.php

2003-10-22 Thread Sudheer Palaparambil
Hi,

  I am calling the insert_user.php like this

  form method=get name=form 
action=http://www.etooss.com/insert_user.php;
  onsubmit=return verifyIt(this);

  In insert_user.php, I am inserting the record to mysql db, nothing is 
displayed there. Now how
  do come back to index.php screen.

  Thank you

Sudheer

_
Making your life easy! That is Citibank Suvidha. 
http://server1.msn.co.in/msnleads/citi_cards_sept03/CitiSuvidha.asp Get your 
account now!

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


RE: [PHP] get back to index.php

2003-10-22 Thread Fernando Melo
In insert_user.php

header(Location: index.php);
exit;

make sure nothing is being echoed before you call this.

-Original Message-
From: Sudheer Palaparambil [mailto:[EMAIL PROTECTED] 
Sent: 22 October 2003 14:15
To: [EMAIL PROTECTED]
Subject: [PHP] get back to index.php

Hi,

   I am calling the insert_user.php like this

   form method=get name=form 
action=http://www.etooss.com/insert_user.php;
   onsubmit=return verifyIt(this);

   In insert_user.php, I am inserting the record to mysql db, nothing is 
displayed there. Now how
   do come back to index.php screen.

   Thank you

Sudheer

_
Making your life easy! That is Citibank Suvidha. 
http://server1.msn.co.in/msnleads/citi_cards_sept03/CitiSuvidha.asp Get your

account now!

-- 
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] get back to index.php

2003-10-22 Thread Marek Kilimajer
Use
header('Location: http://www.etooss.com/');
exit;
Sudheer Palaparambil wrote:
Hi,

  I am calling the insert_user.php like this

  form method=get name=form 
action=http://www.etooss.com/insert_user.php;
  onsubmit=return verifyIt(this);

  In insert_user.php, I am inserting the record to mysql db, nothing is 
displayed there. Now how
  do come back to index.php screen.

  Thank you

Sudheer

_
Making your life easy! That is Citibank Suvidha. 
http://server1.msn.co.in/msnleads/citi_cards_sept03/CitiSuvidha.asp Get 
your account now!

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


Re: [PHP] Problem in 2 dimensional Array

2003-10-22 Thread Marek Kilimajer
khuram noman wrote:

Dear Members

i have 2 problems in 2 dimensional array .

1. how to declare global 2 dimensional array in php
$GLOBALS['array_name']=array(  );

2. how to pass 2 dimensional array in function
Like any other value.

Waiting for ur soon reply

Khuram Noman

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] get back to index.php

2003-10-22 Thread Sudheer Palaparambil
But it is giving the following error message

Warning: Cannot modify header information - headers already sent by (output 
started at D:\websites\clands\clandsadmin\etooss.com\web\insert_user.php:3) 
in D:\websites\clands\clandsadmin\etooss.com\web\insert_user.php on line 29

Thank you.

From: Marek Kilimajer [EMAIL PROTECTED]
To: Sudheer Palaparambil [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] get back to index.php
Date: Wed, 22 Oct 2003 14:24:44 +0200
Use
header('Location: http://www.etooss.com/');
exit;
Sudheer Palaparambil wrote:
Hi,

  I am calling the insert_user.php like this

  form method=get name=form 
action=http://www.etooss.com/insert_user.php;
  onsubmit=return verifyIt(this);

  In insert_user.php, I am inserting the record to mysql db, nothing is 
displayed there. Now how
  do come back to index.php screen.

  Thank you

Sudheer

_
Making your life easy! That is Citibank Suvidha. 
http://server1.msn.co.in/msnleads/citi_cards_sept03/CitiSuvidha.asp Get 
your account now!


_
Tired of emails bouncing back? Need more space? 
http://server1.msn.co.in/features/general/extrastorage/index.asp Get extra 
storage on Hotmail

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


RE: [PHP] get back to index.php

2003-10-22 Thread Fernando Melo
Make sure there are no blank spaces being echoed.

-Original Message-
From: Sudheer Palaparambil [mailto:[EMAIL PROTECTED] 
Sent: 22 October 2003 14:30
To: [EMAIL PROTECTED]
Subject: Re: [PHP] get back to index.php

But it is giving the following error message

Warning: Cannot modify header information - headers already sent by (output 
started at D:\websites\clands\clandsadmin\etooss.com\web\insert_user.php:3) 
in D:\websites\clands\clandsadmin\etooss.com\web\insert_user.php on line 29

Thank you.

From: Marek Kilimajer [EMAIL PROTECTED]
To: Sudheer Palaparambil [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] get back to index.php
Date: Wed, 22 Oct 2003 14:24:44 +0200

Use
header('Location: http://www.etooss.com/');
exit;

Sudheer Palaparambil wrote:
Hi,

   I am calling the insert_user.php like this

   form method=get name=form 
action=http://www.etooss.com/insert_user.php;
   onsubmit=return verifyIt(this);

   In insert_user.php, I am inserting the record to mysql db, nothing is 
displayed there. Now how
   do come back to index.php screen.

   Thank you

Sudheer

_
Making your life easy! That is Citibank Suvidha. 
http://server1.msn.co.in/msnleads/citi_cards_sept03/CitiSuvidha.asp Get 
your account now!



_
Tired of emails bouncing back? Need more space? 
http://server1.msn.co.in/features/general/extrastorage/index.asp Get extra 
storage on Hotmail

-- 
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] help me

2003-10-22 Thread John Nichel
Dave wrote:
Hi I need to edit my php.ini file. I tried to do this through ftp but no go. I am 
really desperate. How do I do it through putty. Ie
I log in
su to root
NOW WHAT?
vi?

Please give me step by step instructions including how to save and make my changes.
 I need to do the following
I need to change my php ini file as follows 
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Chance It To  

; Maximum allowed size for uploaded files.
upload_max_filesize = 9M
Please Help me I am so desperate. :(
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP scripts are not executed

2003-10-22 Thread Bas
I am running Windows XP, Apache/2.0.44 and php 4.3.3.

I seem that internally all my PHP scripts work. But, externally, phpBB 2.0.6
does not work...

Sorry for the double message...

And my e-mail has changed... don't spam!!!

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



[PHP] value field filled by mysql output

2003-10-22 Thread Mike At Spy

I am creating a form for editing records output from a mysql db (edit as an
html form).  I've done this many times, but have never run into this issue.

I have code like this for the query:

$edit_list = mysql_query(SELECT general_inventory.quantity FROM
products_to_categories, general_inventory WHERE
products_to_categories.categories_id = $cat AND
products_to_categories.products_id = general_inventory.product_id ORDER BY
general_inventory.name);

And like this for getting the output, inside a while loop:

$edit_details = mysql_fetch_array ($edit_list);
$qty = $edit_details['quantity'];
td align='center'input type=text name='qty$ed' value='$qty'
size='3'/td

Now, I get more than one column in a row, but I abbreviated it for here and
for testing.  Every column comes out and fills in the form properly except
this one.

The issue I am having is that the value of the input text box is being
listed as '1', even if the database shows either a value of nothing
(meaning, blank) or a value of zero.

Anyone have any idea why this might be?

Thanks,

-Mike

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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Marek Kilimajer
Hi, first you should explain the meanings of internaly and externaly 
 in this case.

Bas wrote:

I am running Windows XP, Apache/2.0.44 and php 4.3.3.

I seem that internally all my PHP scripts work. But, externally, phpBB 2.0.6
does not work...
Sorry for the double message...

And my e-mail has changed... don't spam!!!

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


Re: [PHP] help me

2003-10-22 Thread Burhan Khalid
Dave wrote:

Hi I need to edit my php.ini file. I tried to do this through ftp but no go. I am 
really desperate. How do I do it through putty. Ie
I log in
su to root
NOW WHAT?
Find your php.ini file
--
  A few ways to do this. The easiest would be to look at the output of 
phpinfo(). Just create a blank file with ?php phpinfo(); ? in it, 
upload it to your web server's root directory, and navigate to it.  The 
output will show you the path to the php.ini file that you want.

  If you don't feel like doing that, you can try any one of these 
commands :

   locate php.ini
   whereis php.ini
   find / -name php.ini
Either way you will end up with the location of your php.ini

Next step would be to edit it, for which you can use any text editor 
available on your shell. vi is common, so is vim. Some even have pico 
available.  If you don't know how to use any of these, most will work if 
you give them the path to the file you would like to open, something 
like : vi /home/httpd/htdocs/index.html

If you have a few hours to kill, you can read the online manual for the 
programs, which is available via the man command. Simply type man vi and 
hit enter for the manual for vi.

Please give me step by step instructions including how to save and make my changes.
 I need to do the following
I need to change my php ini file as follows 
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

Chance It To  

; Maximum allowed size for uploaded files.
upload_max_filesize = 9M
Why do you want to do something like that? There is a reason it defaults 
to 2M -- its to prevent from browsers from timing out when trying to 
upload huge files.  You might want to rethink why you are doing this 
(why ARE you doing it?)

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Bas
Internally is on my pc and externally is from the web.
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi, first you should explain the meanings of internaly and externaly
   in this case.

 Bas wrote:

  I am running Windows XP, Apache/2.0.44 and php 4.3.3.
 
  I seem that internally all my PHP scripts work. But, externally, phpBB
2.0.6
  does not work...
 
  Sorry for the double message...
 
  And my e-mail has changed... don't spam!!!
 

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



[PHP] Using php for non-web based applications

2003-10-22 Thread Paul Scruby
Hi there,

I am not sure if this is the right list to post to as most of you guys are
probably run php as an Apache module.  However, I am currently using my
own xml data format for a non-web based application and I would like to be
able to embed php within it.  Is there a C/C++ library that I can link
against to execute the ?php ... ? inside my xml when I load it?  Can
someone point me in the right direction?

Many thanks,

Paul

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



[PHP] Re: (ANNOUNCE) codeSECURE 1.0 released - - Protecting PHP code

2003-10-22 Thread Bas
Is it free?
John Black [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Greetings everyone,
 We have just launched a new product called codeSECURE and would like you
to
 check it out.

 codeSECURE is a PHP obfuscator.

 Basically codeSecure is a small collection of scripts to obfuscate or
 garble up php code so that PHP developers can protect their intellectual
 property, distribute locked php scripts, time expiring scripts etc.

 While making it nearly impossible for a human to understand or read your
 code/scripts, they will cause no problem for the computer to decipher and
 run.

 E.g.

 $a=Hello world;

 will become something like

 $23sfaAST3s=v4Mèåwuz24fz{(2{€w;


 For details, check us out at http://www.secureCents.com


 If  you have any questions...fire away, I and my partner will try our best
 to answer all questions/suggestions/criticisms etc.

 Regards,
 JB.

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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Marek Kilimajer
Hm, I still don't get you.

On your pc - do you mean you view the pages from your pc or that the 
pages are served from your pc (or both)?

From the web - do you mean you view the pages from the web or that the 
pages are served from another server on the web?

Bas wrote:

Internally is on my pc and externally is from the web.
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi, first you should explain the meanings of internaly and externaly
 in this case.
Bas wrote:


I am running Windows XP, Apache/2.0.44 and php 4.3.3.

I seem that internally all my PHP scripts work. But, externally, phpBB
2.0.6

does not work...

Sorry for the double message...

And my e-mail has changed... don't spam!!!





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


Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Bas
On web, i mean from my pc and on pc i use both
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hm, I still don't get you.

 On your pc - do you mean you view the pages from your pc or that the
 pages are served from your pc (or both)?

  From the web - do you mean you view the pages from the web or that the
 pages are served from another server on the web?

 Bas wrote:

  Internally is on my pc and externally is from the web.
  Marek Kilimajer [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
 Hi, first you should explain the meanings of internaly and externaly
   in this case.
 
 Bas wrote:
 
 
 I am running Windows XP, Apache/2.0.44 and php 4.3.3.
 
 I seem that internally all my PHP scripts work. But, externally, phpBB
 
  2.0.6
 
 does not work...
 
 Sorry for the double message...
 
 And my e-mail has changed... don't spam!!!
 
 
 


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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Bas
Web address is:

http://212.120.120.108:3/forumBT/
for phpBB

(DUTCH!!!)

If you need any translation, i will help you.
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On web, i mean from my pc and on pc i use both
 Marek Kilimajer [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hm, I still don't get you.
 
  On your pc - do you mean you view the pages from your pc or that the
  pages are served from your pc (or both)?
 
   From the web - do you mean you view the pages from the web or that the
  pages are served from another server on the web?
 
  Bas wrote:
 
   Internally is on my pc and externally is from the web.
   Marek Kilimajer [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
  
  Hi, first you should explain the meanings of internaly and
externaly
in this case.
  
  Bas wrote:
  
  
  I am running Windows XP, Apache/2.0.44 and php 4.3.3.
  
  I seem that internally all my PHP scripts work. But, externally,
phpBB
  
   2.0.6
  
  does not work...
  
  Sorry for the double message...
  
  And my e-mail has changed... don't spam!!!
  
  
  
 

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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Bas
And, e-mail me the results(on [EMAIL PROTECTED])
Of the website... Likethe error and so
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On web, i mean from my pc and on pc i use both
 Marek Kilimajer [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Hm, I still don't get you.
 
  On your pc - do you mean you view the pages from your pc or that the
  pages are served from your pc (or both)?
 
   From the web - do you mean you view the pages from the web or that the
  pages are served from another server on the web?
 
  Bas wrote:
 
   Internally is on my pc and externally is from the web.
   Marek Kilimajer [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
  
  Hi, first you should explain the meanings of internaly and
externaly
in this case.
  
  Bas wrote:
  
  
  I am running Windows XP, Apache/2.0.44 and php 4.3.3.
  
  I seem that internally all my PHP scripts work. But, externally,
phpBB
  
   2.0.6
  
  does not work...
  
  Sorry for the double message...
  
  And my e-mail has changed... don't spam!!!
  
  
  
 

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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Marek Kilimajer
Sometimes the pages load, sometimes they don't. Seems like apache is 
crashing, check apache error logs, php installation, installed modules...

Bas wrote:

And, e-mail me the results(on [EMAIL PROTECTED])
Of the website... Likethe error and so
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On web, i mean from my pc and on pc i use both
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hm, I still don't get you.

On your pc - do you mean you view the pages from your pc or that the
pages are served from your pc (or both)?
From the web - do you mean you view the pages from the web or that the
pages are served from another server on the web?
Bas wrote:


Internally is on my pc and externally is from the web.
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Hi, first you should explain the meanings of internaly and
externaly

in this case.

Bas wrote:



I am running Windows XP, Apache/2.0.44 and php 4.3.3.

I seem that internally all my PHP scripts work. But, externally,
phpBB

2.0.6


does not work...

Sorry for the double message...

And my e-mail has changed... don't spam!!!




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


[PHP] Mail() Function on Cobalt Raq 4

2003-10-22 Thread Peter Graber
Using a Cobalt Raq 4 w/php 4.3.1.   The sendmail_path is :
/usr/sbin/sendmail -t -iThis seems to be right.

Can't get mail to send.  Script works on other servers without fail.

PHP Info here: http://www.ncafp.com/cgi-bin/phpInfo.php

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



[PHP] German Date - GMDATE Function

2003-10-22 Thread Steve Vernon
Hello,

When I use the gmdate function, I get the English date, e.g. October. Is it
possible to get the date in German or another language? I really need the
server setting up so that it can handle different languages.

I suppose I could get the month as a number, and then convert the number,
but this seems a bit tacky!

Any help would be much appreciated!

I have tried to look at the German mannual, but I think they use the same
calls to gmdate, and that PHP is different. Is this so? How would I get
around this?

I don't know much, if any, German, so would need to use the English PHP.

THANKS!

Steve

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



Re: [PHP] help me

2003-10-22 Thread Burhan Khalid
Dave wrote:

I am setting up downloads.ca so as to be like downloads.com I need to be
able to upload files several gigs in size
Dave
Dave :

 Don't top post.
 FTP is what you need to upload files several gigs in size
--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Bas
I have checked the error log and the only real error i can see is that
C:\pub\favicon.ino does not exist... I have added this and now i need that
you test again... Thanks, Bas
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Sometimes the pages load, sometimes they don't. Seems like apache is
 crashing, check apache error logs, php installation, installed modules...

 Bas wrote:

  And, e-mail me the results(on [EMAIL PROTECTED])
  Of the website... Likethe error and so
  Bas [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
 On web, i mean from my pc and on pc i use both
 Marek Kilimajer [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
 Hm, I still don't get you.
 
 On your pc - do you mean you view the pages from your pc or that the
 pages are served from your pc (or both)?
 
  From the web - do you mean you view the pages from the web or that the
 pages are served from another server on the web?
 
 Bas wrote:
 
 
 Internally is on my pc and externally is from the web.
 Marek Kilimajer [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
 
 Hi, first you should explain the meanings of internaly and
 
  externaly
 
  in this case.
 
 Bas wrote:
 
 
 
 I am running Windows XP, Apache/2.0.44 and php 4.3.3.
 
 I seem that internally all my PHP scripts work. But, externally,
 
  phpBB
 
 2.0.6
 
 
 does not work...
 
 Sorry for the double message...
 
 And my e-mail has changed... don't spam!!!
 
 
 
 

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



Re: [PHP] Mail() Function on Cobalt Raq 4

2003-10-22 Thread Mike Morton
Have you checked the mail logs (should be /var/log/mail.log or something
similar) you could be getting errors from the mail server rather than the
php side.  I have had it where I thought that it was php but it turned out
be a local relaying error


)On 10/22/03 10:16 AM, Peter Graber [EMAIL PROTECTED] wrote:

 Using a Cobalt Raq 4 w/php 4.3.1.   The sendmail_path is :
 /usr/sbin/sendmail -t -iThis seems to be right.
 
 Can't get mail to send.  Script works on other servers without fail.
 
 PHP Info here: http://www.ncafp.com/cgi-bin/phpInfo.php

--
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple.
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 

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



[PHP] is_uploaded_file() security

2003-10-22 Thread Alexander Mueller
Hi,

I am wondering about the following paragraph at
http://at2.php.net/manual/en/function.is-uploaded-file.php.

 Returns TRUE if the file named by filename was uploaded via HTTP POST.
 This is useful to help ensure that a malicious user hasn't tried to
 trick the script into working on files upon which it should not be
 working--for instance, /etc/passwd.

 This sort of check is especially important if there is any chance that
 anything done with uploaded files could reveal their contents to the
 user, or even to other users on the same system.

AFAIK the browser only sends the content of the chosen file and cannot
specify in any way a local filename which should be worked on.
Furthermore PHP creates a temporary file containing the uploaded file
content and passes this filename as 'tmp_name' variable. How can then a
malicious user try to trick the script?

Thanks,
Alexander
-- 
PINO - The free Chatsystem!
Available at http://www.pino.org

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



Re: [PHP] German Date - GMDATE Function

2003-10-22 Thread Curt Zirzow
* Thus wrote Steve Vernon ([EMAIL PROTECTED]):
 Hello,
 
 When I use the gmdate function, I get the English date, e.g. October. Is it
 possible to get the date in German or another language? I really need the
 server setting up so that it can handle different languages.

What you want is:

  http://php.net/strftime
 
It uses your locale setting to display the proper language for days
of the week and months.

http://php.net/setlocale


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread Marek Kilimajer
favicon.ico is not the problem. The problem is The specified network 
name is no longer available. Check out this resource, if that does not 
help, google for the error string.

http://www.experts-exchange.com/Web/Web_Servers/Apache/Q_20671124.html

Bas wrote:

I have checked the error log and the only real error i can see is that
C:\pub\favicon.ino does not exist... I have added this and now i need that
you test again... Thanks, Bas
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Sometimes the pages load, sometimes they don't. Seems like apache is
crashing, check apache error logs, php installation, installed modules...
Bas wrote:


And, e-mail me the results(on [EMAIL PROTECTED])
Of the website... Likethe error and so
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

On web, i mean from my pc and on pc i use both
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

Hm, I still don't get you.

On your pc - do you mean you view the pages from your pc or that the
pages are served from your pc (or both)?
From the web - do you mean you view the pages from the web or that the
pages are served from another server on the web?
Bas wrote:



Internally is on my pc and externally is from the web.
Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]


Hi, first you should explain the meanings of internaly and
externaly


in this case.

Bas wrote:




I am running Windows XP, Apache/2.0.44 and php 4.3.3.

I seem that internally all my PHP scripts work. But, externally,
phpBB


2.0.6



does not work...

Sorry for the double message...

And my e-mail has changed... don't spam!!!




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


[PHP] Random Quotes...

2003-10-22 Thread Payne
Hi,

I am working on a project and I need to see sample quote for doing 
random quotes. These quotes will be put from a database. Can some please 
share me some sample code. Thanks.

Chuck

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


Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Marek Kilimajer
By requesting upload_script.php?userfile=/etc/passwd and 
upload_sript.php uses global variables to handle uploads. This check 
should not be necessery if you are using $_FILES superglobal as php will 
not accept _FILES user input. But keep the check there in case a bug 
will be introduced.

Alexander Mueller wrote:

Hi,

I am wondering about the following paragraph at
http://at2.php.net/manual/en/function.is-uploaded-file.php.

Returns TRUE if the file named by filename was uploaded via HTTP POST.
This is useful to help ensure that a malicious user hasn't tried to
trick the script into working on files upon which it should not be
working--for instance, /etc/passwd.
This sort of check is especially important if there is any chance that
anything done with uploaded files could reveal their contents to the
user, or even to other users on the same system.


AFAIK the browser only sends the content of the chosen file and cannot
specify in any way a local filename which should be worked on.
Furthermore PHP creates a temporary file containing the uploaded file
content and passes this filename as 'tmp_name' variable. How can then a
malicious user try to trick the script?
Thanks,
Alexander
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] is_uploaded_file() security

2003-10-22 Thread CPT John W. Holmes
From: Alexander Mueller [EMAIL PROTECTED]

 AFAIK the browser only sends the content of the chosen file and cannot
 specify in any way a local filename which should be worked on.
 Furthermore PHP creates a temporary file containing the uploaded file
 content and passes this filename as 'tmp_name' variable. How can then a
 malicious user try to trick the script?

The user can pass the name of a file on the server. If you're not doing any
checks and moving or displaying the file the user sent you, you may end
up moving, deleting, or displaying any file on your server.

---John Holmes...

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



Re: [PHP] Random Quotes...

2003-10-22 Thread Tom Rogers
Hi,

Thursday, October 23, 2003, 1:34:02 AM, you wrote:
P Hi,

P I am working on a project and I need to see sample quote for doing 
P random quotes. These quotes will be put from a database. Can some please 
P share me some sample code. Thanks.

P Chuck


If you are using mysql have a look at 'order by random' and limit

-- 
regards,
Tom

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



Re: [PHP] Random Quotes...

2003-10-22 Thread CPT John W. Holmes
From: Payne [EMAIL PROTECTED]
 I am working on a project and I need to see sample quote for doing 
 random quotes. These quotes will be put from a database. Can some please 
 share me some sample code. Thanks.

If you're using MySQL, you can use

SELECT quote FROM Quote ORDER BY RAND() LIMIT 1

to pull a single random quote from the database. 

I'm sure other databases have similar queries. 

---John Holmes...

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



Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Alexander Mueller
Marek Kilimajer wrote:
 
 By requesting upload_script.php?userfile=/etc/passwd and
 upload_sript.php uses global variables to handle uploads. This check
 should not be necessery if you are using $_FILES superglobal as php will
 not accept _FILES user input. But keep the check there in case a bug
 will be introduced.
 
 Alexander Mueller wrote:

Thanks for the explanation Marek. When I fully entered PHP's arena the
global variables werent really an issue anymore, therefore I am more
familiar with the $_* arrays and wondered about this paragraph. So in
the good old days one could access the uploaded file by the name of the
input field?!

Thanks,
Alexander
-- 
PINO - The free Chatsystem!
Available at http://www.pino.org

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



[PHP] Re: Random Quotes...

2003-10-22 Thread Kevin Stone

Payne [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Hi,
 
 I am working on a project and I need to see sample quote for doing 
 random quotes. These quotes will be put from a database. Can some please 
 share me some sample code. Thanks.
 
 Chuck

For more solutions go to, http://groups.google.com
and type in, select random row mysql

- Kevin


[PHP] Comments / Feedback script?

2003-10-22 Thread MIKE YRABEDRA


Anyone know of a good 'comments/ feedback' creation script that writes to a
static text file (no MySQL)?

The user would enter their email, name and comment. They would then be
displayed on the page using an include function.



++
Mike Yrabedra (President)
323 Incorporated 
Home of MacDock.com, MacAgent.com and MacShirt.com
++
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: [EMAIL PROTECTED]
I: ichatmacdock
++
Whatever you do, work at it with all your heart,
as working for the Lord, not for men.
~Colossians 3:23 {{{
++

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



Re: [PHP] PHP scripts are not executed

2003-10-22 Thread John Nichel
Bas wrote:
Web address is:

http://212.120.120.108:3/forumBT/
for phpBB
(DUTCH!!!)

If you need any translation, i will help you.
Bas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
You need to modify your httpd.conf file to see 'index.php' as an index.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Comments / Feedback script?

2003-10-22 Thread pete M
have a sniff around

http://www.hotscripts.com/PHP/Scripts_and_Programs/index.html

pete

Mike Yrabedra wrote:
Anyone know of a good 'comments/ feedback' creation script that writes to a
static text file (no MySQL)?
The user would enter their email, name and comment. They would then be
displayed on the page using an include function.


++
Mike Yrabedra (President)
323 Incorporated 
Home of MacDock.com, MacAgent.com and MacShirt.com
++
W: http://www.323inc.com/
P: 770.382.1195
F: 734.448.5164
E: [EMAIL PROTECTED]
I: ichatmacdock
++
Whatever you do, work at it with all your heart,
as working for the Lord, not for men.
~Colossians 3:23 {{{
++
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Tab index

2003-10-22 Thread Hardik Doshi
Hi Group,

Currently i have setup the tabindex on the drop down
menu but it doesn't work on mozilla and safari
browser. It is only working with the IE. Tab index on
the text box and textarea fields are working perfectly
on cross browser. Does any one has a clue why the
tabindex on the drop down menu doesn't work on certain
browsers?

Thanks

Hardik Doshi

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Tab index

2003-10-22 Thread Payne
Hardik Doshi wrote:

Is it DHTML or Javascript? Becaucse DHTML doesn't work the same way on 
Browser. You will need to do a search on google DHTML and Netscape and 
Safari, you make want to use Javascript because then any browser can 
read it.

Payne

Hi Group,

Currently i have setup the tabindex on the drop down
menu but it doesn't work on mozilla and safari
browser. It is only working with the IE. Tab index on
the text box and textarea fields are working perfectly
on cross browser. Does any one has a clue why the
tabindex on the drop down menu doesn't work on certain
browsers?
Thanks

Hardik Doshi

__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
 

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


[PHP] Passing array variables in a GET

2003-10-22 Thread Jeff McKeon
Is this possible???

$blah[]=(a, b, c);

a href=http://www.blah.com/page.php?blah=?PHP ECHO $blah ?link/a

So basically I have a page that need an array to perform some function.
Can I pass that array variable (and thus it's data) to it from another
page?

Thanks,

Jeff

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



[PHP] Re: Using php for non-web based applications

2003-10-22 Thread Paul Scruby
OK I figured out a solution.
If your interested I am just calling from stdlib.h:
system(php myFile.xml);
and then passing the result on the stdout to XERCES using stdin.

Paul Scruby wrote:

Hi there,

I am not sure if this is the right list to post to as most of you guys are
probably run php as an Apache module.  However, I am currently using my
own xml data format for a non-web based application and I would like to be
able to embed php within it.  Is there a C/C++ library that I can link
against to execute the ?php ... ? inside my xml when I load it?  Can
someone point me in the right direction?

Many thanks,

Paul

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



Re: [PHP] is_uploaded_file() security

2003-10-22 Thread Alexander Mueller
Cpt John W. Holmes wrote:
 
 The user can pass the name of a file on the server. If you're not doing any
 checks and moving or displaying the file the user sent you, you may end
 up moving, deleting, or displaying any file on your server.
 
 ---John Holmes...

Thanks John, but only in the case global variables are active (as Marek
mentioned), right?

Alexander
-- 
PINO - The free Chatsystem!
Available at http://www.pino.org

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



Re: [PHP] Tab index

2003-10-22 Thread Hardik Doshi
I am using the HTML. Javascript is not standard of W3C
organization and that's why i don't want to use it.

Is there any other solution for setting up the
tabindex on the Drop down menu?

Thanks

Hardik

--- Payne [EMAIL PROTECTED] wrote:
 Hardik Doshi wrote:
 
 Is it DHTML or Javascript? Becaucse DHTML doesn't
 work the same way on 
 Browser. You will need to do a search on google
 DHTML and Netscape and 
 Safari, you make want to use Javascript because then
 any browser can 
 read it.
 
 Payne
 
 Hi Group,
 
 Currently i have setup the tabindex on the drop
 down
 menu but it doesn't work on mozilla and safari
 browser. It is only working with the IE. Tab index
 on
 the text box and textarea fields are working
 perfectly
 on cross browser. Does any one has a clue why the
 tabindex on the drop down menu doesn't work on
 certain
 browsers?
 
 Thanks
 
 Hardik Doshi
 
 __
 Do you Yahoo!?
 The New Yahoo! Shopping - with improved product
 search
 http://shopping.yahoo.com
 
   
 
 
 
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] Age from birthdate?

2003-10-22 Thread Eugene Lee
On Wed, Oct 22, 2003 at 06:31:21PM +0200, DvDmanDT wrote:
: 
: How would I get the age of someone if I store the birthdate in a date field?
: I just realized FLOOR((UNIX_TIMESTAMP(NOW()) -
: UNIX_TIMESTAMP(birthdate))/60/60/24/365.25)  wont work for persons born
: before 1970... :p I must get the current age in years, and I must be able to
: select by age... :p Any ideas?

Determining someone's age based on Unix timestamps was discussed earlier
this month.  Check the archives for a working function.

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



Re: [PHP] Tab index

2003-10-22 Thread John Nichel
Hardik Doshi wrote:
I am using the HTML. Javascript is not standard of W3C
organization and that's why i don't want to use it.
Is there any other solution for setting up the
tabindex on the Drop down menu?
Thanks

Hardik
Wrong list.  Better results if you ask this question on a 
HTML/DHTML/JavaScript list.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Passing array variables in a GET

2003-10-22 Thread Wouter van Vliet
Take a look at http://nl.php.net/manual/en/function.serialize.php and
http://nl.php.net/manual/en/function.unserialize.php. Or if the keys don't
matter and the array has just one level (strange, I know there's a different
term for that, totally cannot find it in my memory :S) you can consider
join() and split().

Wouter

-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday 22 October 2003 18:59
To: [EMAIL PROTECTED]
Subject: [PHP] Passing array variables in a GET

Is this possible???

$blah[]=(a, b, c);

a href=http://www.blah.com/page.php?blah=?PHP ECHO $blah ?link/a

So basically I have a page that need an array to perform some function.
Can I pass that array variable (and thus it's data) to it from another page?

Thanks,

Jeff

--
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] Sorting an array by value length.

2003-10-22 Thread Rolf Brusletto
Hey all -

I've been scouring the php.net site for a few hours now trying to find a 
viable way to sort a single dimensional array( array('0'='fddfsdsfdds', 
'1'=','d','2' = 'gofofle'); ). so that the longest lengthed 
item is at the top, and the smallest lengthed item is at the bottom 
is there a function to do this... example:

$arrayToSort = array('0' = 'shorter_length', '1' = 
'longer_than_longer_than_shorter_length', '2' = 
'longer_than_shorter_length');

and I would like to get... whether the keys change or not..

$arrayToSort[0] == 'longer_than_longer_than_shorter_length';
$arrayToSort[1] == 'longer_than_shorter_length';
$arrayToSort[2] == 'shorter_length';
any ideas?

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


[PHP] Re: Sorting an array by value length.

2003-10-22 Thread Justin Patrin
You want to use usort, which lets you specify a comparison function.

function cmpByLength($a, $b) {
  return strlen($a)  strlen($b);
}
usort($arrayToSort, 'cmpByLength');

And change the '' to '' if the ordering is wrong.

Rolf Brusletto wrote:
Hey all -

I've been scouring the php.net site for a few hours now trying to find a 
viable way to sort a single dimensional array( array('0'='fddfsdsfdds', 
'1'=','d','2' = 'gofofle'); ). so that the longest lengthed 
item is at the top, and the smallest lengthed item is at the bottom 
is there a function to do this... example:

$arrayToSort = array('0' = 'shorter_length', '1' = 
'longer_than_longer_than_shorter_length', '2' = 
'longer_than_shorter_length');

and I would like to get... whether the keys change or not..

$arrayToSort[0] == 'longer_than_longer_than_shorter_length';
$arrayToSort[1] == 'longer_than_shorter_length';
$arrayToSort[2] == 'shorter_length';
any ideas?

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


Re: [PHP] is_uploaded_file() security

2003-10-22 Thread CPT John W. Holmes
From: Alexander Mueller [EMAIL PROTECTED]
 Cpt John W. Holmes wrote:
 
  The user can pass the name of a file on the server. If you're not doing
any
  checks and moving or displaying the file the user sent you, you may
end
  up moving, deleting, or displaying any file on your server.
 
  ---John Holmes...

 Thanks John, but only in the case global variables are active (as Marek
 mentioned), right?

I don't think so. Test this, but I think you can just type /etc/passwd into
the file name box (instead of using the browse button) and have that value
submitted in the form. May be dependent upon the browser on how it's
handled, though.

Either way, I can still construct a POST to your site using cURL or
something to simulate sending you a file with a name of a file on your
server.

So, validate that the file is actually an uploaded file and not a path to
something else. That's why the functions exist.

---John Holmes...

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



[PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Shaun Campbell
I've got a problem getting sessions to work and I wondered if anyone could
offer any advice.

The example I am using is to get one page to set variables in a session and
then use another page to retrieve them.  I am using 4.3.4RC2 and prior to
that 4.3..3 on Win2k with IE6 and Apache 1.3.22.

The code is:

page1.php
--
?php
 session_start();

 $_SESSION['foo'] = 'Hello';
 $_SESSION['bar'] = 'World';

 ?
HTML
HEAD
TITLE
/TITLE
/HEAD
BODY

Variables set in session - hopefully???

?php
 echo foo = {$_SESSION['foo']}BR;
 echo bar = {$_SESSION['bar']};
?

form action=page2.php method=post
input type=submit name=submit value=Page 2 /
/form

/BODY
/HTML

page2.php
--
?php
 session_start();
 echo foo = {$_SESSION['foo']};
 echo bar = {$_SESSION['bar']};

?

On page 1 I am seeing the session variables displayed correctly i.e. Hello
World and I can see a session file created in my temp directory with the
correct values in there.  However, when I display page 2 the variables are
always displayed blank and what seems to happen is that a new empty session
file is created in my temp directory.  It's as though the second page is not
related to the same session somehow.  I've also tried lots of other examples
from books and on the net and I still can't get sessions to work.

Am I doing something wrong in connecting the two pages although I don't
close the browser down at all between the two?

Any ideas would be greatly appreciated.

Thanks

Shaun Campbell



-- 
Shaun Campbell
IT Consultant
apps2net

Tel: 07900 911072
Email: [EMAIL PROTECTED]
Web: www.apps2net.co.uk

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



Re: [PHP] Session output question

2003-10-22 Thread CPT John W. Holmes
From: Susan Ator [EMAIL PROTECTED]
 1) Is there any way to print out active sessions names?

 I have $_SESSION['SID'], $_SESSION['uid'], $_SESSION['msg']
 can I output the literal strings:
 $_SESSION['SID']
 $_SESSION['uid']
 $_SESSION['msg']

$keys = array_keys($_SESSION);

 2) Is there any way to use a variable in a session name?

 can I do:
 $msg=20031022
 $_SESSION[$msg.name] becomes $_SESSION['20031022name']

Just like that or $_SESSION[$msg.'name']. Same rules as making a string
anywhere else; that's all you're doing.

---John Holmes...

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



[PHP] command line arguments

2003-10-22 Thread Dan Joseph
Hi,

I'm having trouble remember something

I have a php script that I want to run from a command line:

% /usr/local/bin/php script.php 47264

47264 is the argument, however, I can't figure out how to access it inside
the script.  I thought it was the $ARG array or $ARGV, but I am mistaken...
can only refresh me?  searching did no good.

-Dan Joseph

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



RE: [PHP] Session output question

2003-10-22 Thread Susan Ator
Perfect. Thank you so much. That was exactly what I needed.

Susan

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 22, 2003 1:53 PM
To: Susan Ator; [EMAIL PROTECTED]
Subject: Re: [PHP] Session output question


From: Susan Ator [EMAIL PROTECTED]
 1) Is there any way to print out active sessions names?

 I have $_SESSION['SID'], $_SESSION['uid'], $_SESSION['msg']
 can I output the literal strings:
 $_SESSION['SID']
 $_SESSION['uid']
 $_SESSION['msg']

$keys = array_keys($_SESSION);

 2) Is there any way to use a variable in a session name?

 can I do:
 $msg=20031022
 $_SESSION[$msg.name] becomes $_SESSION['20031022name']

Just like that or $_SESSION[$msg.'name']. Same rules as making a string
anywhere else; that's all you're doing.

---John Holmes...

-- 
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] is_uploaded_file() security

2003-10-22 Thread Marek Kilimajer
CPT John W. Holmes wrote:
I don't think so. Test this, but I think you can just type /etc/passwd into
the file name box (instead of using the browse button) and have that value
submitted in the form. May be dependent upon the browser on how it's
handled, though.
You would send your own /etc/passwd to the server.
Either way, I can still construct a POST to your site using cURL or
something to simulate sending you a file with a name of a file on your
server.
I checked it. I tried phpinfo.php?_FILES[file][tmp_name]=/etc/passwd and 
$_FILES superglobal was not set. My guess is it is the same for post and 
cookies. But who knows if this will be the same in PHP7 ;)

So, validate that the file is actually an uploaded file and not a path to
something else. That's why the functions exist.
---John Holmes...

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


Re: [PHP] Sorting an array by value length.

2003-10-22 Thread David Otton
On Wed, 22 Oct 2003 11:21:13 -0700, you wrote:

I've been scouring the php.net site for a few hours now trying to find a 
viable way to sort a single dimensional array( array('0'='fddfsdsfdds', 
'1'=','d','2' = 'gofofle'); ). so that the longest lengthed 
item is at the top, and the smallest lengthed item is at the bottom 
is there a function to do this... example:

?php

function cmp ($a, $b) {
$a = strlen ($a);
$b = strlen ($b);

if ($a == $b) return (0);
return (($a  $b) ? -1 : 1);
}

$a = array ('a', 'aa', 'aaa', '', 'a');

usort ($a, cmp);

print_r ($a);

?

Standard warning: usort() has side-effects:

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



[PHP] Images being uploaded in ASCII format

2003-10-22 Thread Pablo Gosse
Hi all.  I'd like to take a brief sentence to introduce myself first.
My name is Pablo Gosse, and I've just recently joined the php-general
list.  I've been using PHP since early 2000, and work as webmaster
at the University of Northern British Columbia.

I'm running into a problem with file uploads being handled in ascii
rather than binary format.

I've been writing a CMS for the past few months and the wysiwyg editor
we're integrating has a very nice image manager built in
(www.devedit.com).  However, the uploads are being transferred in ascii
format instead of binary (or auto-detect) which is mangling all the
images.

I've done a lot of research into this but can't seem to pin down the
problem.  I've looked through both my php.ini and httpd.conf and can't
seem to find anything there that would remedy this problem.

Does anyone have any advice as to where I should be looking to fix this
problem?

Thanks much in advance.

Cheers,
Pablo

---
Pablo Gosse
Webmaster
University of Northern British Columbia
250.960.5621
[EMAIL PROTECTED]
---

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



Re: [PHP] command line arguments

2003-10-22 Thread Robert Cummings
Use $argv, that failing it definately works with $_SERVER['argv']

Cheers,
Rob.

On Wed, 2003-10-22 at 13:59, Dan Joseph wrote:
 Hi,
 
   I'm having trouble remember something
 
   I have a php script that I want to run from a command line:
 
   % /usr/local/bin/php script.php 47264
 
   47264 is the argument, however, I can't figure out how to access it inside
 the script.  I thought it was the $ARG array or $ARGV, but I am mistaken...
 can only refresh me?  searching did no good.
 
 -Dan Joseph
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Archives

2003-10-22 Thread Nathan Taylor
Hey guys,

Just a quickie: where are the archives for this list? What URL?

Thanks,
Nathan Taylor

Re: [PHP] Archives

2003-10-22 Thread Chris Garaffa
On Oct 22, 2003, at 2:27 PM, Nathan Taylor wrote:

Hey guys,

Just a quickie: where are the archives for this list? What URL?
You'll find the answer in the arch--- oops, nevermind.
This URL was just launched: http://phparch.com/mailinglists
--
Chris Garaffa
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Archives

2003-10-22 Thread John Nichel
Nathan Taylor wrote:
Hey guys,

Just a quickie: where are the archives for this list? What URL?

Thanks,
Nathan Taylor
Here...
http://marc.theaimsgroup.com/?l=php-generalr=1w=2
or here...
http://news.php.net/group.php?group=php.general
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] test

2003-10-22 Thread Reidar
Just testing prior problems

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



Re: [PHP] Tab index

2003-10-22 Thread Ray Hunter
On Wed, 2003-10-22 at 11:07, John Nichel wrote:
 Hardik Doshi wrote:
  I am using the HTML. Javascript is not standard of W3C
  organization and that's why i don't want to use it.
  
  Is there any other solution for setting up the
  tabindex on the Drop down menu?
  
  Thanks
  
  Hardik
 
 Wrong list.  Better results if you ask this question on a 
 HTML/DHTML/JavaScript list.

Also check out groups on google, there is tons of great information
there on these types of groups.

--
Ray

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Shaun Campbell wrote:
I've got a problem getting sessions to work and I wondered if anyone could
offer any advice.
The example I am using is to get one page to set variables in a session and
then use another page to retrieve them.  I am using 4.3.4RC2 and prior to
that 4.3..3 on Win2k with IE6 and Apache 1.3.22.
The code is:

page1.php
--
?php
 session_start();
 $_SESSION['foo'] = 'Hello';
 $_SESSION['bar'] = 'World';
 ?
HTML
HEAD
TITLE
/TITLE
/HEAD
BODY
Variables set in session - hopefully???

?php
 echo foo = {$_SESSION['foo']}BR;
 echo bar = {$_SESSION['bar']};
?
Get rid of the foo = and the bar =.  when you use the single equals 
sign, you're setting value

?php
echo { $_SESSION['foo'] . BR\n);
echo { $_SESSION['bar'] };
?
form action=page2.php method=post
input type=submit name=submit value=Page 2 /
/form
/BODY
/HTML
page2.php
--
?php
 session_start();
 echo foo = {$_SESSION['foo']};
 echo bar = {$_SESSION['bar']};
?
Same here

?php
echo { $_SESSION['foo'] . BR\n);
echo { $_SESSION['bar'] };
?
On page 1 I am seeing the session variables displayed correctly i.e. Hello
World and I can see a session file created in my temp directory with the
correct values in there.  However, when I display page 2 the variables are
always displayed blank and what seems to happen is that a new empty session
file is created in my temp directory.  It's as though the second page is not
related to the same session somehow.  I've also tried lots of other examples
from books and on the net and I still can't get sessions to work.
Am I doing something wrong in connecting the two pages although I don't
close the browser down at all between the two?
Any ideas would be greatly appreciated.

Thanks

Shaun Campbell


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Tian, Simon (Contractor) (DSCP)


Hi all,


I have a website written in php3 , but the isp just did a upgrade of PHP
4.3.3. it was
a php 4 and it worked fine with my php3 progarm

then some part of my website does not work right

radio button click get no response 

detail please go to my website

go to findhealer.com and click yellow pages
then click a profession like acupuncture ( radio button ) and chose a state
say carlifornia

then click the show list button

then you will find what is wrong,

any suggestion ?

let me know

Thanks for your help in advance


simon 

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Daniel Guerrier
The second page should be

?php
session_start();
 echo { $_SESSION['foo'] . BR\n);
 echo { $_SESSION['bar'] };
?

you're missing the session_start()

You need it on every page that you plan to use session
on.  

--- John Nichel [EMAIL PROTECTED] wrote:
 Shaun Campbell wrote:
  I've got a problem getting sessions to work and I
 wondered if anyone could
  offer any advice.
  
  The example I am using is to get one page to set
 variables in a session and
  then use another page to retrieve them.  I am
 using 4.3.4RC2 and prior to
  that 4.3..3 on Win2k with IE6 and Apache 1.3.22.
  
  The code is:
  
  page1.php
  --
  ?php
   session_start();
  
   $_SESSION['foo'] = 'Hello';
   $_SESSION['bar'] = 'World';
  
   ?
  HTML
  HEAD
  TITLE
  /TITLE
  /HEAD
  BODY
  
  Variables set in session - hopefully???
  
  ?php
   echo foo = {$_SESSION['foo']}BR;
   echo bar = {$_SESSION['bar']};
  ?
 
 Get rid of the foo = and the bar =.  when you
 use the single equals 
 sign, you're setting value
 
 ?php
  echo { $_SESSION['foo'] . BR\n);
  echo { $_SESSION['bar'] };
 ?
 
  form action=page2.php method=post
  input type=submit name=submit value=Page 2
 /
  /form
  
  /BODY
  /HTML
  
  page2.php
  --
  ?php
   session_start();
   echo foo = {$_SESSION['foo']};
   echo bar = {$_SESSION['bar']};
  ?
 
 Same here
 
 ?php
  echo { $_SESSION['foo'] . BR\n);
  echo { $_SESSION['bar'] };
 ?
 
  On page 1 I am seeing the session variables
 displayed correctly i.e. Hello
  World and I can see a session file created in my
 temp directory with the
  correct values in there.  However, when I display
 page 2 the variables are
  always displayed blank and what seems to happen is
 that a new empty session
  file is created in my temp directory.  It's as
 though the second page is not
  related to the same session somehow.  I've also
 tried lots of other examples
  from books and on the net and I still can't get
 sessions to work.
  
  Am I doing something wrong in connecting the two
 pages although I don't
  close the browser down at all between the two?
  
  Any ideas would be greatly appreciated.
  
  Thanks
  
  Shaun Campbell
 
 
 
 -- 
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



Re: [PHP] command line arguments

2003-10-22 Thread Ray Hunter
 I have a php script that I want to run from a command line:
 
 % /usr/local/bin/php script.php 47264
 
 47264 is the argument, however, I can't figure out how to access it inside
 the script.  I thought it was the $ARG array or $ARGV, but I am mistaken...
 can only refresh me?  searching did no good.

$argv is an array that will give you the values and $argc will give you
the total number (count) of arguments.

Also, make sure that you have your php.ini file set up to populate those
variables.

Check this tutorial out: http://www.phpb.com/columns/ray/cli/

To get you started.

--
Ray

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Daniel Guerrier wrote:
The second page should be

?php
session_start();
 echo { $_SESSION['foo'] . BR\n);
 echo { $_SESSION['bar'] };
?
you're missing the session_start()

You need it on every page that you plan to use session
on.
He has session_start() on page two.

snip
page2.php
--
?php
session_start();
echo foo = {$_SESSION['foo']};
echo bar = {$_SESSION['bar']};
?
Same here

?php
echo { $_SESSION['foo'] . BR\n);
echo { $_SESSION['bar'] };
?
/snip

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: Re: PHP3 files compatibilty with PHP4

2003-10-22 Thread Tian, Simon (Contractor) (DSCP)
Hi all,

i am also looking a person to maintain my website findhealer.com
with a monthly payment

thanks

simon 

-Original Message-
From: Tian, Simon (Contractor) (DSCP) 
Sent: Wednesday, October 22, 2003 2:22 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: '[EMAIL PROTECTED]'
Subject: Re: PHP3 files compatibilty with PHP4




Hi all,


I have a website written in php3 , but the isp just did a upgrade of PHP
4.3.3. it was
a php 4 and it worked fine with my php3 progarm

then some part of my website does not work right

radio button click get no response 

detail please go to my website

go to findhealer.com and click yellow pages
then click a profession like acupuncture ( radio button ) and chose a state
say carlifornia

then click the show list button

then you will find what is wrong,

any suggestion ?

let me know

Thanks for your help in advance


simon 

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



RE: [PHP] command line arguments

2003-10-22 Thread Dan Joseph
Ahh ok, yeah, $_SERVER['argv'][1] works like a charm, thanks.

 Use $argv, that failing it definately works with $_SERVER['argv']

-Dan Joseph

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Daniel Guerrier
Your right :)

I think he's using the brackets instead of parenthesis
in the echo's.
Change the {} to ()

--- John Nichel [EMAIL PROTECTED] wrote:
 Daniel Guerrier wrote:
  The second page should be
  
  ?php
  session_start();
   echo { $_SESSION['foo'] . BR\n);
   echo { $_SESSION['bar'] };
  ?
  
  you're missing the session_start()
  
  You need it on every page that you plan to use
 session
  on.
 
 He has session_start() on page two.
 
 snip
 
 page2.php
 --
 ?php
  session_start();
  echo foo = {$_SESSION['foo']};
  echo bar = {$_SESSION['bar']};
 ?
 
 Same here
 
 ?php
  echo { $_SESSION['foo'] . BR\n);
  echo { $_SESSION['bar'] };
 ?
 /snip
 
 -- 
 By-Tor.com
 It's all about the Rush
 http://www.by-tor.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] Passing array variables in a GET

2003-10-22 Thread Jeff McKeon
I looked at the page you suggested but it vauge at best.  Basically from
what I've gathered using serialize with an array screws up the pointers
in the array.  Is this true?

What I've done is this but it doesn't seem to be working...

Pull data (two fields) from a mysql table and put the results into two
arrays, one for each field

Query results for field 1 - Array1[]
Query results for field 2 - Array2[]

Then I create a variable with the imploded data from the arrays

$var1=implode(:, $Array1);
$var2=implode(:, $Array2);

Then serialize the variables...

$varSER1=serialize($var1);
$varSER2=serialize($var2);

Then pass the variables in the url via a GET.  

It doesn't work however

Jeff 

 -Original Message-
 From: Wouter van Vliet [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 22, 2003 1:06 PM
 To: Jeff McKeon; [EMAIL PROTECTED]
 Subject: RE: [PHP] Passing array variables in a GET
 
 
 Take a look at 
 http://nl.php.net/manual/en/function.serialize.php and 
 http://nl.php.net/manual/en/function.unseriali ze.php. Or if 
 the keys don't matter and the array has just 
 one level (strange, I know there's a different term for that, 
 totally cannot find it in my memory :S) you can consider
 join() and split().
 
 Wouter
 
 -Original Message-
 From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday 22 October 2003 18:59
 To: [EMAIL PROTECTED]
 Subject: [PHP] Passing array variables in a GET
 
 Is this possible???
 
 $blah[]=(a, b, c);
 
 a href=http://www.blah.com/page.php?blah=?PHP ECHO $blah 
 ?link/a
 
 So basically I have a page that need an array to perform some 
 function. Can I pass that array variable (and thus it's data) 
 to it from another page?
 
 Thanks,
 
 Jeff
 
 --
 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] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Daniel Guerrier wrote:
Your right :)

I think he's using the brackets instead of parenthesis
in the echo's.
Change the {} to ()
Yep, he is...didn't notice that on the first pass.  The code I cut and 
pasted from his with have errors

Fixed code

echo ( $_SESSION['foo'] . BR\n );
echo ( $_SESSION['bar'] );
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] there has to be a better way...

2003-10-22 Thread Daevid Vincent
Here is a snippet from my dhcp web page found on my site below... Not
exactly what you want, but could help you start...

// read in the dhcp_map.ini file to map MAC addresses to images
$mapFile = ./dhcp_map.ini;
if( $fp = @fopen($mapFile, r) )
{
while( $line = fgets($fp, 1024) )
if ($line{0} != #) $tempMap .= $line;  // strip
out # comments
} else echo ERROR: Can't read .$mapFile.BR;
fclose ($fp);
$map = explode(\n, $tempMap);
//print_r($map);
for($i = 0; $i  count($map); $i++)
{
list($mac, $image, $name) = preg_split(/\s/,$map[$i], -1,
PREG_SPLIT_NO_EMPTY);
//if ( array_key_exists($mac, $machine))
$machine[$mac]-setImage($image);
if ( isset($machine[$mac]) )
$machine[$mac]-setImage($image);
if ( isset($machine[$mac])  $name !=  
$machine[$mac]-getName() == ) $machine[$mac]-name = $name;
}
unset($tempMap);
unset($map);


#  dhcp_map.ini file
#  MAC ADDRESS: GIF IMAGE:  NAME:
00:09:12:86:48:54   linux   LINUX
00:0B:AD:31:AA:A6   tivoThad's
00:0B:AD:08:38:C3   tivoDaevid's



Daevid Vincent
http://daevid.com
  

 -Original Message-
 From: jsWalter [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 22, 2003 1:11 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] there has to be a better way...
 
 I need to read (write comes later) from a config file that we 
 used to handle
 manually.
 
 I'm getting lazy, so I'm writing a web interface for this.
 
 What I have does this...
   - open a given file
   - dump entire file into a string
   - explode string into an array at the EOL marker
   - walk down this new array
   - decide if there is anything in current element
   - decide if current line is a comment
   - split line at '=' into 2 variables
   - add new key and value from these variables back into array
   - kill original array element
 
 There must be a better way to do this.
 
 All this seems a bit over kill to me.
 
 Does anyone have any ideas on this?
 
 Thanks
 
 Walter
 
 This is what I have...
 
 ?php
 
 $config = $list . '/home/walter/vmd/config';
 
 // Open the file
 $handle = fopen ($config, r);
 
 // Read entire file into var
 $content = fread($handle, filesize($config));
 
 // convert var into array and explode file via line break
 $content = split(\r\n, $content);
 
 // close file
 fclose($handle);
 
 // Loop through file contents array
 foreach ($content as $i = $value)
 {
// If we have any data in this line
if (! empty ($value))
{
   // If this line is not a comment
   if ( $value{0} != '#')
   {
  list($a, $b) = split(=, $value);
  $content[$a] = $b;
   }
 
   // kill original array element
   unset($content[$i]);
}
 }
 
 // show me what I have
 echo 'pre';
 echo print_r($content);
 echo '/pre';
 
 ?
 
 # Sample config file data, just 2 lines from the file...
 #
 # The Personal Name of the list, used in outgoing headers.
 # If empty, default is the same as the list's username.
 # if explicitly `false', then it is redefined empty.
 LIST_NAME=RMT Working Group
 
 # The address of the list's admin or owner.
 # if explicitly `false', then it is redefined empty.
 [EMAIL PROTECTED]
 
 ...
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] Archives

2003-10-22 Thread Nathan Taylor
Thanks John and and Chris.
  - Original Message - 
  From: John Nichel 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, October 22, 2003 2:26 PM
  Subject: Re: [PHP] Archives


  Nathan Taylor wrote:
   Hey guys,
   
   Just a quickie: where are the archives for this list? What URL?
   
   Thanks,
   Nathan Taylor

  Here...
  http://marc.theaimsgroup.com/?l=php-generalr=1w=2

  or here...
  http://news.php.net/group.php?group=php.general

  -- 
  By-Tor.com
  It's all about the Rush
  http://www.by-tor.com

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



RE: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Chris W. Parker
John Nichel mailto:[EMAIL PROTECTED]
on Wednesday, October 22, 2003 11:33 AM said:

 ?php
  echo foo = {$_SESSION['foo']}BR;
  echo bar = {$_SESSION['bar']};
 
 Get rid of the foo = and the bar =.  when you use the single
 equals sign, you're setting value

Not when it's inside a string.

His statements should output the following:


foo = somevalueBR
bar = anothervalue

Also... he's using { and } because you can't access an array's value
unless it's within curly braces.


Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Chris W. Parker wrote:
John Nichel mailto:[EMAIL PROTECTED]
on Wednesday, October 22, 2003 11:33 AM said:

?php
echo foo = {$_SESSION['foo']}BR;
echo bar = {$_SESSION['bar']};
Get rid of the foo = and the bar =.  when you use the single
equals sign, you're setting value


Not when it's inside a string.

His statements should output the following:

foo = somevalueBR
bar = anothervalue
Also... he's using { and } because you can't access an array's value
unless it's within curly braces.
Duh, that's what I get for just glancing at it.  This is why the 'other' 
John is wearing the crown now.  :)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Chris Boget
 ?php
  echo foo = {$_SESSION['foo']}BR;
  echo bar = {$_SESSION['bar']};
 Not when it's inside a string.
 His statements should output the following:
 foo = somevalueBR
 bar = anothervalue
 Also... he's using { and } because you can't access an array's value
 unless it's within curly braces.

Not entirely true.  You can still do the following:

echo foo = $_SESSION[foo]BR;
echo bar = $_SESSION[bar];

Chris

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



[PHP] Age from birthdate?

2003-10-22 Thread DvDmanDT
How would I get the age of someone if I store the birthdate in a date field?
I just realized FLOOR((UNIX_TIMESTAMP(NOW()) -
UNIX_TIMESTAMP(birthdate))/60/60/24/365.25)  wont work for persons born
before 1970... :p I must get the current age in years, and I must be able to
select by age... :p Any ideas?

-- 
// DvDmanDT
MSN: [EMAIL PROTECTED]
Mail: [EMAIL PROTECTED]

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Chris Boget wrote:
?php
echo foo = {$_SESSION['foo']}BR;
echo bar = {$_SESSION['bar']};
Not when it's inside a string.
His statements should output the following:
foo = somevalueBR
bar = anothervalue
Also... he's using { and } because you can't access an array's value
unless it's within curly braces.


Not entirely true.  You can still do the following:

echo foo = $_SESSION[foo]BR;
echo bar = $_SESSION[bar];
Chris

Okay, so we're back to square onewhy his sessions aren't working. 
This thread has been snipped too much, and I've already deleted the 
original, so I don't have the code that wasn't working.

On a side note, Chris, are you in Louisiana?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Simple array question

2003-10-22 Thread René Fournier
Is there a simple way to return the key (name) of one element in an 
array? I looked up key() in the docs, but there are no examples or 
notes...

Thanks.

...Rene

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


[PHP] Re: Simple array question

2003-10-22 Thread Rob Adams
René fournier [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Is there a simple way to return the key (name) of one element in an
 array? I looked up key() in the docs, but there are no examples or
 notes...

key() will do it, but you have to have the internal pointer already on the
element you want.  If you're not using next(), prev(), etc, then what you
probably want to use it array_search().

  -- Rob




 Thanks.

 ...Rene


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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread Chris Boget
 Okay, so we're back to square onewhy his sessions aren't working. 
 This thread has been snipped too much, and I've already deleted the 
 original, so I don't have the code that wasn't working.

Sadly, I don't have the original, either. :|
 
 On a side note, Chris, are you in Louisiana?

Yes, why?

Chris

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



Re: [PHP] Newbie - Can't get sessions to work

2003-10-22 Thread John Nichel
Chris Boget wrote:
Okay, so we're back to square onewhy his sessions aren't working. 
This thread has been snipped too much, and I've already deleted the 
original, so I don't have the code that wasn't working.


Sadly, I don't have the original, either. :|
I just pulled it from the archives on php.net, cut and pasted his code 
into two files on my machine, tested it, and it worked fine.  Guess we 
have to wait for the OP to come back and let us know what's wrong. :)

On a side note, Chris, are you in Louisiana?


Yes, why?

Chris

Just saw the wild.net email address, and I knew that they're located on 
my side of the lake (as well as in the UK).  I applied for a php 
position at Wild.net a while backy'all ready to hire me yet?  *L* 
Do you happen to know a guy by the name of Robert Collins?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Simple array question

2003-10-22 Thread Jason Wong
On Friday 24 October 2003 03:01, Ren Fournier wrote:
 Is there a simple way to return the key (name) of one element in an
 array? I looked up key() in the docs, but there are no examples or
 notes...

array_search()

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Neuroses are red,
Melancholia's blue.
I'm schizophrenic,
What are you?
*/

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



[PHP] link question

2003-10-22 Thread Davy Campano
I have a php page that makes a table from data in a mySQL database.
What I want to do is make the first entry in the table be a Unique key
that is a link, that when you click on this key it opens another page
with some more information.  Basically I am trying to figure out how to
pass this key from this page to the next.  Thanks for any help!

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



[PHP] php with Interbase ?

2003-10-22 Thread Luiz Gustavo Sarubi Macchi
Hi all, 

Please, I´d like to compile my php with interbase. I know that i should
put --with-interbase[=DIR], but what else should i put in configure ?

Is anyone has a script to do this ?

Should I compile apache too ?

thanks a any help


I´m using:

Mandrake 9.1 kernel 2.4.21-0.13mdk
php-ini-4.3.0-1mdk
mod_php-4.3.1-1mdk
php-readline-4.3.0-1mdk
php-domxml-4.3.0-2mdk
php-xslt-4.3.0-3mdk
php-manual-en-4.3.0-2mdk
libphp_common430-430-11mdk
php-gd-4.3.0-2mdk
php-tclink-4.3.0_3.3.1-12mdk
php-cli-4.3.1-11mdk
php-cgi-4.3.1-11mdk
php-mysql-4.3.0-2mdk
phpgroupware-0.9.14-2mdk
php-xmlrpc-4.3.0-2mdk
php430-devel-430-11mdk
apache2-mod_php-2.0.44_4.3.1-2mdk
php-rrdtool-1.0.40-2mdk
php-xml-4.3.0-2mdk






gugao

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



Re: [PHP] (ANNOUNCE) New PHP mailing list *searchable* archives

2003-10-22 Thread David T-G
Richard, et al --

...and then Richard Baskett said...
% 
% on 10/21/03 16:40, David T-G at [EMAIL PROTECTED] wrote:
% 
%  ...and then Marco Tabini said...
%  % 
%  % php.general for new messages and send back an e-mail to the list with
...
%  
%  A nice idea, but terribly difficult to implement practically.  It was
%  tried on the mutt-users list and the manitainer was roundly flamed :-)
% 
% It seems like it would be ok to have it sent to the person that asked the
% question...  And then if they did not want to receive those notices, then
% they could opt out of that..

That sounds a lot like opt-out spam.  Is it OK for me to send you lots of
unsolicted, form-letter, machine-generated emails? :-)

It wasn't pretty.


% 
% Rick


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!



pgp0.pgp
Description: PGP signature


RE: [PHP] link question

2003-10-22 Thread Pablo Gosse
a href=path/to/file.php?var=?php echo $val; ?link/a

And on the receiving page access var via $_GET['var']

Of course, how you actually append the value in question to your link
will depend on your own code.

I use ADOdb for all my db work, so for me it would be something like
this:

echo 'table';
while (!$rs-EOF)
{
echo 'tr
tda
href=/path/to/file.php?var='.$rs-fields['unique_key'].'link/a/td
tdmore table cells.../td
/tr
$rs-MoveNext();
}
echo '/table';

Cheers,
Pablo

-Original Message-
From: Davy Campano [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 22, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: [PHP] link question

I have a php page that makes a table from data in a mySQL database.
What I want to do is make the first entry in the table be a Unique key
that is a link, that when you click on this key it opens another page
with some more information.  Basically I am trying to figure out how to
pass this key from this page to the next.  Thanks for any help!

-- 
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 array variables in a GET

2003-10-22 Thread Jason Wong
On Thursday 23 October 2003 02:41, Jeff McKeon wrote:

 I looked at the page you suggested but it vauge at best.  Basically from
 what I've gathered using serialize with an array screws up the pointers
 in the array.  Is this true?

If you mean the internal pointer, ie the one that is reset by calling reset(), 
then who cares. Keeping that pointer across pages has little/no value. What 
is important is that the structure and values of the array is intact.

 What I've done is this but it doesn't seem to be working...

 Pull data (two fields) from a mysql table and put the results into two
 arrays, one for each field

 Query results for field 1 - Array1[]
 Query results for field 2 - Array2[]

 Then I create a variable with the imploded data from the arrays

 $var1=implode(:, $Array1);
 $var2=implode(:, $Array2);

 Then serialize the variables...

 $varSER1=serialize($var1);
 $varSER2=serialize($var2);

AFAICS serialize() on a string seems to be redundant. serialize() is supposed 
to represent some complex entity (eg an array) as a string so it can be 
easily stored, transmitted etc.

So something like:

  $var_to_pass_in_url = urlencode(serialize($Array1));

Then construct your url like so:

  http://www.example.com/example.php?Array1=$var_to_pass_in_url

Then in example.php you reconstruct the array:

  $Array1 = unserialize($_GET['Array1']);

ought to work (but untested).

 Then pass the variables in the url via a GET.

 It doesn't work however

*How* doesn't *What* work?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
The opposite of a correct statement is a false statement. But the opposite
of a profound truth may well be another profound truth.
-- Niels Bohr
*/

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



Re: [PHP] Session output question

2003-10-22 Thread Curt Zirzow
* Thus wrote Susan Ator ([EMAIL PROTECTED]):
 
 2) Is there any way to use a variable in a session name?
 
   can I do:
   $msg=20031022
   $_SESSION[$msg.name] becomes $_SESSION['20031022name']

In this case the _SESSION key is 20031022.name. You'll want
something like:

  $_SESSION[{$msg}name] or
  $_SESSION[$msg.'name']


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



  1   2   >