May 16, 2008

Passing Variables Through A Page?

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > ColdFusion Programming

free web hosting

Passing Variables Through A Page?

kvarnerexpress
I have a form that people fill out. Depending on what they fill out on that form, they get different things on the page they're taken to after hitting "submit". Information from both pages goes into a database.

However, I don't want to create a new row until the second page has been filled out and submitted (taking the user to a third page). Is there any easy way to pass all the variables from the first page through the second and to the third? I know I can stick it all in hidden inputs, but I have more than 60 form items to process, and I'd like to not have to code an entire page just to pass them as possible.

Reply

Paul Thomas
QUOTE(kvarnerexpress @ Feb 7 2006, 02:22 PM) *

I have a form that people fill out. Depending on what they fill out on that form, they get different things on the page they're taken to after hitting "submit". Information from both pages goes into a database.

However, I don't want to create a new row until the second page has been filled out and submitted (taking the user to a third page). Is there any easy way to pass all the variables from the first page through the second and to the third? I know I can stick it all in hidden inputs, but I have more than 60 form items to process, and I'd like to not have to code an entire page just to pass them as possible.


Well if you have 60 items to collect, you are going to have to track 60 items page to page unless you do some interim database solution in between. One idea that might make it easier would be to name you Form UI objects according to some pattern: txtBox1, txtBox2, txtBox3 and then write a cfloop to go over them...then instead of writing 60 hidden inputs to maintain you would have something more manageable.

I suppose you could also do session variables but that might put more wear-n-tear on your server then you want.

Thougts?

 

 

 


Reply

sharpz
QUOTE(Paul Thomas @ Feb 16 2006, 08:13 PM) *

Well if you have 60 items to collect, you are going to have to track 60 items page to page unless you do some interim database solution in between. One idea that might make it easier would be to name you Form UI objects according to some pattern: txtBox1, txtBox2, txtBox3 and then write a cfloop to go over them...then instead of writing 60 hidden inputs to maintain you would have something more manageable.

I suppose you could also do session variables but that might put more wear-n-tear on your server then you want.

Thougts?


Isnt there the equivalent of a cookie in CF? If there is there should be no reason to track all 60 items within each page. Im sure theres a way you can create session variables.

Reply

jlhaslip
One possible solution might be to place the items from the first page in to an array and then write the array to a temp database, passing only a row id number before handling the second page, storing the second page info into a second array, then read the first array back and concatenating the two arrays before writing to the db? A bit of a struggle, but if you can code it like suggested above so that the data handling can be looped by an index, it probably wouldn't be so bad.

Reply

Paul Thomas
QUOTE(sharpz @ Feb 16 2006, 11:21 PM) *

Isnt there the equivalent of a cookie in CF? If there is there should be no reason to track all 60 items within each page. Im sure theres a way you can create session variables.


ColdFusion does have a <cfcookie> tag but why store all the values as cookies...it would be easier and probably efficient to use the an html input field or cfinput field instead. Cookies would only come in handy if you were trying to ease the users data entry if they were visiting your site / pages on a reoccuring basis.

smile.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : passing, variables, page

  1. Multiple Page Titles
    Multiple Page Titles (1)
  2. I Cant Log In To Cpanel
    I get "Unable to connect" page (6)
    I am trying to get ot my cpannel but it won't let me connect. I am using Firefox, I cleaned out
    my cashe and my cookies. I go ot http://mysite.trap17.com/cpanel and i get a page with this
    message: QUOTE(errorpage) Unable to connect Firefox can't establish a connection to the
    server at racuria.trap17.com:2082. * The site could be temporarily unavailable or too busy.
    Try again in a few moments. * If you are unable to load any pages, check your
    computer's network connection. * If your computer or network is protect....
  3. Create Page?
    How? (5)
    Hi, everyone! I need to create a script just within a page. Read the following story: I have
    an account at one of file sharing hosts. I am tired of every time log in and tell others what I have
    at it (files). If there is way to create a script that logs in me and just list the files i have
    on this account from specified folder. If you know, let me know as usual.....
  4. Admin Page
    Tutorial Needed? (4)
    I need to look at a nice tutorial how do you create an admin access page with many functions as many
    as possible.....
  5. Uk Users: Beware Of Phorm The Spy Your Isp May Adopt
    Phorm will spy on every page you visit and target adverts at you paid (3)
    Hello everyone, this applies mainly to UK users but overseas users might be interested too. I have
    an RSS feed to the BBC website in firefox and i spied an article about a company named Phorm. You
    may know Phorm by another name...121Media. The company that bought us spyware and adware that we
    never wanted in the first place. Phorm is the next generation in remote spy/adware hosted at your
    ISP. Let me explain. 3 ISPs in the UK are in talks with Phorm about introducing this system: Phorm
    will intercept every web request made using your ISP (so that includes every webpage....
  6. Web Page Layouts
    using Cascading Style Sheets (1)
    Here are a set of three Web pages I wrote a long time back when I was first starting to develop
    sites. The first one is a two columned page with a full length sidebar for navigation links. There
    are two that are identical except the sidebar positions are reversed. Another is "one way" to create
    a three column layout. And lastly, a 'framed' look on a page. These are not
    'fancy', you will need to look into the code and colourize it to suit, maybe set a width and
    centre it if you want, whatever... Please feel free to snag the source and develop the pages....
  7. A Simple Password Page
    I can't make one!!! (3)
    I'm trying to make a simple password page for one of my PHP experiments. Every time I try to
    post a password, however, it returns an error that the connection was "closed by the server". The
    entire code is only 3 pages. password.php: $rightuser = ""; $rightpass = ""; include
    ('getpassword.php'); if $_POST !== $rightuser { if $rightuser ==
    '' { ?>The username is incorrect. It should be blank. } else { ?>The username is
    incorrect. It should be . } } else { if $_POST !== $rightpass { if $....
  8. Free Page Maker
    by yours truly (0)
    Well as we are all aware, people like to experiment. As with all hosting services, people will
    always sign up without knowing a lot of web design and wanting to learn + experiment. I created a
    small C++ program to generate a page for you that you can edit that is compliant with html and css
    standards. Simply download the .zip file, extract the .exe and double click it to generate a page.
    If you want more than one, for: Index page contact page downloads page etc.... then you *MUST*
    rename the new page before making a new one, or it will overwrite it. this is what a f....
  9. Question About Php Includes
    How would you include a frame AROUND the page? (17)
    I'm trying to make a layout for my website for the areas that aren't occupied by Wordpress,
    and I want to use PHP includes to do it. So far, I know how to use tags, like this: CODE
    <table> <?php include "sidebar.php" ?> </table> This is okay,
    but I want to be able to include everything in one "container" file. Kind of like this: For every
    HTML file that I include: CODE <html> <head> <?php include
    "frame.php" ?> <title></title> </head> <body> <!....
  10. Centering A Div Containing Image.
    I have a logo I need centered in a aujustable width page (9)
    http://sonesay.trap17.com/sonesayi/ Just a new layout I'm working on, Any ideas how I can get
    the logo to be centered? At the moment I can only float it left or right. I think is possible to get
    it done in tables but I would prefer to stay away from them in layouts. Any insight appreciated. by
    the way source code and css is at http://sonesay.trap17.com/sonesayi/index.html
    http://sonesay.trap17.com/sonesayi/main.css thanks ....
  11. Treating .csv Files As Database Data
    Showing .CSV data on a web page (2)
    I use a nice program (which I helped to beta test) called ' Simfatic Forms ' to generate
    forms on web pages. The only problem is that it does not (yet) support MySQL databases, it saves the
    form data as a .CSV file. Now I was wondering if you can do the same with a .CSV file as you do
    with a MySQL databse, ie. displaying the data in that file on a web page which adjusts automatically
    as data are added to the file. To clarify: eg. if I make a form to sign a petition online, the data
    are saved to a .CSV file every time someone fills in the form, is it now possibl....
  12. Counting Variables?
    (4)
    Write a php script that will accept a positive integer, if it is even, divide it by 2 and if it is
    odd, multiply it by 3 and add 1. Repeat the process until the value is 1, printing out each value.
    Finally print out how many of these operations you performed. If the input value is less than 1,
    print error and perform an exit(); For example: Initial value: 9 Next value: 28 Next value: 14
    Next value: 7 Next value: 22 Next value: 11 Next value: 34 Next value: 17 Next value: 52 Next
    value: 26 Next value: 13 Next value: 40 Next value: 20 Next value: 10 Next value: 5 Nex....
  13. Is It Possible To Create A Web Based Mmo In Javascript?
    And could there be free movement without reloading the page? (4)
    I would like to get some information before launching myself to the JS libraries. Is it possible to
    load maps or images and with the press of a button "scroll" or move the image inside some kind of
    window up, down, left or right? It would be like scrolling an image sideways, upwards or downwards.
    I would also like to know if multiple connections can be made and lets say there was a user
    standing in the location (127, 160) of the map, would there be the possibility of loading the image
    of that player? Maybe with database connections and storing their information there?....
  14. Add A Javascript Feedback Form On Your Web Page
    This is how to do it (6)
    So i was looking for a feedback form in javascript and i couldn't find one so ive made one for
    you guys here we go! So this feedback form will ask for name, emails address and their comments
    First of all add this code in between the and tags CODE <script
    name="JavaScript"> <!-- function SendEmail() {         var toaddy =
    'name@domain.com';         var subject = 'JS Form Submission';         var mailer =
    'mailto:' + toaddy + '?subject=' + subject + '&body=' +
    'Name%20is\....
  15. A New Ptc Information Page!
    (1)
    Since there are a lot of people that don't know what PTC is or how the can easyly make money
    with it I made a website to tell those people all about it. When you don't believe in this kind
    of stuff you should deffenitly check this out and read why it's obvious why those company's
    pay you. Good luck and enjoy!! www.pax.trap17.com Greetzz /wink.gif"
    style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />....
  16. Tricks With Php Variables
    (10)
    You probably are thinking at this moment why I am posting some tricks with variables. Well, there
    are many useful things a variable can do for us. For one they can actually be used to create simple
    games. They also can be used to produce a random result in a page. Another great use is shoutboxes.
    Well here are some cool variable effects. Adding Multiple Strings We can use strings to create
    great effects. Example: CODE <?php $var1="Hello person.";
    $var2=str_replace("person","world",$var1); echo $var1."
    &....
  17. Envizion's Front Page
    (12)
    Ok, so I've done a really simple Front Page for my Game Development Team, ENVIZION. I was going
    for clean and dark, so let me know if this works. If not, I think I'll go with something a
    little brighter and a bit more intracate. http://www.envizion.trap17.com ....
  18. Image Not Taking The Right Size In Web Page
    An image is correct when designed, but not when put in a website (1)
    When trying to make a web page with a GIF image on it which runs a coloured bar along the top and a
    coloured curve along the side, I come across the weird thing that, when I put the image on a web
    site, it does not take in the whole top and does not run from top to bottom completely. The image is
    made in Adobe Photoshop at a resolution of 1024X768 pixela and looks correct , ie. the horizontal
    bit runs completely from left to righ and the vertical bit completely from topright to bottom right,
    yet when put in to the web page, it shows with big margins left and right and to....
  19. Web Page Tree Menu: Style Sheet - Javascript
    (5)
    I got bored and lazy working on the things that I should do... so I end up creating this tree menu
    for anyone to use if they find it interesting. Well the idea is to create a tree menu in a webage.
    Instead of those linear menu it would be better to add more dynamic to your webpage with a tree
    menu. Others use image rollovers. As expecte the tree menu should behave like the one in Windows
    Explorer. When you click a node depending on its state it will pull down or pull up its chlid nodes.
    I have achieved by exploiting one style sheet property, display . Basically this s....
  20. Scrolling Images?
    How to Make an Image Scroll With the Page (4)
    I'm trying to make my homepage look a little fancier and I've got a nice background image,
    but I want it to scroll with my page, like if you scroll down the image will still appear like it
    does on the top of the page. Can someone tell me how to do this? I'm using Microsoft Frontpage
    to edit it. I'm not sure what programming language this would be, probably CSS or Javascript,
    but I can edit the page script with Notepad or something to make this work. Right now the page is
    purely HTML, so whichever language this is, can somebody also give me the tags and ma....
  21. Wap Source Code Viewer
    Mobile/wap source code viewer page (1)
    This is a source code viewer that will workl on wap/mobile sites but you can easily convert it to
    work on web im sure ;-) CODE <? header("Content-Type:
    text/vnd.wap.wml"); echo '<?xml version="1.0"
    encoding="utf-8"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
    "http://www.wapforum.org/DTD/wml_1.1.xml"> <wml> <head><meta
    http-equiv="Cache-Control" content="no-cache"
    forua="true"/></head> <card title="s60.nerds.....
  22. Reload This Page Geometry Wars For Pc [download]
    (4)
    I was searching around online for a pc version of this game and this guy on the gamestop forums made
    one--pretty sure its the one of the first pc renderings of it. Anyways, so i downloaded it and it
    works very well on my laptop, great refresh rate and everything. Mind you, it's still in its
    beta ".5" form so I'm sure he'll make some massive changes before its officially released.
    I have the xbox corded controller, and it works like a charm. It even has vibration--which I
    don't get on the 360 due to my controller being wireless. Direct Download Update/....
  23. Refresh Page After Back Button Hit
    (5)
    Hi. I have a page that is dynamically build through DOM manipulation. So, when I browse outside the
    page, and then click back, those dynamically created DOM objects are gone. Since I am also using JSP
    / Servlet technology, I can rebuild this page easily, which I have done. Here is my dilemma. If
    the user leaves the dynamic page, then clicks back on their browser, I need the page they are going
    back to to refresh. I can't figure out how to do this. I've tried using the META tag, but it
    won't do it. Help would be appreciated. Thanks. ....
  24. Cpanel Demo Page
    for new applicants and guests (44)
    Hello TRAP17 members and dear guests, I have received permission to show demo version of cPanel
    offered to all hosting members of TRAP17. This demonstration page will show what TRAP17 offers to
    our hosting members, including what other services that are attached with cPanel. Please use this as
    your guide when posting a question or simply take a tour before you can decide to host with us.
    Click this link to see cPanel demo page From time to time I will work on to show a greater detail.
    And the link may change in the future so please do not bookmark this page. I hope ....
  25. Button To Print Current Web Page
    (13)
    Hi, Does anyone know how to create a button that will printo out the current page. What I want to
    do is have the user fill out a form (containing name, address, zip, etc). They will then click on a
    "print" button and it will print out the form data. Any ideas? Thanks.....
  26. How To Autorefresh A Page Every Two Minutes?
    (18)
    I'm working on an OFFLINE SYSTEM that uses PHP and MySQL. Something that can be used by a small
    network of PC's to do transactions. These are problems I need to solve: 1] I need A CODE THAT
    REFRESHES THE PAGE EVERY TWO OR SO MINUTES. That way the new entries in the database gets seen on
    the page and I don't have to press F5 or click refresh everytime. 2] How do you set CHMOD
    PERMISSIONS WHILE USING APACHE AS MY SERVER (OFFLINE)? Is the idea of an OFFLINE SYSTEM sounds
    garbage? Is it okay to use it for transactions within a small network? SUGGESTIO....
  27. Toggle display in page script
    (7)
    This is my very first script, before I knew what was out there. It works in IE 5 and up. Not sure
    about netscape or mozilla. (I recently d/led mozilla and it's great for javascripts. Much less
    typing.) CODE <script language="javascript"> <!-- function
    toggle(what){  if(document.all[what].style.display ==
    "none"){    document.all[what].style.display = "block";
     }else{    document.all[what].style.display = "none";  } }
    //--> </sc....
  28. Php Unique Hit Counter
    Count page hits with php. (27)
    Hello all, Here is a neat and helpful PHP script that can count unique page views on your website.
    First you need to open up a new page in your text editor and paste in this code. CODE <?php
    $filename = "hits.txt"; $file = file($filename); $file =
    array_unique($file); $hits = count($file); echo $hits; $fd
    = fopen ($filename , "r"); $fstring = fread ($fd , filesize
    ($filename)); fclose($fd); $fd = fopen ($f....
  29. <iframe> Tag
    a page within a page (11)
    I really love the tag. I use it a lot in my website especially for shoutboxes. I use to wonder
    how it's done and I thought you use a lot of frames for it but it's actually quite simple.
    You may paste this code in a table/cell and then just change the values of the width and height.
    CODE <IFRAME name= main src="main.htm" frameBorder=0 width="334"
    height="311" marginwidth="0" marginheight="0">  <font
    size="1">Please get Netscape 6.0 or Internet Explorer 5+ to view this
    page</font>....
  30. Faster Page Loading...
    Firefox Browser ONLY (18)
    This will make your pages load even faster. 1. Type "about:config" into the address bar and hit
    return. Scroll down and look for the following entries: network.http.pipelining
    network.http.proxy.pipelining network.http.pipelining.maxrequests Normally the browser will make
    one request to a web page at a time. When you enable pipelining it will make several at once, which
    really speeds up page loading. 2. Alter the entries as follows: (by double clicking them) Set
    "network.http.pipelining" to "true" Set "network.http.proxy.pipelining" to "true" Set
    "network.http.pip....

    1. Looking for passing, variables, page

Searching Video's for passing, variables, page
Similar
Multiple
Page Titles
- Multiple
Page Titles
I Cant Log
In To Cpanel
- I get
"Unable
to
connect"
page
Create Page?
- How?
Admin Page -
Tutorial
Needed?
Uk Users:
Beware Of
Phorm The
Spy Your Isp
May Adopt -
Phorm will
spy on every
page you
visit and
target
adverts at
you paid
Web Page
Layouts -
using
Cascading
Style Sheets
A Simple
Password
Page - I
can't
make
one!!
;!
Free Page
Maker - by
yours truly
Question
About Php
Includes -
How would
you include
a frame
AROUND the
page?
Centering A
Div
Containing
Image. - I
have a logo
I need
centered in
a aujustable
width page
Treating
.csv Files
As Database
Data -
Showing .CSV
data on a
web page
Counting
Variables?
Is It
Possible To
Create A Web
Based Mmo In
Javascript?
- And could
there be
free
movement
without
reloading
the page?
Add A
Javascript
Feedback
Form On Your
Web Page -
This is how
to do it
A New Ptc
Information
Page!
Tricks With
Php
Variables
Envizion'
;s Front
Page
Image Not
Taking The
Right Size
In Web Page
- An image
is correct
when
designed,
but not when
put in a
website
Web Page
Tree Menu:
Style Sheet
- Javascript
Scrolling
Images? -
How to Make
an Image
Scroll With
the Page
Wap Source
Code Viewer
- Mobile/wap
source code
viewer page
Reload This
Page
Geometry
Wars For Pc
[download]
Refresh Page
After Back
Button Hit
Cpanel Demo
Page - for
new
applicants
and guests
Button To
Print
Current Web
Page
How To
Autorefresh
A Page Every
Two Minutes?
Toggle
display in
page script
Php Unique
Hit Counter
- Count page
hits with
php.
<iframe&g
t; Tag - a
page within
a page
Faster Page
Loading... -
Firefox
Browser ONLY
advertisement



Passing Variables Through A Page?



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE