php-general Digest 21 Jan 2006 11:16:48 -0000 Issue 3918
Topics (messages 228988 through 229007):
question about using $this as a method in a function argument
228988 by: jonathan
Str to Int
228989 by: Ron Eggler (Paykiosks)
228990 by: Ray Hauge
228991 by: Gerry Danen
228992 by: Ron Eggler (Paykiosks)
228993 by: comex
228994 by: adriano ghezzi
228995 by: Ron Eggler (Paykiosks)
228996 by: tg-php.gryffyndevelopment.com
difference between require and include
228997 by: balachandar muruganantham
229001 by: Adi
229002 by: Weber Sites LTD
PHP 4.4.2 Update Issues?
228998 by: example.email.address.gmail.com
Re: date("H", $datevalue) always adds an hour?
228999 by: Michael Hulse
Re: Determining number of days in a selected month
229000 by: Jeffrey Pearson
229005 by: Geoff
Re: Email Form
229003 by: Weber Sites LTD
Re: Managing sessions...
229004 by: Weber Sites LTD
ÄãºÃ£¬Çë²éÊÕ~£¡
229006 by: °ÝÄê
what is the session equivalent to setcookie?
229007 by: Ross
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I have a question about using $this as an argument in a method.
I have a simple class called privatemsg and have another data class
which it cals for doing the actual insert. Basically, I want the
privatemsg class to pass itself as a parameter. I thought using self
would do it but nothing seemed to happen. I passed $this as the arg
(and am using type-hinting on the privatemsg_data class) and it
works. To be totally honest, I have never used $this way and it looks
a little strange / inelegant. Should I be doing this another way?
Ultimately, I'd like to use a Domain / Mapper model but even then
when I look at examples, I see that this takes place.
thanks,
jonathan
class PrivateMsg{
private $msg_recipient_id;
private $headline;
private $body;
//removed get's / set's for brevity
public function insertPrivateMsg()
{
$privatemsg_data=new Privatemsg_Data();
$privatemsg_data->insertMsg($this);
}
--- End Message ---
--- Begin Message ---
Hi,
I need to do a type cast from string to int in folllowing code:
[php]
<getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
[/php]
I need $cardID have converted to int. I thought it should work that way
but it does not!
But it's working if I'm putting
[php]
<getPIN cardID="180" quantity="1" />
[/php]
in there. I got card ID as a var that is passed as get like:
[php]
$cardID = $HTTP_GET_VARS[cardID];
[/php]
Can anyone help me in that issue? Thank you!
__________________________________________
Ron Eggler
Intern
866-999-4179
www.paykiosks.net
--- End Message ---
--- Begin Message ---
You should be able to typecast the variable like so:
$cardID = (int)$cardID;
You can also check which type it is showing up as with the function gettype():
http://www.php.net/manual/en/function.gettype.php
Optionally you could use settype() to change the type of the variable:
http://www.php.net/manual/en/function.settype.php
HTH
--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099
On Friday 20 January 2006 03:53 pm, Ron Eggler (Paykiosks) wrote:
> Hi,
>
> I need to do a type cast from string to int in folllowing code:
> [php]
> <getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
> [/php]
> I need $cardID have converted to int. I thought it should work that way
> but it does not!
> But it's working if I'm putting
> [php]
> <getPIN cardID="180" quantity="1" />
> [/php]
> in there. I got card ID as a var that is passed as get like:
> [php]
> $cardID = $HTTP_GET_VARS[cardID];
> [/php]
>
> Can anyone help me in that issue? Thank you!
>
> __________________________________________
>
> Ron Eggler
> Intern
> 866-999-4179
> www.paykiosks.net
--- End Message ---
--- Begin Message ---
You probably want to do an is_int() first...
After that, you know it's an int and treat it that way. Why do you need to
typecast it?
BTW, change $cardID = $HTTP_GET_VARS[cardID]; to $cardID = $_GET['cardID'];
for PHP5 compatibility... ;-)
Gerry
On 1/20/06, Ron Eggler (Paykiosks) <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I need to do a type cast from string to int in folllowing code:
> [php]
> <getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
> [/php]
> I need $cardID have converted to int. I thought it should work that way
> but it does not!
> But it's working if I'm putting
> [php]
> <getPIN cardID="180" quantity="1" />
> [/php]
> in there. I got card ID as a var that is passed as get like:
> [php]
> $cardID = $HTTP_GET_VARS[cardID];
> [/php]
>
> Can anyone help me in that issue? Thank you!
>
> __________________________________________
>
> Ron Eggler
> Intern
> 866-999-4179
> www.paykiosks.net
>
>
>
>
--
Gerry
http://portal.danen.org/
--- End Message ---
--- Begin Message ---
Am Freitag, den 20.01.2006, 16:08 -0700 schrieb Gerry Danen:
> You probably want to do an is_int() first...
>
> After that, you know it's an int and treat it that way. Why do you
> need to typecast it?
>
> BTW, change $cardID = $HTTP_GET_VARS[cardID]; to $cardID =
> $_GET['cardID']; for PHP5 compatibility... ;-)
>
> Gerry
Hey, it seems to be recognied by is_int() as integer. I have following
code:
[php]
if ($HTTP_GET_VARS) // if some GET variables were passed on,...
{
switch ($HTTP_GET_VARS['action'])// recognize the get-var 'action'
{
case reserve: // it says, 'reserve PINs'
$cardID = $HTTP_GET_VARS['cardID']; // get cardID which was passed by GET
as well
if ($cardID=''||is_int($cardID)) // unless,
{
$cardID = intval($cardID.trim());
echo "<b>ERROR, cardID='' or cardID is no integer!</b><br>\n"; //print
Error
exit(0); //and leave
}
echo "reserve<br>\n"; // Variables were okay, so go ahead with the
reserving
/**************** [reserve SKU] ****************/
$inputdata = '<xs:request xmlns:xs=\'urn:pinXpressSchema\'
version=\'1.5\' langCode=\'en\'>'.$n.'
<DEALERinfo aspName="'.$aspName.'"
dealerName="'.$dealerName.'"
posName="'.$posName.'"
posPassword="'.$posPassword.'"
userName="'.$userName.'"
userPassword="'.$userPassword.'"/>
<reservePINs>
<getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
</reservePINs>
</xs:request>';
/**************** [/reserve SKU] ***************/
break;
[/php]
it doesn't work that way but if I replace ['.intval(trim($cardID)).']
with [180] (everything between the []-brakets) it seems to work and
cardID was passed with the URL:
http://localhost/ewi.php?action=reserve&cardID=180
So what the hell is going wrong?
Thank you!
chEErs roN
>
> On 1/20/06, Ron Eggler (Paykiosks) <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I need to do a type cast from string to int in folllowing
> code:
> [php]
> <getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
> [/php]
> I need $cardID have converted to int. I thought it should work
> that way
> but it does not!
> But it's working if I'm putting
> [php]
> <getPIN cardID="180" quantity="1" />
> [/php]
> in there. I got card ID as a var that is passed as get like:
> [php]
> $cardID = $HTTP_GET_VARS[cardID];
> [/php]
>
> Can anyone help me in that issue? Thank you!
>
> __________________________________________
>
> Ron Eggler
> Intern
> 866-999-4179
> www.paykiosks.net
>
>
>
>
>
>
> --
> Gerry
> http://portal.danen.org/
--- End Message ---
--- Begin Message ---
> if ($cardID=''||is_int($cardID))
Two problems with that statement:
First of all, this statement _sets_ cardID to '', and then (I think)
returns a false value since '' doesn't evaluate to true. You probably
wanted ==.
Second of all, now that $cardID is '', it certainly isn't an int. It
isn't an int, and it wouldn't be an int if you fixed that statement
because is_int only tests if it is, actually, an integer.
$HTTP_GET_VARS['cardID'] could be '123', but it can't be 123 and so
that will be false. From the PHP manual:
Note: To test if a variable is a number or a numeric string (such
as form input, which is always a string), you must use is_numeric().
--- End Message ---
--- Begin Message ---
well I don't well understand the problem hope these two snippets can solve
your problem: i tested them seems fine
file 1 form.php
<html>
<head>
<meta http-equiv="Content-Language" content="it">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>enter tour code</title>
</head>
<body>
<p> </p>
<p>enter tour code</p>
<form method="POST" action="get_card.php">
<table border="1" width="47%" id="table1">
<tr>
<td width="186">user</td>
<td><input type="text" name="txt_user" size="20"></td>
</tr>
<tr>
<td width="186">code</td>
<td><input type="text" name="txt_id" size="20"></td>
</tr>
<tr>
<td colspan="2">
<p align="center"><input type="submit" value="Invia" name="B1">
<input type="reset" value="Reimposta" name="B2"></td>
</tr>
</table>
<p dir="ltr"> </p>
</form>
<p> </p>
</body>
</html>
file 2
------
get_card.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nuova pagina 1</title>
</head>
<body>
<?php
print "string value:::".$_POST['txt_id']."<br>";
$int_id=intval(trim($_POST['txt_id']));
print "integer value:::$int_id"."<br>";
print "type returned:".gettype($int_id)."<br>";
?>
</body>
</html>
2006/1/20, Ron Eggler (Paykiosks) <[EMAIL PROTECTED]>:
>
> Hi,
>
> I need to do a type cast from string to int in folllowing code:
> [php]
> <getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
> [/php]
> I need $cardID have converted to int. I thought it should work that way
> but it does not!
> But it's working if I'm putting
> [php]
> <getPIN cardID="180" quantity="1" />
> [/php]
> in there. I got card ID as a var that is passed as get like:
> [php]
> $cardID = $HTTP_GET_VARS[cardID];
> [/php]
>
> Can anyone help me in that issue? Thank you!
>
> __________________________________________
>
> Ron Eggler
> Intern
> 866-999-4179
> www.paykiosks.net
>
>
>
>
--- End Message ---
--- Begin Message ---
Am Freitag, den 20.01.2006, 18:28 -0500 schrieb comex:
> > if ($cardID=''||is_int($cardID))
>
> Two problems with that statement:
> First of all, this statement _sets_ cardID to '', and then (I think)
> returns a false value since '' doesn't evaluate to true. You probably
> wanted ==.
hOOOOOOOOOOOOOOps that's right, shit, haven't seen that......hm okay, it
works fine now, thanks again!
> Second of all, now that $cardID is '', it certainly isn't an int. It
> isn't an int, and it wouldn't be an int if you fixed that statement
> because is_int only tests if it is, actually, an integer.
> $HTTP_GET_VARS['cardID'] could be '123', but it can't be 123 and so
> that will be false. From the PHP manual:
>
> Note: To test if a variable is a number or a numeric string (such
> as form input, which is always a string), you must use is_numeric().
>
--- End Message ---
--- Begin Message ---
Ok, some good points where made already, but let's pull it all together:
1. You should get in the habit of using $_GET[] instead of $HTTP_GET_VARS..
minor thing but worth noting (info at http://us2.php.net/reserved.variables)
2. case reserve:
This, I believe, will treate "reserve" as a constant. Change it to:
case "reserve":
to make it work properly.
3. if ($cardID = '' || is_int($cardID))
As someone mentioned, $cardID = '' makes an assignment, doesn't test for
true/false. Change to $cardID == ''. And this statement SHOULD come up "true"
as a whole because $cardID = '' should always be true (unless the assignment
fails). So regardless of is_int($cardID) succeeding or failing, $cardID = ''
should be true so this statement will always be true.
4. $cardID = intval($cardID.trim())
Mixing PHP and Javascript? (or another language?). Try:
$cardID = intval($cardID);
trim() probably isn't necessary unless your variable starts with letters.
intval("123 main street") should give you "123".
intval("main street suite 400") should give you "0" (zero)
5. intval() returns zero if it's a bad entry, so is_int(intval($anything))
should always be true I believe. Just something to keep in mind in case
$cardID zero is actually something you want to use. In that case you don't
want to use $cardID = intval($whatever) because you'll end up with zero.
6. exit(0)
Again remnants from another language. exit() works in PHP but no need to
return a zero return value. exit() is fine.
7. echo "reserve" is going to output "reserve", not the value of a variable
try echo "$reserve";
Also.. it's probably not necessary, but I usually enclose my switch statements
in braces just to keep it clear what's part of the switch.
switch ($somevar) {
case "val1":
echo "Value one";
break;
case "val2":
echo "Value two";
break;
default:
echo "No valid value";
break;
}
Good luck Ron! You'll get ahold of this stuff soon enough. Looks like you
have some experience in other languages (and some of it will work fine in PHP..
it's very forgiving and flexible, but some of it will need to be tweaked).
Let us know if you have further questions.
-TG
= = = Original message = = =
[php]
if ($HTTP_GET_VARS) // if some GET variables were passed on,...
switch ($HTTP_GET_VARS['action'])// recognize the get-var 'action'
case reserve: // it says, 'reserve PINs'
$cardID = $HTTP_GET_VARS['cardID']; // get cardID which was passed by GET
as well
if ($cardID=''||is_int($cardID)) // unless,
$cardID = intval($cardID.trim());
echo "<b>ERROR, cardID='' or cardID is no integer!</b><br>\n"; //print
Error
exit(0); //and leave
echo "reserve<br>\n"; // Variables were okay, so go ahead with the
reserving
/**************** [reserve SKU] ****************/
$inputdata = '<xs:request xmlns:xs=\'urn:pinXpressSchema\'
version=\'1.5\' langCode=\'en\'>'.$n.'
<DEALERinfo aspName="'.$aspName.'"
~ dealerName="'.$dealerName.'"
posName="'.$posName.'"
posPassword="'.$posPassword.'"
userName="'.$userName.'"
userPassword="'.$userPassword.'"/>
<reservePINs>
<getPIN cardID="'.intval(trim($cardID)).'" quantity="1" />
</reservePINs>
</xs:request>';
/**************** [/reserve SKU] ***************/
break;
[/php]
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--- End Message ---
--- Begin Message ---
Can anyone tell me the exact differeneces between require and include?
--
<name> balachandar muruganantham</name>
<Yahoo!> mbchandar</Yahoo!>
<Hotmail> mbchandar</Hotmail>
<blog> http://chandar.blogspot.com</blog>
<web>http://www.balachandar.net</web>
<talk> http://www.expertstalk.org</talk>
<shop>http://www.chennaishopping.com</shop>
--- End Message ---
--- Begin Message ---
http://ca.php.net/manual/en/function.include.php
On 1/20/06, balachandar muruganantham <[EMAIL PROTECTED]> wrote:
>
> Can anyone tell me the exact differeneces between require and include?
>
> --
> <name> balachandar muruganantham</name>
> <Yahoo!> mbchandar</Yahoo!>
> <Hotmail> mbchandar</Hotmail>
> <blog> http://chandar.blogspot.com</blog>
> <web>http://www.balachandar.net</web>
> <talk> http://www.expertstalk.org</talk>
> <shop>http://www.chennaishopping.com</shop>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Take care...
Adam
--- End Message ---
--- Begin Message ---
Check out some info here :
http://www.weberdev.com/ViewArticle/440
Sincerely
berber
Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
PHP code examples : http://www.weberdev.com
PHP Web Logs : http://www.weberblog.com/
PHP & MySQL Forums : http://www.weberforums.com/
Learn PHP Playing Trivia http://www.webertrivia.com
Web Development Index http://www.weberindex.com
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com
-----Original Message-----
From: balachandar muruganantham [mailto:[EMAIL PROTECTED]
Sent: Saturday, January 21, 2006 3:44 AM
To: php; [email protected]
Subject: [PHP] difference between require and include
Can anyone tell me the exact differeneces between require and include?
--
<name> balachandar muruganantham</name>
<Yahoo!> mbchandar</Yahoo!>
<Hotmail> mbchandar</Hotmail>
<blog> http://chandar.blogspot.com</blog>
<web>http://www.balachandar.net</web>
<talk> http://www.expertstalk.org</talk>
<shop>http://www.chennaishopping.com</shop>
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello
I've started work for a client who has their own server running PHP
4.1.1. If I upgrade them to PHP 4.4.2, will there be any issues I'd
need to look out for?
Is there a general process (or checklist) I should follow when
upgrading PHP versions to find where potential the may be potential
code problems?
Thank you for your assistance
Tim
--- End Message ---
--- Begin Message ---
Hi,
On Jan 20, 2006, at 2:24 AM, Murray @ PlanetThoughtful wrote:
Can anyone help me figure out how to accommodate for this?
Not sure if this will help, but:
# Set time zone:
putenv('TZ=US/Pacific'); // I am on west-coast, my servers are on east,
if not for this code the timestamp used in my script will reley upon
the server time. This line of code will over-ride server time.
Maybe look-up putenv on php.net and read-up in the comments section, I
usually find good info that way.
Gl,
Cheers,
Micky
--- End Message ---
--- Begin Message ---
The java mailing list I belong to recently had this same
conversation. I didn't know php had that ability built in. Java
doesn't (score another one for php). The cleanest solution I saw on
the Java list that would be non-language specific (in other words,
the same logic can be implemented in ANY language) would be to set a
variable to the first day of the month AHEAD of the month you want.
For example, if your looking for February, 2000, set the variable to
be March 1st, 2000. Then subtract 1 day. I have actually archived
this solution in my own little knowledge base as I thought it was
quite clever.
Hope this helps other people as well.
Jeff Pearson
On Jan 20, 2006, at 8:17 AM, <[EMAIL PROTECTED]> <tg-
[EMAIL PROTECTED]> wrote:
date("t") will give you the number of days in the current month.
Or you can do:
date("t", mktime(0, 0, 0, $month, $day, $year))
to get the number of days in a specific month in a specific year
(that way you can get leap year accurate counts..)
-TG
= = = Original message = = =
Is there a way to easily tell PHP how many days there are in a
selected
month without writing the following out for each month:
if($Month == "January")
~$NumberOfDays = 31;
elseif($Month == "February")
~if($Year == "A Leap Year")
~~$NumberOfDays = 29;
~
~elseif($Year != "A Leap Year")
~~$NumberOfDays = 28;
~
elseif($Month == "March")
~$NumberOfDays = 31;
............and so on, and so on, and so on
I would greatly appreciate any help. Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
___________________________________________________________
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Apart from using date("t", $month) you can also determine the last
day of a month by getting the 0th day of the following month.
Say I wanted to know the last day in Feb 2006:
$mnth = 2;
echo date("d",mktime(13,0,0,$mnth + 1, 0, 2006));
This is sometimes useful when you are calculating, or your code
needs to walk up or down dates.
P.S. You may wonder why I specify 1pm as the time on the given day.
If I don't (if I use 0) this is the same as saying midnight, in
which case it is right at the very end of the day. This way I avoid
daylight saving and/or minor hour/min/sec differences that might
push the timestamp over into the next day. A small thing, but since
I deploy code in a number of places, it has saved me countless
headaches.
Geoff.
On 20 Jan 2006 at 13:51, Jeffrey Pearson wrote:
> The java mailing list I belong to recently had this same
> conversation. I didn't know php had that ability built in. Java
> doesn't (score another one for php). The cleanest solution I saw on
> the Java list that would be non-language specific (in other words,
> the same logic can be implemented in ANY language) would be to set a
> variable to the first day of the month AHEAD of the month you want.
> For example, if your looking for February, 2000, set the variable to
> be March 1st, 2000. Then subtract 1 day. I have actually archived
> this solution in my own little knowledge base as I thought it was
> quite clever.
>
>
> Hope this helps other people as well.
>
>
> Jeff Pearson
>
>
>
>
>
>
>
>
> On Jan 20, 2006, at 8:17 AM, <[EMAIL PROTECTED]> <tg-
> [EMAIL PROTECTED]> wrote:
>
> > date("t") will give you the number of days in the current month.
> >
> > Or you can do:
> >
> > date("t", mktime(0, 0, 0, $month, $day, $year))
> >
> >
> > to get the number of days in a specific month in a specific year
> > (that way you can get leap year accurate counts..)
> >
> > -TG
> >
> > = = = Original message = = =
> >
> > Is there a way to easily tell PHP how many days there are in a
> > selected
> > month without writing the following out for each month:
> >
> > if($Month == "January")
> > ~$NumberOfDays = 31;
> >
> > elseif($Month == "February")
> > ~if($Year == "A Leap Year")
> > ~~$NumberOfDays = 29;
> > ~
> > ~elseif($Year != "A Leap Year")
> > ~~$NumberOfDays = 28;
> > ~
> >
> > elseif($Month == "March")
> > ~$NumberOfDays = 31;
> >
> > ............and so on, and so on, and so on
> >
> > I would greatly appreciate any help. Thanks.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > ___________________________________________________________
> > Sent by ePrompter, the premier email notification software.
> > Free download at http://www.ePrompter.com.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> !DSPAM:43d1ab1b244201588548228!
>
--- End Message ---
--- Begin Message ---
Lucky for me I have my own server :)
Thanks for the info, I will try it and report if I see any difference.
Sincerely
berber
Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
PHP code examples : http://www.weberdev.com
PHP Web Logs : http://www.weberblogs.com/
PHP & MySQL Forums : http://www.weberforums.com/
Learn PHP Playing Trivia http://www.webertrivia.com
Web Development Index http://www.weberindex.com
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com
-----Original Message-----
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Friday, January 20, 2006 11:21 PM
To: Weber Sites LTD
Cc: 'Igal Rubinstein'; 'Thomas Bonham'; [email protected]
Subject: RE: [PHP] Email Form
On Fri, January 20, 2006 9:02 am, Weber Sites LTD wrote:
> I'm trying to understand why this is good from a SPAM point of view.
> I'm guessing that anyone can just add this when sending his own spam
> no?
Hey, I'm not claiming that the spam criteria are rational, nor that any
halfway intelligent spammer could not "beat them"
I'm just telling you what *IS* happening today. :-)
Note, however, that many ISPs will not allow you to use that fifth argument,
or, more accurately, will configure sendmail to choke if you try to use it
with "-f" to set the Return-path: because you are not a "trusted user"
--
Like Music?
http://l-i-e.com/artists.htm
--- End Message ---
--- Begin Message ---
Maybe this class can help make things simpler :
A beginner's session handling class
http://www.weberdev.com/get_example-4175.html
Sincerely
berber
Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
PHP code examples : http://www.weberdev.com
PHP & MySQL Forums : http://www.weberforums.com
Learn PHP & MySQL Playing Trivia : http://www.webertrivia.com
PHP Web Logs : http://www.weberblogs.com
Web Development Index http://www.weberindex.com
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com
Free Uptime Monitor : http://uptime.weberdev.com
PHP content for your site : http://content.weber-sites.com
-----Original Message-----
From: David BERCOT [mailto:[EMAIL PROTECTED]
Sent: Friday, January 20, 2006 6:54 PM
To: [email protected]
Subject: [PHP] Managing sessions...
Hi again,
Ok, it's probably not the first time you have a question about sessions with
PHP ;-) I've tried to read mails, documentation, searching on Internet but,
finally, I think everything is not clear !!!
First of all, I understand that, if session.auto_start is not on '1', I have
to write session_start on each page I use !!! OK.
Before this line, I put options :
ini_set("session.use_only_cookies",1);
ini_set("session.use_trans_sid",0);
ini_set("error_reporting",E_ALL);
and then :
session_start();
I think it is very heavy to write... I read about
ini_set("session.auto_start",1) but, on my server (Debian), it doesn't seem
working...
And I also read about options which can be not set if I use auto_start...
So, I'd like to put my options (use_trans_sid, 0, etc...) and to have lite
scripts. Is it possible ?
Isn't there, like in asp, a global.asa where I can put all my parameters ?
Thank you very much.
David.
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
过新年,免费赠送手机铃声,化妆品,Mp3,U盘......
想要结识漂亮MM、拽拽帅哥?想要表达年轻人最真实的自我?在365ren,你可以免费建立与众不同的家园,
打扮美美的空间,交同龄好友,分享生活照片,写心情日记,还可以用自己的照片来制作属于你独一无二的
个性TV,让你尽情挥洒个性,飞扬梦想。现在马上注朋,还可以免费获得5条动感铃声、5条精美彩信!
还等什么,现在就来建立自己的家园吧!查看详情
--------------------------------------------------------------------------
填问卷,拿手机,Mp3,移动U盘...... 活动规则 :活动1 活动2(月月Q奖,注册就有礼)
--------------------------------------------------------------------------
MP3,苹果mini,等你来拿...... 注册博客,赢取大奖!
--------------------------------------------------------------------------
快快免费索取成为靓女美女:DHC免费化妆品火热申请中!!!
--------------------------------------------------------------------------
超极女生:张靓颖最新手机铃声下载:快快下载
--------------------------------------------------------------------------
眼睛近视真痛苦---工作恋爱怎么办?不用愁,新年搞活动:查看详情
--------------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
I have a cookie
setcookie("cookie[$food]", "$new $name");
I want to change to a session..
Is it..
session_register("cookie[$food]", "$new $name");
--- End Message ---