captain_scarlet87 Posted April 23, 2010 Share Posted April 23, 2010 Hi, I need help trying to add the two buttons to another page: echo ("<td> <input type='button' onClick=\"window.location='edit_form_instructions.php?id={$row['instructions_id']}';\" value='Edit' /></td>"); echo ("<td> <input type='button' style='color: red' onClick=\"window.location='delete_instructions.php?id={$row['instructions_id']}';\" value='Delete' /></td></tr></table>");} This is the page they need to be added to: <?php # Script 13.8 - search_results(admin).php // This is the login page for the site. // Include the configuration file for error management and such. require_once ('./includes/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Search Results'; include ('./includes/header.html'); ?> <h1>View Instructions</h1> <?php // TAKE THE INFORMATION FROM FORM. $search = $_GET['search']; // IF THERE IS NOT A KEYWORD GIVE A MISTAKE. if (!$search) echo "You didn't enter a keyword"; else { echo "<fieldset><td>You searched for: <strong>$search </strong></td>"; require_once ('../mysql_connect.php'); // Connect to the database. //QUERY IS THE CODE WHICH WILL MAKE THE SEARCH IN YOUR DATABASE. //I WROTE AN EXPLANATION ABOUT IT AFTER THE CODE. $query="SELECT * FROM uploaded_instructions WHERE ( title) LIKE('%$search%')"; $result1 = MySQL_query($query); if(!$result1) { echo MySQL_error()."<br>$query<br>"; } if(MySQL_num_rows($result1) > 0) { echo "<table width='750' align='center' border='0' cellspacing='0' cellpadding='0'>"; while($result2 = MySQL_fetch_array($result1)) { echo '<br><tr><td><strong><a href="view_instructions.php?instructions_id='.$result2['instructions_id'].'">'.$result2['title'].'</strong></td></tr>'; } echo "</table></fieldset"; }else { echo "No Results were found in this category.<br>"; }echo "<br>"; } include ('./includes/footer.html'); ?> I need them echoed alongside the view_instructions a href already there. I've tried myself however the buttons don't seem to appear there at all whether working or not. Please help if you can. Thanks. Link to comment https://forums.phpfreaks.com/topic/199498-help-echoing/ Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 Store it in a variable and then echo it. Link to comment https://forums.phpfreaks.com/topic/199498-help-echoing/#findComment-1047037 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.