Jump to content

Help echoing


captain_scarlet87

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.