Need session variable after inserting a record.
I have a page where I am setting up a new user. After they enter their username, password, address etc. I am inserting the record when they press the commit button, then moving on to the next page.
I have a session variable setup called user_name, which is also the name of the field in my table.
My problem is that the value in my session variable goes away after inserting the record. How do I retrieve the value of user_name?
At the top of my 2nd page I have:
<?php
session_start();
$_SESSION['user_name'] = $_POST['user_name'];
?>
This gives me an index error.
I also have session_start(); at the top of my first page.
What am I doing wrong?
Thanks.
I figured it out by moving the variable assignment right before the redirect to the next page.
Similar Messages
-
Need some help after inserting CMS system
Hi on my site ive inserted an CMS system from Cushy. It all work that isnt the problem. The problem is that my page is a mess now.. The only thing ive addes is a cms code so im hoping the solution isnt hard to do.
There are three pages that are complete changed.
The home page
http://www.vakantiewoningeninsuriname.nl/index.html
The text colomn right under is moved.How can i place this back?
on http://www.dorff.nl/ you can see how it was before i add the CMS.
The next page is:
http://www.vakantiewoningeninsuriname.nl/bezienswaardighedenparamaribo.html
You can see there is a lot extra space between the head and the text. And you see that the text is not only at the right side anymmore.
This is how it should be:
http://www.dorff.nl/bezienswaardighedenparamaribo.html
The same goes for this page:
http://www.vakantiewoningeninsuriname.nl/prijzen.html
And this is how it have to be:
http://www.dorff.nl/prijzen.html
Hope you can help, thank you for looking..
Regards BrianDear Nancy,
Thank you for your response,
I will try to explain again what is wrong. On my site you see this page:
http://www.vakantiewoningeninsuriname.nl/prijzen.html
Problem is that the picture below is on the right side of the page instead of the left like the other pictures.
On:
http://www.dorff.nl/prijzen.html
You can see how it should looks.. Pictures to the left and text on the right. Dont know what happened when im adding the Cuschy CMS. Hope you can see what is wrong.
Regards Brian
Date: Wed, 2 May 2012 13:04:14 -0600
From: [email protected]
To: [email protected]
Subject: Need some help after inserting CMS system
Re: Need some help after inserting CMS system
created by Nancy O. in Dreamweaver - View the full discussion
Change this:
Prijzen
Bij ons kunt u terecht met elk budget. Wij hebben woningen voor mensen die een langere tijd blijven maar ook voor vakantiegangers. Daarom hebben wij verschillende prijzen gehanteerd.
to this: <!Begin CushyCMS>
h2. Prijzen
Bij ons kunt u terecht met elk budget. Wij hebben woningen voor mensen die een langere tijd blijven maar ook voor vakantiegangers. Daarom hebben wij verschillende prijzen gehanteerd.
<!end CushyCMS> Nancy O.Alt-Web Design & PublishingWeb | Graphics | Print | Media Specialists http://alt-web.com/http://twitter.com/altweb http://alt-web.blogspot.com/
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4374962#4374962
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4374962#4374962. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Dreamweaver by email or at Adobe Forums
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
The row was not found at the Subscriber error keeps popup and stopped synchronization even after inserting missing record at subscriber - transcational replication.
first error throws: Grab exact sequence number, find row and inserted at subscriber...
Start synchronizing, ran fine for a while, stopped again with error with different exact sequence number, repeat again same as step 1.......
how can we stop this and make it run without this error?
Please advise!!!Hi,
This means that your database is out of sync. You can use the continue on data consistency error profile to skip errors. However, Microsoft recommends that you use -SkipErrors parameter cautiously and only when you have a good understanding of the following:
What the error indicates.
Why the error occurs.
Why it is better to skip the error instead of solving it.
If you do not know the answers to these items, inappropriate use of the
-SkipErrors parameter may cause data inconsistency between the Publisher and Subscriber. This article describes some problems that can occur when you incorrectly use the
-SkipErrors parameter.
Use the "-SkipErrors" parameter in Distribution Agent cautiously
http://support.microsoft.com/kb/327817/en-us
Here are two similar threads you may refer to:
http://social.technet.microsoft.com/Forums/en-US/af531f69-6caf-4dd7-af74-fd6ebe7418da/sqlserver-replication-error-the-row-was-not-found-at-the-subscriber-when-applying-the-replicated
http://social.technet.microsoft.com/Forums/en-US/f48c2592-bad7-44ea-bc6d-7eb99b2348a1/the-row-was-not-found-at-the-subscriber-when-applying-the-replicated-command
Thanks.
Tracy Cai
TechNet Community Support -
Use session variable in Insert record
Help, please!
I need to add a record to a table; one of the fields in the
table is the user_id. When I try to use the insert record server
behavior, there is no way to select the user_id session variable!
How is this done?.oO(Ted Dawson)
>>>> to select the user_id session variable! How
is this done?
>>>
>>>Use a hidden variable in the form, and assign it
the value of the session.
>>
>> And what if the user manipulates that value? Hidden
form fields _always_
>> require a validation on the server. One purpose of a
session is to avoid
>> that sensitive data is sent to the client, where it
can be manipulated.
>
>
>Exactly how is the value of a SESSION VARIABLE
manipulated by the client?
It can be manipulated if it's put into a hidden form field.
Micha -
Missing Session Variable After Redirect
For some reason my session variable has suddenly stopped
storing across my redirect. Can anyone please tell me what's going
on?Ha ha, how lame of me. My issue had nothing to do with the
code above. There was an error following this code on the landing
page which was being caught. A full two days of stressing because a
variable was named instance.ven_address1 instead of
instance.ven_address. YES, one character in a maze of code.
LMAO!! -
Temporary performance degradation after inserting many records
I run into the following performance problem:
I'm accessing Oracle from Java (JDBC).
2 tables:
DISPLAYS
PAYLOADINFO
PAYLOADINFO contains a foreign key to DISPLAYS.
A process writes 100000 records into PAYLOADINFO, in a single transaction. The transaction is committed. Each of the records places the SAME id in the foreign key (ie. all payload-info originates from the same display).
After commit succeeds, a query (on other tables referencing the DISPLAY table) is launched.
1) With the foreign key, queries become VERY slow for a while. After this 'while', queries get back up to speed.
2) with NO foreign key linking the two tables, subsequent queries keep their original performance.
I read somewhere that this could be caused by unbalanced indexing ? Is this the case ? Where should I look for a solution ?
best regards,
GeertCan you define "a while"? Are we talking minutes? hours? days?
When are statistics gathered in the database?
Do you see a change in the query plan? Or do you see other tasks consuming system resources?
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Need a method to insert 1000 records in oracle in once
Hi All,
I want to insert more than 1000 records in oracle database in once. Please let me know the way to do this. It's urgent..........
Regards,
Puneet PradhanMore then 1000?
So, how about 10000?
Use the CONNECT BY LEVEL clause to generate records:
insert into table
select level --or whatever
from dual
connect by level <= 10000;
It's urgent..........Since it's your first post, I recommend you to not use the 'U-word', or you'll be made fun of... -
Unable to insert a record in any table
Hi,
I was working on a procedure in which i had to insert 1,00,000 records each in 3 tables. But the procedure stopped after inserting 56000 records.
After that I again ran the query but now it is not inserting a single record.
I just created a dummy table
create table vinod1(no number);
and tried to insert a value in it using
insert into vinod1 values(100);
But to my surpries the query has been executing since last 10 and has not inserted a row.
I tried it on SQLPLUS also and i am using oracle 10g
Can you please help me and explain why i am not able to insert even though I am able to create table.
Thanks
-Vinod965358 wrote:
The problem is In the new created table I am not able to insert records. The session keeps on executing forever.
Also I am using Plsql developer and in that if I see in tools-> session -> active session
for my session under event the message is 'statement suspended wait error to be cleared'
Edited by: 965358 on Dec 24, 2012 6:30 AMyou have a mystery & we have no clues.
How can we reproduce what you report?
How do I ask a question on the forums?
SQL and PL/SQL FAQ -
The documentation says that I can use the DISPLAYNAME session variable. However, in the server variable initialization block, it returns no value. In fact, it is not even recognized as a bind variable.
For example,
The query select ':USER' from dual returns
Variable Value
==== ========
mysessvar Administrator
However, select ':DISPLAYNAME' from dual returns
Variable Value
==== ========
mysessvar :DISPLAYNAME
I have read other threads dealing with the GROUP session variable, so it seems like this should be possible. However, I cannot get it to work. I am using OBIEE version 10.3.3.2. Thanks.Sorry. Yes, usually the best thing to do is state your objective, rather than your method. I am using SSO, but I want to have the ability to filter records based on the user logging in. Here is one way I thought of doing this.
What I need to do is filter records based on a particular ID. Let's say my report table looks like this:
RID UID Amount
=== === =====
1 1 10
2 2 15
3 1 20
I also have a table mapping username to UID, let's call it USERS.
UID Username
== ========
1 Joe
2 Bob
We have set up OBI to use SSO and cookies. We will authenticate the user and then redirect to OBI. However, in OBI, I only want to show the records related to the user logging in. So, if Joe logs in, I only want to show records with RID =1,3. If Bob logs in, I only want to show records with RID=2.
Now, if I was to create 1 named user in OBI for each user in USERS, I could use an init block to query the USERS table, get the UID and set it to a session variable. I could then use this session variable to filter my records. However, even though we won't have that many users, I don't want to do it manually. I want to create one OBI user that has access to the report. To filter records, my thought was to set the DISPLAYNAME using a cookie and then use the DISPLAYNAME to retrieve the UID.
To answer the question asked by Turribeach, OBI is only looking at users defined in the rpd. We are using SSO, but OBI is not using external authentication.
To summarize, I am using SSO, but I want to have the ability to filter records based on the user logging in. I just want to know the best way of doing that. Thanks! -
Send e-mail sing trigger after insert
Hi,
I need to intiate a trigger in oracle dB after inserting a
record to table I need to send a e-mail to specified person.
This trigger should be cnditional.
eg. Table emp
columns: name dep sal
on insert of every record to this table and when dep code is 3 I
should send e-mail to named person.
Please give me code examples.
thanksHi,
Maybe what you are looking for is the db package UTL_SMTP?
If you're using Forms, go to the Navigator, Database Objects,
choose SYS schema and open Stored Program Units. If it's not
there, contact your DBA. I'm not sure if it's available for
databases prior to 8.1.6
Hopefully, the package spec will have some examples that you can
use.
Good Luck,
Pedro
[email protected] -
Hi All,
I have created a write back report and successfully inserted records into a table.
Now i want to capture the user who has inserted in to the table.
Till now i have given edit option to the users on USERNAME column.
But now i want to capture the user automatically.
when i user VALUEOF(NQ_SESSION.USER), i can capture the Logged in user in USERNAME col and the moment i execute the report it is throwing an error.
What i observed is....
In the advanced tab USERNAME col is changed to VALUEOF(NQ_SESSION.USER).
is there any workaround for this?
Thanks>>I have a session variable assigned to the ID#(auto
number in access db) of messages posted.
I not sure if I follow your in the description. I would
assign the Record ID to the session variable.
Place the Record id in the repeat region.
Then you could assign that record id to a session variable
when the button is click, capture the button click event. Then
redirect to the EMPLOYEEMessageDELETE1.asp page, which will read in
the session variable (record id) to be deleted.
David Pearson -
How to generate a random session variable in php
i want to generate a random session variable and insert the variable in a mysql record to use later to validate an account set up.
person fills out form to create account and submits; inserts form information in mysql record.
i want the random variable to be inserted from a hidden field and the page sends an email with a link to click on to compare the variable to validate the user.
Not sure how to generate a random session variable and get that to the hidden field value to be inserted with the other form information.
thanks for your help,
Jim BalthropTo insert the key I would personally do something like...
$key = md5($username . $password . $salt);
Insert that into your MySQL database, then send them a email with it, my next code shows how to activate it.
This is to activate the account.
<?php
$key;
$errors = array();
if(isset($_GET['key']){
$key = $_GET['key'];
$sql = 'SELECT * FROM users WHERE key = \'' . $key '\' LIMIT 1';
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result)){
$sql2 = 'UPDATE users SET active = 1 WHERE key = \'' . $key '\' LIMIT 1';
$result2 = mysql_query($sql2) or die(mysql_error());
if($result2){
//successfully activated account
else{
//Something Went Wrong!
else{
$errors[] = 'Invaild Key, Please try again!';
else{
$errors[] = 'Invaild Key, Please try again!';
?> -
Edit session value after login
I would like to edit the session value of a session that is set after a user logs in.
Problem:
I have a field 'date of birth' in my database: yyyy-mm-dd, but i need the age value instead in the session.
I know how to calculate this but that is not the question, i need to know where to edit this value so that after a login the session is set to the age of the user instead of his/her date of birth value from the database.
I hope you understand.
Can someone please help me out...
Thanks,
JimHi Jim,
<br />
<br />nope, Adobe/Interakt are not participating here.
<br />
<br />However, I do *think* that converting these values *upon* login seems quite weird to do -- ADDT´s session variables are based on the "as is" contents of DB table fields, and what you´re asking for is a very special usage scenario which was even never asked for in the Interakt forums, so that´s why assumingly other forum particpants reading this keep scratching their heads as well.
<br />
<br />The only approach I can suggest for now, is to convert the session variables *after* login, and that´s quite easily possible -- on that very page that´s going to display the banner, it should be possible to initialize the abovementioned "calculate age from birthday" conversion routine and assign the session variable "current_age" to the PHP variable "$birthday_user", e.g. $birthday_user = $_SESSION['current_age'];
<br />
<br />Once you have this clearly assigned, all you´d have to do is to apply a "Show IF conditional region" that´s checking against the $birthday_user value, e.g.
<br />
<br /><?php<br />// Show IF Conditional region_check_user_age<br />if ($birthday_user < 20) {<br />?>
<br />display banner for folks under 20
<br /><?php<br />// else Conditional region_check_user_age<br />} else { ?>
<br />display banner for folks older than 20
<br /><?php }<br />// endif Conditional region_check_user_age<br />?>
<br />
<br />As the line breaks in the code posted above will most likely disappear as before, I´m attaching a text-only version
<br />
<br />Cheers,
<br />Günter Schenk
<br />Adobe Community Expert, Dreamweaver -
Urgent help : how when insert new record navigation off
hi master
Sir
when i insert new record by mistake press down key and curser move to next record and my need is
When I insert new record or change any record that time my form navigation musht be off and no move to next record how I restrict to navigation please give me idea which event and what code I use
Thanking you
aamirIf u want the cursor not to move ahead from a particular field when the records are inserted or updated on that field then u can just write null to the
key-next-item trigger of that particular item.
ie IN key-next-item
null;
Hope this is what you wanted. -
Login Session Variable Problem
I've created a simple login using the inbuilt DW suite, but I don't seem to be able to display the session variable after they login.
On the success page it should filter the RS based on the Username and also display the Username etc on the page but nothing is shown. I tested the success page in DW and entered a value for the session var and it works fine, all I can think of is that the session is empty, not coming through, but I'm clueless.
Any ideas?
<<<<<LOGIN PAGE>>>>>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
if (isset($_POST['UserName'])) {
$loginUsername=$_POST['UserName'];
$password=$_POST['Password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "login_successful.php";
$MM_redirectLoginFailed = "login.php";
$MM_redirecttoReferrer = true;
mysql_select_db($database_connpbxlogin, $connpbxlogin);
$LoginRS__query=sprintf("SELECT UserName, UserPassword FROM Users WHERE UserName=%s AND UserPassword=%s",
GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
$LoginRS = mysql_query($LoginRS__query, $connpbxlogin) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && true) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
header("Location: " . $MM_redirectLoginSuccess );
else {
header("Location: ". $MM_redirectLoginFailed );
?>
<<<<<SUCCESS PAGE>>>>>
$colname_LoggedRS = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_LoggedRS = $_SESSION['MM_Username'];
mysql_select_db($database_connpbxlogin, $connpbxlogin);
$query_LoggedRS = sprintf("SELECT * FROM Users WHERE UserName = %s", GetSQLValueString($colname_LoggedRS, "text"));
$LoggedRS = mysql_query($query_LoggedRS, $connpbxlogin) or die(mysql_error());
$row_LoggedRS = mysql_fetch_assoc($LoggedRS);
$totalRows_LoggedRS = mysql_num_rows($LoggedRS);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</p>
<p>username: <?php echo $row_LoggedRS['UserFirstName']; ?></p>
<p>email: <?php echo $row_LoggedRS['UserEmail']; ?></p>
<p>Session Data:
<?php echo $_SESSION['MM_Username']; ?></p>
</body>
</html>
<?php
mysql_free_result($LoggedRS);
?>Does your success page begin with session_start()?
Maybe you are looking for
-
The site is not unsafe site, but it's not what I wanted to do! How do I get rid of the exception? I've tried Tools --> Options, and then I've looked mostly in Security and Advanced I located the Encription area under Advanced, which looked promising,
-
Windows can't find photoshop.exe
I had CS5, Worked well for like 1 month, then, I had this problem so I tried installing CS6 (I STILL HAVE CS5) and the same with CS6. Not only photoshop, I can't open any ADOBE's applications. PLEASE HELP ME!
-
Must be a bug in the Score display
This is a continuation of my exploring the problem previously posted re the display of all instruments in a 2 track score (see previous topic). I tried a new experiment and am now convinced it is some kind of bug. Here is what I did: 1. Closed LE8. T
-
Battle Field BC 2 Mac pro boot camp problem
Im very new to boot camp and al of that stuff. I installed windows 7 on my mac pro, then i installed the snow leopard cd. Then i installed BFBC2 and when i try to start it up it starts gathering info then one part of my screen goes white and the mous
-
AD Trusted Recon - Disabling user deletes him in OIM
Hello, I'm having trouble changing a user state to 'Disabled' in OIM when I disable him in the Active Directory. Has anyone ever encountered this problem and know how to solve it? Thanks in advance