| Index
» Projekty
» phpMyEdit
» Fórum
» Echo on Session Variable not Posting |
 |
twhit67
Založený: 03.02.2010
Príspevky: 16
Zaslal: 2010-03-02 22:25
Návrat hore
Odpovedať s citátom
|
Can someone help with my php problem?
My data is called to form via Filter;
$opts['filters'] = "Name = '{$_SESSION['SESS_LOGIN']}'";
I then tried echoing the session login to form via php;
Form field:
$opts['fdd']['NAME']= array(
'name' => 'NAME',
'select' => 'H',
'php' => 'name.php',
'sort' => false
);
--------------
Name.php
<?php
require_once('auth.php');
echo $_SESSION['SESS_LOGIN'];
?>
Although the session does echo it will not post to database; Im uncertain how to proceed from here.
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2010-03-03 15:33
Návrat hore
Odpovedať s citátom
|
If you are concerned about associating new records with the logged-in user adds, then something like this:
| Kód: |
$opts['fdd']['NAME'] = array(
'default' => empty($_SESSION['SESS_LOGIN']) ? $_SERVER['REMOTE_ADDR'] : $_SESSION['SESS_LOGIN'],
'input' => '',
'name' => 'NAME',
'options' => 'ACPVDFL',
'select' => 'T',
'sqlw' => 'TRIM("$val_as")'
); |
You can also overwrite the NAME field:
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.cgi-variables.html#AEN675
|
twhit67
Založený: 03.02.2010
Príspevky: 16
Zaslal: 2010-03-03 18:12
Návrat hore
Odpovedať s citátom
|
Doug, thanks a lot - that did the trick. I'll be reading up on the link you attached.
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2010-03-03 18:19
Návrat hore
Odpovedať s citátom
|
Here's a related example from a script using a numeric $_SESSION['sess_user_level'] to modify settings.
| Kód: |
switch($_SESSION['sess_user_level'])
{
Case 9:
$opts['cgi']['append']['PME_sys_fl'] = 1;
$opts['filters'] = 'PMEtable0.deleted = "0"';
$opts['inc'] = 20;
$opts['options'] = 'ACPVDFL';
break;
Case 7:
$opts['cgi']['append']['PME_sys_fl'] = 1;
$opts['filters'] = 'PMEtable0.deleted = "0" AND PMEtable0.forum_id < "220"';
$opts['inc'] = 40;
$opts['options'] = 'ACPVDFL';
break;
Case 0:
default:
$opts['filters'] = 'PMEtable0.deleted = "0"';
$opts['inc'] = 40;
$opts['options'] = 'VL';
break;
} |
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|