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
https://forums.phpfreaks.com/topic/64323-solved-warning/
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
https://forums.phpfreaks.com/topic/64323-solved-warning/#findComment-320781
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.