| Index
» Projects
» phpMyEdit
» Forum
» How to Pass Session Value for Default? |
 |
PocketFaith
Joined: 31 Jan 2005
Posts: 2
Posted: 2005-01-31 00:36
Back to top
Reply with quote
|
Here's the deal. I have a hidden field that I want to pass a value to such as $_SESSION[id]. This will ensure that the data the user is entering has the correct key for their account. I've tried everything I can think of but I can't get it to take a variable like $_SESSION[id] or $id or anything else for that matter. Any clue how to do this?
| Code: |
<?php
include_once 'functions.php.inc';
session_start();
$_SESSION[id]=$_SESSION['_amember_user']['member_id'];
$opts['fdd']['id'] = array(
'name' => 'ID',
'select' => 'T',
'maxlen' => 20,
'default' => $_SESSION[id], <---Doesn't work!!!
'required' => true,
'sort' => true,
'options' => H
);
|
|
michal
Joined: 17 Jun 2003
Posts: 537
Location: Slovakia
Posted: 2005-01-31 07:39
Back to top
Reply with quote
|
afaik it should be $_SESSION['id'] rather than $_SESSION[id].
also 'options' => H is not quite correct, it rather should be 'options' => 'HAC' (hidden in Add and Change).
but before trigger is a better choice, at least more secure (like <?php $newvals = $_SESSION['id'] ?>)
|
PocketFaith
Joined: 31 Jan 2005
Posts: 2
Posted: 2005-02-01 04:03
Back to top
Reply with quote
|
Awesome! That worked great. It's doing exactly what I needed.
|
|
Post new topic
Reply to topic
|
|
|
|