How can I insert a session variable in a record?


I can't understand how to insert the value passed by a session variable in a record.

I have a form that I want to use to insert a record. I pass variables from session to this page and you want to insert one of them in the folder. The session information:

session_start();
{
$_SESSION ['usename'] = $_POST ['username'];
$idvar = $_SESSION ['id'];
}

$_SESSION ['id'] is the user_id I want to insert into the file.

I know that $idvar happened to the page with the form because I can echo it.

The embed code looks like this:
If ((isset($_POST["MM_insert"])) & & ($_POST ["MM_insert"] == "Register")) {}
$insertSQL = sprintf ("INSERT INTO h_genres (user_id, username, contrib_to, Annual_Reports, Leader_Content, Member_Content, advertising, Brochures) VALUES (%s, %s %s %s, %s, %s, %s, %s)", ")
GetSQLValueString ($_POST ["'user_id"], "int").
GetSQLValueString ($_POST ['username'], "text").
GetSQLValueString ($_POST ['contrib_to'], "text").
GetSQLValueString (isset($_POST['Advertising'])? ('true': ' ', 'set', '' Y' ",""n" ").
GetSQLValueString (isset($_POST['Annual_Reports'])? ('true': ' ', 'set', '' Y' ",""n" ").
GetSQLValueString (isset($_POST['Leader_Content'])? ('true': ' ', 'set', '' Y' ",""n" ").
GetSQLValueString (isset($_POST['Member_Content'])? ('true': ' ', 'set', '' Y' ",""n" ").
GetSQLValueString (isset($_POST['Brochures'])? (('true': ' ', 'set', '' Y' ","n"));

@mysql_select_db ($database_hauw, $hauw);
$Result1 = mysql_query ($insertSQL, $hauw) or die (mysql_error ());
}

I have a hidden for the user_id field:
< input name = "user_id" type = "hidden" id = "user_id" / >

I think I need to get the value in $idvar in user_id, but I don't know how.
Any help is appreciated.

awsweb wrote:
> I have a hidden for the user_id field:
>
>
> I think I need to get the value in $idvar in user_id but I don? t know how.

--
David powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/

Tags: Dreamweaver

Similar Questions

  • How can I insert a continuation variable in the Index?

    Hello

    Many of the entries in the index of some of my level 1 manuals may have long lists of level 2 entries under them, and sometimes it will break the long list of columns or pages. I would like to start the new column or page with "Topic A," before returning to the list of entries of level 2 (where "Section A" is the level 1 entry). How can I do this? So far, I have two choices to deal with long lists of level 2 entries that break between pages/columns: (1) insert a page or column break before the level 1 entry, which can make this very short column with lots of empty space (doesn't look very good), or simply allow the entry of level 2 list to break without trying to keep the whole list in a single column. Sometimes, this works well, but there are times when no solution is sufficient and I would like to be able to inform the user that a list back to page 3 of the index is in fact the continuation of the same list on page 2.

    Online help provides instructions for inserting variables continuation in the tables. I was unable to find information on how to add to a long list of Index entries.

    I use FM version 8 for Windows (XP). However, I remember being able to do several years (between 1997 and 2002), so that this feature was present in early versions of FM unfortunately, I can't remember how to do it.

    Thanks for any help!

    Joyce

    You must use a third-party utility, such as he is not a native capacity of FM. I suggest you Index Tools of Silicon Prairie (see: http://www.siliconprairiesoftware.com/Products.html).

  • How can I use the Session variable in the repeat region

    I have a session variable assigned to the #(numérotation automatique dans access db) of the posts ID. The variable is set to the recordset object that is displayed first (sort by message ID descending). I would like to find a way to make the variable to assign to all records, if the variable is passed to the delete page. If I use a URL parameter to send the message ID, then someone could change the number in a browser and delete messages not intended for the user.
    If you want to see the example in action goto link at the bottom of the message. Save it and reply links are URL parameters response uses the variable MM_Username to enter the name of the sender for a URL parameter is OK, but click on save and then change the value of msdID in the browser for a different number and you can record and display another message not intended for your login id. The link delete uses a session variable that I posted in the Recordset as the auto access number msdID and the good msdID # do not are they assigned.
    What to hide the URL parameters, it would be simple, but how can I do?
    Thank you
    MikeL7
    PAGE WITH SESSION VARIALBE to DELETE PAGE (save and the response are URL parameters)
    http://www.gohbcc.com/callcenter/EmployeeMessagesVIEW2.asp
    USER name: admin PASSWORD: 1234

    links from other pages of my site will bring to:
    http://www.gohbcc.com/callcenter/EmployeeMessagesVIEW.asp it's the settings of all THE URL enter 2 after VIEW to use session variables

    Your message forced me to find a way to make it work, I put the code to create the variable just before the repeating table in the region and went on to form buttons that post the variable and labeled buttons and it works perfectly. Thank you

  • How can I insert a Fileglobals Variable in a stage name

    Hello everyone,

    I'm curious to know, is it possible to insert a FileGlobals variable in a step name, be it Action, Pass/Fail, limit digital test or what you have.  An example would be "paragraph 1.0 running # {variable} execution" were variable would be an incremental number, whether it's a loop for or any other type of senario.  Thanks in advance for any information you can offer.

    Kind regards

    Scott

    Hi jigg,.

    Thanks for the reply.

    I tried and I thank you.  It does exactly what I was hoping to do.  Thank you very much.

    Kind regards

    Scott

  • Tables: How can I insert "(continued)" in the legends of the table?

    Hello

    I have a document with a number of tables that break across pages. How can I insert the word '(continued)' in the caption of the table on pages of second and followed by a table?

    Advice appreciated.

    See you soon

    Use the variable table Continuation (special > Variables) to insert it.

  • How can I insert a copyright symbol into a document?

    How can I insert a copyright symbol in a box of text/document when there is no access to the font symbols?

    See also:

  • How can I insert a quicktime (.mov) movie in a slideshow iPhoto 9.5.1?

    How can I insert a quicktime (.mov) movie in a slideshow iPhoto 9.5.1?

    Just like a picture. Easy: make an album and add video to it. Base your slide show on that.

  • Hello, how can I insert a PDF file into a Pages Document?

    How can I insert a PDF file into a Document that I wrote with Pages? I know that I used to do with Windows Word.

    Drag it out of the Finder.

    Peter

  • How can I insert a tube you video in windows movie maker

    How can I insert a tube you video in windows movie maker

    I'm guessing it's a .flv file?

    If convert you it to .wmv format you can import
    in Movie Maker.

    There are many programs that can do conversions...
    The following freeware is an example...:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster)
    (the file you want to download is: > FFSetup260.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the last screen)

    First, you will need to decompress the file or just open the
    Drag FFSetup260.exe out of the folder
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Good luck...

  • How can I insert an mp3 music file in Windows Movie Maker?

    How can I insert an MP3 of the music on Windows movie maker film?  I downloaded this song three times from Amazon.com... the file is fine.  Yet, when I'm in Windows Movie make and attempt to insert of the song, I get a message saying that the file is invalid or damaged.  The file is fine.  I'm able to import OTHER songs without problem to my film.  BUT I want this song in particular one and can't make it work.

    Convert MP3 to WMA format before importing
    in Movie Maker and you should have a better result.

    There are many freeware converters available on
    the net... the following examples may be worth a try:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    * Proceed at your own risk *.

    (1) format Factory
    http://www.pcfreetime.com/
    (the file you want to download is: > FFSetup270.zip
    (FWIW... installation..., you might want to
    Uncheck all of the boxes on the last screen)

    First... after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your MP3 files on the main screen...

    Select "while"WMA"/ OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Here's another free download:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    (2) Koyotesoft "Free MP3 WMA Converter".
    http://www.koyotesoft.com/indexEn.html
    (FWIW if you install the converter, you can
    Uncheck offerings from Yahoo and Dealio) (also... you
    may want to uncheck the CD Ripper and the Easy
    MP3 Cutter)

    After installing the program... open and drag and drop
    your audio files on the main screen...

    Choose a backup folder (path of output). Or just leave...
    "Save to the directory the file" checked and the new
    files will be saved in the folder with the current files.

    Choose a format... WMA.

    Left, click Convert.

  • State BBM BBM message - How can I insert an emoticon?

    I have a classic Blackberry. How can I insert an emoticon in my status message? Not 'personal message '. With my previous BB's "BOLD" if I clicked on the button "symbol" on the keyboard, I could insert an emoticon.

    I see what you mean now, when you attempt to add a custom status no emoticon icon is present: s

    The only suggestion I can make is to enter the shortcode emoticons such as which will turn into the emoticon. The list shows the shortcude after you save the new status, but when switch you to him, shortcodes will appear as corresponding emoticons.

    I'll share this with the BBM team so we can consider to add this option later updated to BBM.

    Let me know if help and thanks for being patient with me

  • How can I insert an image with password?

    I just got my computer back from the repair shop.  Then I start here with my Windows 8.   How can I insert an image with your password?  What confuses me, is that when I select a picture for my password, I have three gestures.  I don't know what are these actions?  I started to change the picture for my password.  I browse my files and select a picture.  I clicked on the box that says something like this is the image you have selected.  I clicked Yes.

    Only the next day, he said I must draw three gestures.  I don't know what they want.  Please help me what I have to do...

    Hello

    Please refer following guide to implement Image password on your Windows 8:

    http://www.kapilarya.com/Tip-set-up-change-or-remove-picture-password-in-Windows-8-1

    Hope this helps, good luck :)

  • How can I target a captivate variable go a web object

    How can I target a captivate variable go a web object

    window.parent.window.cpAPIInterface.getVariableValue ("cpQuizInfoStudentID");

    window.parent.window.cpAPIInterface.setVariableValue ("yourVariable", "" value");

    Window.parent.CP.Enable)

    Window.parent.CP.Disable)

    Window.parent.CP.Show)

    Window.parent.CP.Hide)

  • Please how can I insert a value of richinputtext in the database string attribute

    Please how can I insert a value of richinputtext in the database string attribute

    If you can get its value at the bean and then call your insert statement to put it in the DB table

    and if you want to know about the execution of SQL query

    then check - Ashish Awasthi (Jdev/ADF) Blog: SQL to run in an ADF Application using DataSource DBTransaction & JDBC query

    Ashish

  • How can I insert a footer?

    How can I insert a footer in ms?

    Hi Leon,

    You will need Acrobat application to insert header/footer.

    Refer to this document KB help Add headers, footers and in format PDF, Adobe Acrobat Bates numbering

    Kind regards
    Nicos

Maybe you are looking for