View Single Post
Old 10-01-2012, 07:50 PM   PM User | #9
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,162
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Quote:
Originally Posted by stevenmw View Post
Oh, no you can't use PHP variables in html input fields.
Well...strictly speaking, that's true.

But you CAN achieve the effect easily enough:
Code:
<?php
$user = JFactory::getUser();
$ses_id = $user->get('id');
?>
<form action="search.php" method="POST">
    <input type="text" name="query" />
    <input type="hidden" name="sesid" value="<?php echo $ses_id;?>" />
    <input type="submit" value="Search" />
</form>
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote