Hi,
Here's my scenario.I need to create a single button which when clicked will enter the currently logged in users name into the database.Can someone help me with this?
Here's my scenario.I need to create a single button which when clicked will enter the currently logged in users name into the database.Can someone help me with this?
Hi aksraj,
Create a form with just a submit button and use the DB Connection to save the user id.
Bob
Create a form with just a submit button and use the DB Connection to save the user id.
Bob
Hi aksraj,
Make a connection to the table where you want to save the data; or if you want a new table use the 'Create Table' icon in the forms manager to to this.
You'll need one hidden field in your form to contain the user id.
Bob
Make a connection to the table where you want to save the data; or if you want a new table use the 'Create Table' icon in the forms manager to to this.
You'll need one hidden field in your form to contain the user id.
Bob
<?php
$user = JFactory::getuser();
?>
<div
<input type="hidden" name="username" value="<?php echo $user; ?>" />
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Register for talk" type="submit" />
</div>
<div class="clear"> </div>
</div>
This is the code i used in the form html.I've done all the table creation and db connection.It doesnt seem to work though.When i click the button the table reads
username : Object
Hi askraj,
A few small changes
Bob
A few small changes
<?php
$user =& JFactory::getUser();
?>
<div
<input type="hidden" name="username" value="<?php echo $user->id; ?>" />
. . .
Bob
This topic is locked and no more replies can be posted.