You should be sanatizing code here. When you save it to the session and
when it's output. Look arround the newsgroups or online for info about it,
it's everywhere.
- Dan
mike [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On 8/26/07, Jason Cartledge [EMAIL PROTECTED] wrote:
I
Hi, this is my first post to this newsgroup. Does this code look ok or is there
a more clean way of doing this? I am learning. Thank you for reading.
Jason
if ( !empty($_REQUEST['gender']) )
{
$registrationGender=$_REQUEST['gender'];
}
else {
On 8/26/07, Jason Cartledge [EMAIL PROTECTED] wrote:
I would replace $_REQUEST with $_GET or $_POST (as appropriate)
if ( !empty($_REQUEST['gender']) )
{
$registrationGender=$_REQUEST['gender'];
}
else {
Personally I would use
I would go for:
if (isset($_REQUEST['gender'])) $_SESSION['registrationGender'] =
$_REQUEST['gender'];
print isset($_SESSION['registrationGender']) ? You are registered as
gender: .$_SESSION['registrationGender'] : Your gender is unknown;
And make no assumptions about a gender when you
Today I collect information from several forms and store it in a cookie:
function formCookie() {
var cookieValue = document.$formName.totalAns.value+'|';
cookieValue
+=document.form1.correct.value+'$test[1]'+document.form1.question1.value+doc
ument.form1.answer.value+'|';
cookieValue
On Sun, 9 Mar 2003 21:18:33 +0100
Øystein Håland [EMAIL PROTECTED] wrote:
The problem is the cookie soon reaches the 4 kb limit, so I would like to
achieve the same using session. The trouble is, I don't know how to do. I
would appreciate any help that brings me closer to a solution on this.
I use cookies in my web applications, but have reached the 4 kB limit. So I
need to 'convert' all my cookies to session variables. Have got an idea how
I can create such for one variable, but here I have multi element cookies.
Reading the php manual gives me no idea on how to do this.
Here's the
.
session_start();
echo $HTTP_SESSION_VARS['step']; // You can echo it out straight, don't need
to extract it
Hope it works!
- Original Message -
From: Manuel Ochoa [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Wednesday, December 04, 2002 1:12 AM
Subject: [PHP] Help with session
I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at the
following code as I cannot figure out what I'm doing wrong.
Page1.
session_start();
session_register(step);
$step=1;
header(location: page_A.php);
Page_A.
session_start();
extract($_SESSION);
$step=2;
On Wednesday 04 December 2002 14:12, Manuel Ochoa wrote:
I'm running PHP 4.3 on a Windows .net server with Apache 2. Please look at
the following code as I cannot figure out what I'm doing wrong.
Page1.
session_start();
session_register(step);
$step=1;
header(location: page_A.php);
? include ('./header.php');
$query=select prodid, title FROM fatbeats_prod;
$result= mysql_query($query);
$names= mysql_fetch_assoc($result);
$query1=select prodid, price from fatbeats_prod;
$result1=mysql_query($query1);
$prices= mysql_fetch_assoc($result1);
while (list($key,$val) =
A have two webs made in php, both uses a authentication based on session
suport.
I use in every page a session_start(); and a session_name( name); to get
different name for the sessions but when i get login i one web, and then go
to the other i get the same login.
what happend?
What means the
I have 2 functions on my page, RegisterUser, IsValidUser.
RegisterUser looks in the querystring to see if you've passed a certain key
value. If you have it populates a session variable called "ValidUser"
with a 1.
All that IsValidUser does, is check to see if the session variable
"ValidUser"
13 matches
Mail list logo