Form Variables To Session Variables
I am writing a small script that consists of two pages: page one displays a bunch of values from a DB (ie. First Name, Last Name, Phone Number). On this page you will find a form that follows this format:
<input type="text" name="edit_firstname" size="20" maxlength="35" value='Bob'>
<input type="text" name="edit_lastname" size="20" maxlength="35" value='Smith'>
<input type="text" name="edit_phone" size="20" maxlength="35" value='5552222'>
So when you see the page there will already be a 'default' value in each line (which is information extracted from a DB). This works perfectly and has been tested thoroughly.
On the second page I have the following code:
$editfirstname = $_POST['edit_firstname'];
$editlastname = $_POST['edit_lastname'];
$editphone = $_POST['edit_phone'];
What I am trying to do is this: the default value for edit_firstname from the form is 'Bob' by default, but the user can change this in the input field on the first page. This value, whether changed or unchanged, should then be stored as edit_firstname and by calling up the function $_POST[''] on the second page I want to transfer the value to the variable $editfirstname.
However, it seems that $_POST['edit_firstname'] and the other fields do not return a value at all, hence $editfirstname = '' or $editfirstname = 'NULL'. I have never tried to do things this way before.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Session Variables In A Form
i want to create a form that updates a users account details...is there a way that i can get the form to show the users current details in each text box? then the user clicks on that box to edit the deails? also how would i structure a query so that it only updates the edited fields? and keeps the rest the same? Code:
Can A Form Change Session Variables?
In the first page I declare a session variable. Than, on the same page, I make a form which contains a variable which has the same name as the mentioned session variable. Pressing the "submit" button of the form I go to the second page which immediately redirects me back to the first page (with the "header"). And the mentioned variable does...
Multi-pages Form Using Session Variables
I am trying to break a very lengthy php form into several pages but I am having some problems partly b/c For testing purposes I created 3 very simple forms: page1.php, page2.php and page3.php which shows contents from page1 and page2. Eventually I would like to send this data to the database. PHP Code:
Session Variables Resets The Contents Of A Form
i have a form in a page that has a header with a session variable the problem is that if i fill the form and submit the form to another page, now if i want to go back to the form using the back button of the browser the contents of the form will be reset!!! please tell me what to do if this is a common problem or i can get rid of this problem cause it's annoying to fill the form again. PHP Code:
Passing Variables And Session Variables
I'm currently working on a shopping cart script that works just fine with register_globals turned on but when turned off i get all kind of errors. The following page displays a detail of the book with the "Add to cart" link at the bottom. PHP Code:
Variables That Change Session Variables
I'm currently writing a mulit-page form app that uses a session to retain data from each form element in order for the user to jump between pages, then the final data is passed to a calculation script. However, I've noticed that if I assign a session variable to another variable, which then performs a mathematical calculation, the session variable changes. i.e. $_SESSION["inflation"] = 4; $temp_inf = $_SESSION["inflation"]; if ($_SESSION["inflation"] =="RPI") { $inflation = $rpi;} else {$inflation = ($temp_inf/100.0);} now it equals = 0.04 How can I take a value from a session and perform operations on it without altering the original session value.
Session Problem: Session Exists, But Session Variables Don't Lasts
I have some troubles with session variables. I can easily create a session, but the variable I append to global session array ( $_SESSION) lasts only until the end of current function. I prepared an example that can demonstrate the problem (see code bellow): The program flow is this: (1) It starts with "session_start()" and displays "login_form()". (2) When user enters his username and password, it goes to "login()" function which sets $_SESSION variables. (3) This function also "Echoes" session_id and user name to the screen. (4) Then it goes to "MyProgram()" function. It only "Echoes" the same variables to the screen. Strange is, that the session_id is the same in (3) and (4), but the user name ($_SESSION["username"]) is only in (3), but not in (4). By other words - $_SESSION["username"] variable filled up by "login()" function is immediately cleared. I don't know why. There must be something missing, but after 3 days of watching it, I can not find a problem here. =========================================== <? Function login($uzivatel, $heslo) { $_SESSION["username"] = $uzivatel; $_SESSION["pass"] = $heslo; $U_Name=$_SESSION['username']; echo "Login username: $U_Name<BR>"; echo "Login session ID: "; echo session_id(); echo "<BR>"; } Function login_form() { echo ("<DIV ALIGN='center'> <H1>Test</H1> <P>Please enter your username and password:</P> <form action='test.php' method='get'> <INPUT TYPE='HIDDEN' NAME='login' VALUE=TRUE> <TABLE BORDER=Ɔ'> <TR> <TD ALIGN='right'><U>U</U>ser name:</TD> <TD><INPUT NAME='uzivatel' SIZE=25 ACCESSKEY='U' TYPE='TEXT'></TD> </TR> <TR> <TD align='right'><U>P</U>assword:</TD> <TD><INPUT NAME='heslo' SIZE=25 ACCESSKEY='P' TYPE='PASSWORD'></TD> </TR> <TR> <TD COLSPAN=2 ALIGN='RIGHT'><INPUT NAME='OK' ACCESSKEY='O' TYPE='SUBMIT' VALUE='OK' TABINDEX=3></TD> </TR> </TABLE> </FORM></DIV></HTML>"); } Function MyProgram() { $U_Name=$_SESSION['username']; echo "Program username: $U_Name<BR>"; echo "Program session ID: "; echo session_id(); echo "<BR>"; } { session_start(); if ($_SESSION['username']): MyProgram(); else: { if (!$login): login_form(0); else: login($uzivatel, $heslo); MyProgram(); endif; } endif; } ?> ===========================================
Session Variables
Can anyone please help, I am testing this code from a book that I am learning php from and it doesn't work. The message comes up showing "you've been here 1 times" , but the counter does not increment as I refresh the page. this is the code:
Session Variables How Many?
I'm wanting to store about 6 fields one of which could have about 1600 characters in a session variables for submitting data to the database. I'm trying to elimate partial records being inserted into the database when a user quits in the middle of an entry. Is there a limit to the size of what you can put in sessions and number of session you want to limit on a server. Didn't know if you had a high volume site that if you stored new records in sessions, how that would affect performance. I thought about using cookies but not everyone has them enabled, I guess I could check first.
Session Variables
I'm calling the below function to log a user in and register to session variables, however the variables are never registered: function login_user($username, $password) { GLOBAL $DB; GLOBAL $HOST; GLOBAL $WEBUSER; GLOBAL $WEBPASSWORD; Code:
Set And Get Session Variables
Iam a bit new to php but Iam familiar with other scripting languages like ASP.My Problem is Maintaing teh session variables. When the user logged in I want to maintain the username in a session until that user is logged out. I walked through the forums and tried $_SESSION, $HTTP_COOKIE_VARS but i did not succed. Whereas in ASP I used session("username") to maintain the username throughout the session. Please suggest me how to handle the session variables in php.
My 1st Use Of Session Variables
I've written some code to overlay a transparent png over a jpeg, 4 4 links then allow the png to be moved, the x and y coordinates being stored in $_SESSION. It seems to work fine on my own local server but only intermitently when live. The full source with images is stored in index.php: <?php session_name("pwh_test_session"); session_start(); ?> <html><head><title>Test page</title> <meta name="author" content="Paul Herber"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> <style type="text/css"> .mtitle {font-size:24pt; font-family:arial,helvetica,sans-serif} .mtext {font-size:10pt; font-family:arial,helvetica,sans-serif} </style> </head> <body bgcolor="#FFFFEC"> <div class=mtext align="center"> <?php $_SESSION['x'] = 0; $_SESSION['y'] = 0; ?> <table border="0" align="center"> <tr><td>Starting session named <?php echo session_name(); ?></td></tr> <tr><td colspan="4" align="center"><a href="show.php">Start</a></td> </tr> </table> </div> </body> </html> show.php: <?php session_start(); ?> <html><head><title>Test page</title> <meta name="author" content="Paul Herber"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15"> <style type="text/css"> .mtitle {font-size:24pt; font-family:arial,helvetica,sans-serif} .mtext {font-size:10pt; font-family:arial,helvetica,sans-serif} </style> </head> <body bgcolor="#FFFFEC"> <div class=mtext align="center"> <?php $d = $HTTP_GET_VARS['d']; ?> <table border="0" align="center"> <tr> <td colspan="4" align="center"><img class=mborder2 width="500" height="375" border="0" title="" alt="" <?php echo "src="showimage.php?d=$d">";?></td></tr> </tr> <tr> <td width="25%" align="center"><a href="show.php?d=u">Up</a></td> <td width="25%" align="center"><a href="show.php?d=d">Down</a></td> <td width="25%" align="center"><a href="show.php?d=l">Left</a></td> <td width="25%" align="center"><a href="show.php?d=r">Right</a></td> </tr> <tr><td colspan="4" align="center"> <?php echo 'x = ' . $_SESSION["x"] . ' y = ' . $_SESSION["y"]; ?> </td></tr> <tr><td colspan="4" align="center"> <?php if (($_SESSION["x"]==346) and ($_SESSION["y"]==180) ): echo 'You have been hit for 6!' endif; if (($_SESSION["x"]==306) and ($_SESSION["y"]==240) ): echo 'Batsman is out LBW' endif; if (($_SESSION["x"]==186) and ($_SESSION["y"]==220) ): echo 'Bowled - middle stump!' endif; ?> </td></tr> </table> </div> </body> </html> shopimage.php: <?php session_start(); $d = $HTTP_GET_VARS['d']; $im1 = imagecreatefromJPEG('P6200007.jpg'); $im2 = imagecreatefromPNG('redball.png'); if ($d == 'u'): { $_SESSION["y"] = $_SESSION["y"] - 20; } elseif ($d == 'd'): { $_SESSION["y"] = $_SESSION["y"] + 20; } elseif ($d == 'l'): { $_SESSION["x"] = $_SESSION["x"] - 20; } elseif ($d == 'r'): { $_SESSION["x"] = $_SESSION["x"] + 20; } else: { $_SESSION["x"] = imagesx($im1) - imagesx($im2)/2; $_SESSION["y"] = imagesy($im1)/2 - imagesy($im2)/2; } endif; // check limits if ($_SESSION['y'] < 0): $_SESSION['y'] = 0; endif; if ($_SESSION['y'] > imagesy($im1)-imagesy($im2)): $_SESSION['y'] = imagesy($im1)-imagesy($im2); endif; if ($_SESSION['x'] < 0): $_SESSION['x'] = 0; endif; if ($_SESSION['x'] > imagesx($im1)-imagesx($im2)): $_SESSION['x'] = imagesx($im1)-imagesx($im2); endif; imagecopy($im1, $im2, $_SESSION["x"], $_SESSION["y"], 0, 0, imagesx($im2), imagesy($im2)); $mime="image/jpeg"; header("Content-Type: $mime"); header("Content-Disposition: filename=overlayedimage.jpg"); imageJPEG($im1); imageDestroy($im1); imageDestroy($im2); ?>
Session-Variables
If i store a session-varibale with the command : >> session_register("var"); >> $var = "test"; how can i get the value of this variable?? I tried >> session_encode("var"); >> echo $var; but i doesn't work!!
Session Variables In IE
Why on earth would the security settings affect session variables? We're not setting a cookie here. I'm just trying to carry one session variable over from one page to the next. If the security settings in IE are set to "high", it doesn't work. What gives?
Session Variables
im having problem with session. its not with the variables i set using session_register but the variables that are not supposed to be cookied or cached. i have variables that i set using: index.php?variable=myvalue and on the next page i change that variable's value again .. but even if change it to : nexpage.php?variable=mynewvalue the variable is still using the first value i assigned to it : myvalue instead of mynewvalue. i only need to use session to cache my logged in user and not all the variables i use. how do i make this happen ? or am i doin' it wrong.
Session Variables
This time it's not so much broken as I just have a question on variable registration in sessions. I'm using a admin script to manage users on a website. All users first of all have the ability to edit their own info, and administrators have the ability to edit other user's info. Now, in my session I have several variables registered, including the user's password, username, full name, etc. Now, when I have them bring up the screen to edit their info, I have several fields in a form, that I fill with values from the session variables. When they edit the info and send it, it updates the MySQL DB and comes back to the same page with the fields filled in with the new info. I had some problems doing this however, it didn't want toupdate the database with the new info, it seems that the POST operation didn't update the variables, and the info from the session variables got reentered into the db. So I changed the fields on the edit page to read something like 'newusername' 'newpassword' etc, then had the script session_destroy() and reassigned the session variables to the new ones entered, THEN entered the info in the database. This seems to work. However, when I'm attempting to edit other user's info, the same approach doesn't seem to work. I'm using yet again, another set of varibles called 'editusername' 'editpassword' etc, to avoid any conflict with my session variables. The reason why I do this is because: When I originally tried the script, and had the edit user fields marked as 'username' 'password' etc (the same as the session registered variables) and then tried to reassign it $username = $username; (I know, it looks silly) It didn't work, it seems like POST operations don't assign variables quite the same way as an explicat declaration. Anyway, should I be paranoid about using the same variable names in my forms as in the session variables? Will they screw up? Will they reassign?
Php Session Variables
I've been trying to integrate php with MySQL database into my site and have come up with a problem. My webhost has php set up so that I cannot use session variable the way I understand them. Here's what he wrote: You tried to use the session handling routines included in PHP, which are unavailable. It would be possible, however, to write your own functions that set a cookie to define a session ID, this session ID would then refer to data loaded in a data file on the server. You would likely want to write routines that mirror the native routines in PHP that are not available. Now I've been trying to work with functions on this one, but am still coming up with the same error message. Anyone out there know a basic way to write this or help me out?
Session Variables
I cannot seem to change a session variable. I want my site to have the ability to be viewed from a different perspective depending on the client or in this case $user. With track_vars and register_globals on i have the following code:
Session Variables?
can session variable hold objects that can later be reference by other pages? if so, i get an "incomplete object" error when i try to call methods from the object I have stored in the session.
PHP Session Variables
I'm not a overly experienced PHP programmer but I like to dabble and I'm working on a 'semi-secure' member's area. Previous I have used normal variables to determine the validity of a user. i.e. Once the user has logged in, a random id is created an placed in the database in their row and each secured page will have a URL like this : .../secure.php?user=joebloggs&randid=324395 Each page looks up the username and checks it against the random id (instead of their password for obvious reasons). However, I want to remove this altogether so a page will just be like 'secure.php' so I've looked into session variables - another interesting endeavour which was quite effective until the user logs in. The URL then changes to ...secure.php?PHPSESSID=94fhq439fqqh9f-qh9-q2h or something similar. Obviously, this doesn't happen when clicking a link but the use of a login form causes this added variable to the URL.
Session Variables
Ive got a problem with our server. I checked it and i cant login to our webmail(horde) and all other sites that requires logging in. So far i think it has something to do with session variables not being written or not being able to pass the session variables to a second page. Error messages: Undefined index: uid Undefined index: sid Here's our server specs: Linux Dedicated server Fedora Core 3 Plesk 7.5.4 PHP 4.3.11 Im not that well versed with handling servers to i dont know were to start.
Session Variables
I have got an area of my website that is password protected. tGateway.php gets the user to input the password then checks, then if it is correct, sets a session variable - $_SESSION['trainee'] = 1; and then redirects to another page. (tGPS.php) This works fine, the problem occurs when i then go from this page to any other page in the protected area. It kicks me out and takes me back to the password screen - as it is meant to do, if $_SESSION['trainee'] != '1'; So some how, the trainee variable it being reset to 0, I've done print variable on the tCP.php page without the if statement and it's claiming that the variable is 0. I can't see how it's reset it's self, and more the to the point how to stop it! There is not any other php code in the pages. See below for the php code of each page. Code:
Session Variables On Ssl
I just started using a secure socket layer for one of my websites. Whenever I sign in and register some session variables the variables don't get registered. Does anyone know why?
Session Variables
This may be a silly question but I was wondering if I have a login page with a single page to process its username and password that uses a switch to check for the user and then direct them to their home page. However with processing all the users on the same page does this mean that if another user logs in at the same time the first users session variables will be over written? For example if I login as admin and then login as a normal user without loggin the admin out, then try to access the admin page it claims the admin has logged out, so does this cause a problem for multiple users.
Session Variables
I was just wondering, is it possible for a third party to manipulate your Session variables while ure in a session? I know that you SID can be hijacked thru header modification if someone knows ur session ID, therefore that is counteracted by regenerating session id's, but i am wondering if the actual session variables can be manipulated or not.
Session Variables
this is going to sound really dumb but how to you set a session variable, i know you can use $_SESSION['variable'];, and i have read about session_register and session_unregister my problem is that at present i am using $_SESSION['variable']; but i dont know how to clear/destroy this because when a Customer enters the website they can login or enter as a guest and if they enter as a guest they can login later, the only problem is when i go to the login later the $_SESSION['variable']; is registered as Guest still so i need to clear this and then reassign them with their customer number.
Session Variables
I have a login script working. All is fine. This works by querying a database and if the result = 1 then set a session. What i want to do is get all the information relating to the user currently logged in. When i echo the session i get the value 1. How do i query the database to get all info on the user logged in?
How Session-variables Work
let me explain the content: by opening questions.php the user sees the first page of a questionnaire. every question can be answered with one set of radiobuttons. if all questions are answered he goes to the next page by clicking on "next". questions.php is loaded again. a session variable is set to hold the active page. i need it to navigate through the different pages (four or five pages). on clicking "next" you see the next 10 items of list[].
Session Registered Variables...
How do I validate session registered variables with http_post_vars (php-4.0.6)??? Page 1 Session_start(); Session_register(“check1”); Session_register(“check2”); Session_register(“check3”); Session_register(“check4”); $check1 = “abc”; $check2 = “def”; $check3 = “ghi”; $check4 = “jkl”; via form (method = “Post”) I submit $check5 = “abc”; Page 2 Session_start(); foreach($HTTP_SESSION_VARS as $key => $value_) { If($HTTP_POST_VARS[“check5”] == $HTTP_SESSION_VARS[“key”]) { echo "<br>Equal"; } else { echo "<br>Not Equal"; } }
Updating Session Variables
On a form where users update their password, I have a small glitch. The form is submitted and the new password is successfully updated in the users table. The problem is that the session variable ("password") still contains the old password. So the next page the user visits that has session-based authentication check sees that the old password does not match what is currently stored in the users table (which was just updated). Thus, the user is taken to a login screen and forced to sign in again. After signing in the session variable ("password") is updated with the new password and all is well. How can I update the session variable("password") so that the user does not have to log in again after changing their password?
Modifying Session Variables ?
I have a form with a text input field (search) and I am trying to modify the '$search' variable with the form, after I registered it. the manual states that I should unregister the session (session_unregister(search) , but when I echo $search and $HTTP_SESSION_VARS[search], the session variable seems to always be "late" (meaning, it is set as the variable that was supposedly unregistered...) PHP Code:
How To Display ALL Session Variables?
Is there a simple way to display all session variables? Like the code below I use in debug for all posted variables: echo "<h3>posted variables</h3>"; while (list($name, $value) = each($HTTP_POST_VARS)) { echo "$name = $value<br>"; }
Reading Php Session Variables With .NET
I figured this could drop into either of the 2 obvious categories, so I opted here on the assumption that php scripters might more know .NET than .NET'ers know php... Simple enough, I'm adding phpBB to a site and want to integrate a single logon. The site is ASP.NET and my knowledge is well enough that I have several solutions, the simplest of which just reuses whatever session variables phpBB creates. If a .php page sets a session variable, can I read it in an .aspx page?
Session Variables From Mysql, Get Them All At Once?
I'm making a new site and am wondering about the best way to query a mysql server.. basically most of the site's pages will display some type of dynamic content based on the user, and im not sure which approach is better.. should i grab all the info i need at login to put into session variables? or should i have queries when/if i need to display the info... im leaning towards getting it all once so the sites main functionality is smoother.. anyone know if im about to make a mistake?
Output W/ Session Variables.
i've come across something very strange w/ session variables. say my application is called "HelloWorld" and I have been creating/storing all variables in the form of: $_SESSION["HelloWorld"]["x"] = "name"; where "x" is some variable. But when I tried: $_SESSION["HelloWorld"]["x"]["sub_x"] = "john"; when i print $_SESSION["HelloWorld"]["x"], i get "jame". "x" isn't defined as an array, so I understand why it's getting confused. But how did it get "jame"? is "sub_x" defined to be 0, so that it's taking "j" and is replacing it w/ "n"?
Cookies And Session Variables
To find out were session variables are stored I included this instruction in my program: echo ini_get("session.save_path"); The reply was /home/7604/data/tmp which is a folder on my server. I look at /home/7604/data/tmp and it is full of session files for today....
Session Variables Dump
The following script I posted is used to display a set of pictures returned by a query from a database. The script calls itself repeatedly to navigate forward and backward through the returned results. The problem I'm having is that while I'm navigating through the results, I randomly lose all the data contained in my session variables. As a test, I echoed the SID at the top of every page to make sure my connection to the session cookie was staying open, and the SID echoes on everypage, even if the variable values completely dissapear. I don't get any error messages when this happens, I just click on next or back and when the next page loads, all the variables are gone. It happens completely sporadically. the gc_probablility is set to 1, and gc_maxlifetime is 1440, so I don't think it's a garbage collection problem. Code:
Losing Session Variables In IE6
I notice that others have had this problem, after scanning Google, but I couldn't find any solution. I have tested my PHP code on both Mac's & PC's and on several browsers (Firefox, Safari, IE etc etc), with several operating systems. Everything works fine, except ... On a couple of Windows XP SP2 PC's session variables in IE6 seem from time to time to get 'lost'. More specifically: I start my session on every page. I get the user to log on, which sets the appropriate session variables. When I access a couple of *particular* pages (not all pages) - the first time I access them after logging on, the session is lost. If I then log back in for a second time (without closing down the browser) the session variables are re-set and then if I access those *particular* pages again - the session is fine!!!! Now, as mentioned this works fine on 99.99% of browsers, platforms, whatever - but on the occasional IE6 XP SP2 set-up this occurs. I've played with the IE6 security settings (although I can't believe this would make any difference to server side stuff - I was clutching at straws!) If anybody has any ideas, experiences etc etc - then please let me know, as this does seem a slightly bizarre problem, to say the least!
Problem With Session Variables
I'm new to php an currently trying to insall my first php-Session. I've written the following code which uses the 2 variables cat and langua, but somehow they are not correctly registered in the session. When pressing the links to set the 2 session variables, they don't move at all. There values are always 1 and 9. Does anybody have an idea how I can set the value of a session variable using a <a href ...>? <?php session_start(); session_register("cat"); session_register("langua"); ?> <HTML> <HEAD> </HEAD> <BODY> <?php echo "langua = $langua<br>"; echo "cat = $cat<br>"; // Read variable langua if (!isset ($_SESSION["langua"])) { echo "langua not registerd in session<br>"; $langua = 1; } else { echo "langua registerd in session<br>"; $langua = ($_SESSION['langua']);........
Session Variables Missing
I've been trying to add a login to a script for a client and the server is not playing ball. In the spirit of best advice received here I simplified it down to the basics. p1.php <?php session_start(); $_SESSION['test']="test"; print "<a href='p2.php'>p2</a>"; ?> p2.php <?php session_start(); print_r($_SESSION); ?> p2.php shows just an empty array. I've tried using session_write_close() and also passing the session id via the URL. Nothing. Anyone got any ideas? PHP is 4.3.9, server is running Linux and Apache
Creating Session Variables In 4.2.1
I am on a shared host environment, and the ISP has both track_vars and register_globals enabled. I was changing over my login script from using session_register() to simply $_SESSION, but I'm having problems assigning values to the $_SESSION array. I know that the session is started correctly (I can check my cookies in Mozilla to see the $PHPSESSID value set) but when I try to assign variables it doesn't work unless I use PHP Code:
Registering Session Variables
Is there a way to register all of the form variables submitted on my page other than doing session_register('var1', 'var2', ....); or using the $HTTP_POST_VARS or $HTTP_GET_VARS arrays. I'm trying to let the variables keep the same name, since most of the script is already written, and changing all of them into array form would be quite a hindrance.
Cookies And Session Variables
I need to save values typed into forms across several scripts, before the user actually 'submits' the form to update the mysql db. I have been exploring ways to do this, and looking for some guidance as to whether to use cookies or PHP session variables. Should my use of either be conservative due to performance reasons? What are the advantages of either? To briefly describe what I am trying to do: I have 3 forms : formA, formB and formC each has about 15 entry fields (from the same mysql table). formA has fieldA1, fieldA2, etc formB has fieldB1, fieldB2, etc formC has fieldC1, fieldC2, etc The user can navigate from formA to formB, etc with a button click. Right now, I am populating each form from the mysql db value. But I need to save values typed in while the user navigates from page to page. Eventually, the user submits and I update the db from all forms. The easiest way for me to incorporate this into my existing logic is to, before going into formA, set a cookie (or session variable) for each field. If they go to formA and change a value, reset the cookie (I am doing this with an onblur call to javascript function.) Seems inefficient for me to set a cookie for every field...they may only change 1 field...or none. But I am having trouble grasping any other way to do it....Thus, my question about efficiencies, performance, etc.
Session - Mutiple Variables
it says that a session can register multiple variables. how does it work? i think it's like this, but i'm not sure.. session_register($name, $blah, $stuff); $name = "bob"; $blah = "blob"; $stuff = "ok"; and the three values should be saved in a session along with the same 3 variables?
Phplib Session Variables
I've been using phplib for handling my authentication and session management. The problem I've run into is with resetting my global session variables. The Documentation states that I can treat any session variable like any other variable as far as manipulation. In practice, this has not been working.
Passing Variables For A Session
I have a login script which allows user to login and edit their profile, change password. First page is login.html Here the user give their email id and password... After they hit submit. They go to login.php4 If the email address and password matches (email id and password is matched with the one in database and the one with the user input). Then login.php4 didplays successful login message and thier details in edit mode. In this page they have a button with allows them to change the password. If the click on this button, it takes them to password.html page. Now I want to bring the email address from login.php4 to password.html In the login.php4 i put the following lines... session_register("session"); $session["email"] = $email; Now if i execute login.php4 i get the following message. Warning: Cannot send session cookie - headers already sent by (output started at path of login.php4:4) in path of login.php4: on line 50 Warning: Cannot send session cache limiter - headers already sent (output started at path of login.php4:4) in path of login.php4: on line 50 Can I pass a session variable from php4 files to html files...
Session Variables And Forms
I have a mailing list manager script that allows viewing of subscribers and unsuscribers on several different mailing lists. I have a multi-selection drop down menu containing the names of the mailing lists. I want to change a session variable onchange() of the drop-down, so that the last query gets resent for the newly selected mailing lists(s) that the administrator is requesting to view. Then I tried making the page reload() when the drop-down menu selections were changed, but I couldn't figure out how to retrieve the variables from the form considering I'm just reloading the page. I can't think of a good way to do this. So, basically, I am wanting to resend the last sent query changing only the mailing lists that I am searching.
|