Re: [PHP] How do I use sessions if cookies are turned off in the browser?

2004-08-19 Thread Jake Stonebender
On Thu, 19 Aug 2004 16:50:28 -0400, Don [EMAIL PROTECTED] wrote:
 Q1. Is this because sessions use session cookies and IE blocks these at high
 security?
 
 Q2. I was told that if cookies are turned off, there is a way to use the
 session ID variable to accomplish what I want instead of cookies.  How can I
 do this OR please point me to an easy tutorial.

Basically, in order for your session to work, you have to let the page
that you're viewing know what the session id is.  Let's look at your
code.

 == Start of code ==
 ?PHP
 session_start();
 header(Cache-control: private); //IE 6 Fix
 if(!$_SESSION['count']){
 $_SESSION['count'] = 1;
 } else {
 $_SESSION['count']++;
 }
 ?
 You have visited ? echo $_SESSION['count']; ? pages so far!
 === End of code ===

Looking at this code, there's no link to another page, so there's no
way of letting the web server (and PHP in this case) know what the
session id is.  If your php.ini hasn't been changed, you could see the
session in action by adding a link that points to the same page.  Say
for example, the name of this file is 'session.php'.  Add the
following line to your page:

a href=session.phpSee the session in action!/a

PHP will rewrite this to:

a href=session.php?SID=12345678123456781234567812345678See the
session in action!/a

Clicking on the link will then show $_SESSION['count'] incrementing. 
You should have seen something similar even if you have cookies the
first time you start your browser (assuming your only using session
cookies) since PHP hasn't received any session information from the
browser.

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



Re: [PHP] [discuss] Rename this list was:Re: [PHP] mod rewrite urls

2004-08-12 Thread Jake Stonebender
On Thu, 12 Aug 2004 09:12:41 -0500, Jay Blanchard
[EMAIL PROTECTED] wrote:
| And then we can answer questions on dating, sex, marriage, religion, and
| politics! Wooohoo!

We may just as well call it IRC then.

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



Re: [PHP] strlen question

2004-07-23 Thread Jake Stonebender
?php if(strlen($_POST['item01'] . $_POST['item02'] .
strlen($_POST['item03'])) { ?

I'm shooting for succinctness here.  I'd like to see if someone has a
shorter solution.

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



Re: [PHP] strlen question

2004-07-23 Thread Jake Stonebender
On Fri, 23 Jul 2004 09:34:24 -0500, Jake Stonebender
[EMAIL PROTECTED] wrote:
?php if(strlen($_POST['item01'] . $_POST['item02'] .$_POST['item03'])) { ?

That's what I actually meant.  Sorry.

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