This is a discussion on How to use session variable within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, Total PHP newbie here. I'm trying to use PHP 4.3.6 in Dreamweaver MX, and I want ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
Total PHP newbie here. I'm trying to use PHP 4.3.6 in Dreamweaver MX, and I want to make a login form that has a drop down. The value that the user selects prior to hitting the submit button, should be saved in a session variable, and displayed on the following pages. Could someone please explain in a simple manner (if that is possible) how I can acheive that using Dreamweaver? TIA, Jakob |
|
|||
|
Jakob Rohde wrote:
> I'm trying to use PHP 4.3.6 in Dreamweaver MX, and I want to make a > login form that has a drop down. The value that the user selects > prior to hitting the submit button, should be saved in a session > variable, and displayed on the following pages. > > Could someone please explain in a simple manner (if that is possible) > how I can acheive that using Dreamweaver? > I have no experience with DW, but here's an example: <? if (isset($_POST['choice'])) { // Start session support session_start(); // Set the session var $_SESSION['choice'] = $_POST['choice']; // Redirect to a following page header("Location: next.php"); } ?> <form method="post"> <select name="choice"> <option>A</option> <option>B</option> <option>C</option> </select> <input type="submit" /> </form> And on next.php: <? session_start(); $choice = $_SESSION['choice']; // etcetera... ?> JW |
|
|||
|
Jakob Rohde wrote:
> Hi, > > Total PHP newbie here. > > I'm trying to use PHP 4.3.6 in Dreamweaver MX, and I want to make a login > form that has a drop down. The value that the user selects prior to hitting > the submit button, should be saved in a session variable, and displayed on > the following pages. > > Could someone please explain in a simple manner (if that is possible) how I > can acheive that using Dreamweaver? > > TIA, > > Jakob > > I don't know what the stance is on linking webpages in this newsgroup so I'm sorry if it's against the rules. Here is a link to a pretty decent Session intro. http://www.phpfreaks.com/tutorials/41/0.php |
![]() |
| Thread Tools | |
| Display Modes | |
|
|