simzam Posted December 23, 2010 Share Posted December 23, 2010 how to echo href id value Thanks ! if (isset($_GET['edit']) && $_GET['edit'] == 'textupdate') { echo " {$_GET['id']} ! <br>" ; } <a href= \"{$_SERVER['PHP_SELF']}?edit=textupdate\" id=\"edit{$row['id']}\" >Edit</a> Link to comment https://forums.phpfreaks.com/topic/222482-echo-href-id/ Share on other sites More sharing options...
solon Posted December 23, 2010 Share Posted December 23, 2010 <?php if (isset($_GET['edit']) && $_GET['edit'] == 'textupdate') { echo '<a href= "'.$_SERVER["PHP_SELF"].'"?edit=textupdate" id="'.$_GET['id'].'" >Edit</a>}'; } ?> Link to comment https://forums.phpfreaks.com/topic/222482-echo-href-id/#findComment-1150727 Share on other sites More sharing options...
simzam Posted December 23, 2010 Author Share Posted December 23, 2010 no actually I'm try to get DIV content to input field when clicked on it i think we need to use some JavaScript here donno how to please help to do when i click EDIT button it should send text to input filed or <textarea> if (isset($_GET['edit']) && $_GET['edit'] == 'textupdate') { here i put input filed or <textarea> that contain text content of div } echo " <div id=\"edit{$row['id']}\"> {$row['title']} </div> <a href= \"{$_SERVER['PHP_SELF']}?edit=textupdate\" id=\"edit{$row['id']}\" >Edit</a><br><br>\n" ; Link to comment https://forums.phpfreaks.com/topic/222482-echo-href-id/#findComment-1150742 Share on other sites More sharing options...
solon Posted December 24, 2010 Share Posted December 24, 2010 From where do you get the value you want to edit? Database? To get the value from your database table you need a query. As soon as you get the value just do this: <textarea><?php echo $value_from_database; ?></textarea> That will show the variable as the text in the text area Link to comment https://forums.phpfreaks.com/topic/222482-echo-href-id/#findComment-1151147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.