Jump to content

[SOLVED] Warning


dare87

Recommended Posts

I have a page that I press the "Delete" button that then triggers this code

 

<?php
// Include the PHP script that contains the session information.
include('../includes/session_admin.php');

// Get the user id from the URL.
$bid = $_GET['bid'];

// Connect to the database.
require_once ('../../../datemysql_connect.php');

// Set up the query.
$query = "DELETE FROM listing WHERE b_id=$bid";

// Run the query.
$results = @mysql_query ($query);

// Reload the page.
$url = '../b_review.php';
header("Location: $url");

?>

 

Is there a way to add a Warning.. so that if I click it it will popup(if pos) and say... ARE YOU SURE... or something like that..

 

or would there be a better way to do it?

 

Thanks

Link to comment
Share on other sites

no... I am having a problem getting it to work with my code.... When I put the code in it will no longer display the page

 

<?php
				// Fetch and print all the records.

				$bg = '#dee4ed'; // Set the background color.

				while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
				{
					// Alternate the background color.
					$bg = ($bg == '#dee4ed' ? '#ffffff' : '#dee4ed');

					echo '  <tr bgcolor="' . $bg . '">
								<td align="left"><a href="b_edit.php?bname=' . $row['bname'] . '&city=' . $row['city'] . '&bid=' . $row['bid'] . '">Edit</a></td>
								<td align="left"><a href="auxiliary/b_delete.php?bid=' . $row['bid'] . '" onclick="javascript: var x= confirm('Are you sure!'); if (x==false){return false;}"/>Delete</a></td>
								<td align="left">' . $row['bname'] . '</td>
								<td align="left">' . $row['city'] . '</td>
								<td align="left">' . $row['date'] . '</td>
							</tr>';							
				}

				// Close the table.
				echo '</table>';
?>

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.