Jump to content

I have a problem with session


nerya

Recommended Posts

I put what cod

<?php

session_start();

$_SESSION['s']='FF';

echo"<input type='text'  name='subject' value='<?php echo $_SESSION['s'];?>' size='40'>";

?>

 

and I got a error

 

syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in 

 

why??

Link to comment
Share on other sites

<?php
session_start();
$_SESSION['s']='FF';
echo "<input type='text'  name='subject' value='". $_SESSION['s']."' size='40'>";
?> 

 

OHH thank

 

but I have another one problem

is there a security problem to save a password in session?

is there a situation that someone can stole or see the  session??

thank.

Link to comment
Share on other sites

I dont think so that some one else can see the sesssion contents unless your code compromises it some where...

 

although i would never store a password in session...generally account checking is done using password only once at the start, then you set the session is password is correct.

 

on other pages you can check if session is set, no need to check password thre again..

 

hth

Link to comment
Share on other sites

I dont think so that some one else can see the sesssion contents unless your code compromises it some where...

 

although i would never store a password in session...generally account checking is done using password only once at the start, then you set the session is password is correct.

 

on other pages you can check if session is set, no need to check password thre again..

 

hth

ok thank

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.