473,386 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Session_register

is this valid?

session_register('variable1','variable2','variable 3','etc');

If not, how can you register a bunch all at once without having to use a
line for each variable?

Jul 17 '05 #1
2 2782
With total disregard for any kind of safety measures "Philip D
Heady" <pd*****@comcast.net> leapt forth and uttered:
is this valid?

session_register('variable1','variable2','variable 3','etc');

If not, how can you register a bunch all at once without having
to use a line for each variable?


You shouldn't be using it at all. Use $_SESSION['foo'] = 'bar';

From the PHP manual (which, if you'd read, you would never have
needed to post this question in the first place):

Caution

If you want your script to work regardless of register_globals, you
need to instead use the $_SESSION array as $_SESSION entries are
automatically registered. If your script uses session_register(),
it will not work in environments where the PHP directive
register_globals is disabled.

register_globals: important note: Since PHP 4.2.0, the default
value for the PHP directive register_globals is off. The PHP
community encourages all to not rely on this directive but instead
use other means, such as the superglobals.

--
Phil Roberts | Nobody In Particular | http://www.flatnet.net/
Jul 17 '05 #2
"Philip D Heady" <pd*****@comcast.net> wrote in message news:<Te********************@comcast.com>...
is this valid?

session_register('variable1','variable2','variable 3','etc');

If not, how can you register a bunch all at once without having to use a
line for each variable?

Yes it is perfectly valid to register more than one variable through a
single call to *session_register*.

But PHP Community recommends the other way of registering session
variables, i.e. through super globals.

Check out PHP Manual at www.php.net for more information.

http://us2.php.net/manual/en/functio...n-register.php

--
Cheers,
Rahul Anand
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Cenker Sisman | last post by:
My problem is I cannot set session variables correctly. I have tried both PHP 4.2.2 and 4.3.3, with register_global is ON. But I cannot manage to see the desired result. My configuration for PHP...
5
by: josh dismukes | last post by:
/// Were having serious problems with this script it's basically the map script allowing player movement but the problem is in the QUERY and if statements on the cell type. Any help will be much...
0
by: printline | last post by:
Hello! I am not at all good at sql, so can anyone tell me what this error i get means....... Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in...
8
by: burut | last post by:
Hi, I have index.php page (attached). The flow is when I put username/password on the page, it will submit to be processed by connection.php where in connection.php, it require koneksi_db.php to...
1
by: jx2 | last post by:
whats wrong with that: PHP code: <?php; if(!$Tour){$Tour= new tournament();session_register("Tour");} $Tour->echodouble(); class tournament { var $nr,$TF; //$TF - keep files' paths
3
by: printline | last post by:
Can anyone help me with why i am getting this error message: Notice: Undefined variable: SalesRepID in C:\Inetpub\wwwroot\index.php on line 158 Here is my php code: <?php session_start();...
1
by: Kurda Yon | last post by:
Hi All, is that OK if I declare the same variable in the same file several times? For example somewhere in the beginning of a file I have session_register("cat") and than, somewhere in the...
7
by: Deccypher | last post by:
Hi Im trying to do something a little more complex with my login script at the moment it works fine, checks the username and password with the database if its wrong it echo's a error and if its right...
6
anfetienne
by: anfetienne | last post by:
hi ive been using a login code which uses sql & db its quite simple and has been working great.....but as i have just gone to do a final test on the site i've built starting from the login page i get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.