Good Morning -
I figured this out earlier this year. Now, that I need to re-create it - I don't know what I did.
I've placed a button 'Display Template' up by the 'Add New' and 'Delete Selected' buttons.
I want to select one record, click the button, and pass the variables to another script.
I had it where it would run a script: 'process_template.php?template=1&attribute=3".
But now, I don't know where to put the snippet, I'm not sure if the snippet should just redirect to the script - I think I did something different before.
Any help would be appreciated.
Thanks,
Sam
____
Okay, I did find another method that kinda works:
<input type=button value=button1 onclick="window.location.href='tablename.php?parameter={$FieldName_value}';">
instead of the original method:
<INPUT class=button onclick="frmAdmin.a.value='template'; frmAdmin.submit(); return false;" value="Display Template" type=button>
I can't figure out the original snippet to go with the second method. I remember testing to make sure it passed the value 'template', then did something to call 'process_template.php' with the variables. Just can't remember how I accomplished it.
___
I've got:
<INPUT class=button onclick="frmAdmin.a.value='template'; frmAdmin.submit(); return false;" value="Display Template" type=button>
in the html to create a button on the main screen
then in the events - List Page: Before Process - I have:
if(@$_REQUEST["a"]=="template")
if(@$_REQUEST["selection"])
{
foreach(@$_REQUEST["selection"] as $keyblock)
{
$arr=split("&",refine($keyblock));
$keys=array();
$keys["email_id"]=urldecode(@$arr[0]);
$where = KeyWhere($keys);
$rs = CustomQuery("select * from email_control where $where");
$data=db_fetch_array($rs);
$template = $data['email_template'];
$attribute = $data['email_attribute'];
header("Location: process_template.php?template=$template&attribute=$attribute");
But I'm still not getting it to work!
When I click the button (and force it to change from Post to Get) it returns:
email_control_list.php?a=template&selection[]=11
so it's passing the template and the correct id for the selection, but it's returning to email_control_list.php not process_template.php
I'll look some more - and hey, thanks for everybody's assistance.