RE: [PHP] Quickie array question

2003-06-11 Thread Jennifer Goodie

 foreach($newlines as $newline) {

 #how do I get the index of the array each time $newline is printed out?

 echo ??;
 }

foreach($newlines as $id=$newline){
echo $id.''.$newline;
}

read the documentation
http://us3.php.net/manual/en/control-structures.foreach.php


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



RE: [PHP] Quickie

2002-09-30 Thread John W. Holmes

Is register globals on or off?

---John Holmes...

 -Original Message-
 From: Daniel Alsén [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 30, 2002 12:19 PM
 To: php general
 Subject: [PHP] Quickie
 
 Guys,
 
 i've been away for a while - enjoying a much needed vacation in lovely
 Hungary and expanding my company. Now im back to bother you with easy
 questions ;)
 
 I am doing a small site multilingual and will display different
content
 depending on what language the user choses. When the user comes to the
 site
 i want the default language to be swedish and is setting it in a
session:
 
 session_start();
 session_register(lang);
 if (!isset($lang)) { $lang = 'se'; }
 
 However - i can´t change the value for $lang after that. It gets set
to
 'se'
 every time the page loads. Shouldn't row 3 only be executed if $lang
isn't
 already assigned a value?
 
 Regards
 - D
 
 
 
 
 --
 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] Quickie

2002-09-30 Thread John W. Holmes

 John W. Holmes propably said:
 
  Is register globals on or off?
 
 On.
 
 Now - without doing anything - i managed to change the value of $lang
to
 'en' with a link (pagesname.php?lang=en). But i can't change it back
with
 ?lang=se. Should i get someting to eat to get my brain working?

Here's the problem with register globals. If you pass $lang in the url,
it's a get variable. But when you call session_start, $lang is being
overwritten with the $lang from the session. So you're not changing it.
Try passing a $change_to_lang=en, and then 

If(isset($change_to_lang)) { $lang = $change_to_lang; }

Hope that helps.

---John Holmes...



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




RE: [PHP] Quickie

2001-09-22 Thread Niklas Lampen

Read chapter: LXXVIII. Session handling functions


Niklas

-Original Message-
From: Peter [mailto:[EMAIL PROTECTED]]
Sent: 22. syyskuuta 2001 8:19
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Quickie


Hi,

I am trying to redirect the user to another page after user authentication
and using sessions.

I was wondering how do you redirect to another page and then at the same
use pass the session ID over to that other page.

Thanks.

Peter

On Fri, 21 Sep 2001, [iso-8859-1] Stig-Ørjan Smelror wrote:

  If nothing is beeing sent to output on the page then use header() else
  you need to use javascript.
 
 
  Niklas
 

 meta http-equiv=Refresh; Content=0; URL=file.php
 if headers are sent.

 Use header( Location: file.php ), as noted earlier, if no headers are
sent.






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Quickie

2001-09-21 Thread Peter

Hi,

I am trying to redirect the user to another page after user authentication
and using sessions.

I was wondering how do you redirect to another page and then at the same
use pass the session ID over to that other page.

Thanks.

Peter

On Fri, 21 Sep 2001, [iso-8859-1] Stig-Ørjan Smelror wrote:

  If nothing is beeing sent to output on the page then use header() else
  you need to use javascript.
  
  
  Niklas
  
 
 meta http-equiv=Refresh; Content=0; URL=file.php
 if headers are sent.
 
 Use header( Location: file.php ), as noted earlier, if no headers are sent.
 
 
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Quickie

2001-09-21 Thread Niklas Lampén

If nothing is beeing sent to output on the page then use header() else you
need to use javascript.


Niklas

-Original Message-
From: Daniel Alsén [mailto:[EMAIL PROTECTED]]
Sent: 21. syyskuuta 2001 15:51
To: php
Subject: [PHP] Quickie


How do i send the user on to another page at the end of the execution of a
script?

# Daniel Alsén| www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   |  #


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Quickie

2001-09-21 Thread Stig-Ørjan Smelror

 If nothing is beeing sent to output on the page then use header() else
 you need to use javascript.
 
 
 Niklas
 

meta http-equiv=Refresh; Content=0; URL=file.php
if headers are sent.

Use header( Location: file.php ), as noted earlier, if no headers are sent.



-- 
Stig-Ørjan Smelror
Systemutvikler

Linux Communications AS
Sandakerveien 48b
Box 1801 - Vika
N-0123 Oslo, Norway

tel. +47 22 09 28 80
fax. +47 22 09 28 81
http://www.lincom.no/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]