This topic is locked

Button to add data from one table fields to others table fields

4/25/2008 7:18:31 PM
PHPRunner General questions
L
luck author

Hi,
I have to create a table for some events with 6 fields and a button for buy. 2 fields are Title and Price. The table is available for all because i added a guest permission from security tab. When someone click the button buy for a specify event i want to send him to another table where he can input their data, like first name, address, phone and in this table i want to have also the same 2 fields Title and Price with data from the first table for the event that he want to buy, autocompleted. How can i do to automaticaly have in this 2 fields the data specify for the event?
The events are input from an administrator account and guests have only the permission to see and buy this events with this button.
Thank you in advance!

J
Jane 4/28/2008

Hi,
use After record added event on the Events tab for this purpose.

Here is a sample:

//redirect to another page

header("Location: Table2_add.php?title=".$values["Title"]."&price=".$values["Price"]."");

exit();


Then check these URL parameters in the Add page: Before process event for Table2, save it in the $_SESSION variables and use as default values on the "Edit as" settings dialog on the Visual Editor tab.

L
luck author 5/1/2008

Hi,

use After record added[b] event on the [b]Events tab for this purpose.

Here is a sample:
Then check these URL parameters in the Add page: Before process event for Table2, save it in the $_SESSION variables and use as default values on the "Edit as" settings dialog on the Visual Editor tab.


Hi,
I need something like this but i want to make it from the visual editor. When i click the button 'BUY' i need to redirect to second table where the 2 fields Title and Price is autocompleted. But in the visual editor to get to second table i put for the button onclick="window.location.href='table2.php '. How to add this 2 fields values to this button?
Thank you in advance!

J
Jane 5/5/2008

Hi,
try to use smarty variables in your URL on the Visual Editor tab.

It's difficult to recommend you code without seeing actual files.