cvs: php-hosts-web / host-del.php /clients host-del.php

From: Date: Tue, 23 Apr 2002 04:25:39 +0000
Subject: cvs: php-hosts-web / host-del.php /clients host-del.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-9803@lists.php.net to get a copy of this message
jimw Tue Apr 23 00:25:39 2002 EDT Added files: /php-hosts-web host-del.php Removed files: /php-hosts-web/clients host-del.php Log: page to delete host Index: php-hosts-web/host-del.php +++ php-hosts-web/host-del.php <?php require 'shared.inc'; $hostid = (int)$hostid; /* just bounce requests with no hostid. */ if (!$hostid) { header("Location: /"); exit; } $user = verify_host_login(); if ($user != $hostid && !verify_staff_login()) { commonHeader("Not Authorized"); ?> <div class="errors">You are either not logged in as a staff member (someone with a PHP CVS account) or as the contact for this hosting company. Please <a href="login.php">log in</a> here to be able to delete the information about this hosting company.</div> <?php commonFooter(); exit; } /* get information about the host */ $query = "SELECT * FROM hosts WHERE HostId = $hostid"; $res = mysql_query($query) or die("query failed: ".mysql_query()); $host = mysql_fetch_assoc($res); if ($MODE=="DELETE") { $query = "DELETE FROM hosts WHERE HostID = $hostid"; $q1 = mysql_query($query) or die ("\"$query\" is a bad query."); $query = "DELETE FROM host_services WHERE HostId = $hostid"; $q1 = mysql_query($query) or die ("\"$query\" is a bad query."); $query = "DELETE FROM msgboard_msgs WHERE subgroup = $hostid"; $q1 = mysql_query($query) or die ("\"$query\" is a bad query."); if ($user == $hostid) { mail($host['contact'], "Record for $host[HostName] deleted", "The record for $host[HostName] was deleted at http://hosts.php.net/ (by someone who had logged in using the correct password). If you wish to still have your hosting company listed at the site, you'll have to re-register.","From: PHP Hosting Webmaster <webmaster@php.net>"); # TODO: append old site info } setcookie("HOSTID","",88701840); # date in the past to expire cookie commonHeader("Listing Deleted: ".htmlentities($host['HostName']));?> <div class="thanks">The entry for <em><?php echo htmlspecialchars($host['HostName']);?></em> has been deleted.</div> <?php commonFooter(); exit; } commonHeader("Delete Listing: ".htmlentities($host['HostName'])); ?> <div class="errors"> <strong>WARNING:</strong> You are about to delete all information about <em>"<?php echo htmlentities($host["HostName"]);?>"</em> from the directory. </div> <form method="post" action="<?php echo $PHP_SELF?>"> <table border="0" cellspacing="0" cellpadding="5"> <tr valign="top" class="header"> <th colspan="2">Company Information</th> </tr> <tr class="even"> <th align="right">Company:</th> <td><?php echo htmlspecialchars($host['HostName']);?></td> </tr> <tr class="odd"> <th align="right">URL:</th> <td><?php echo htmlspecialchars($host['HostURL']);?></td> </tr> <tr class="odd"> <th align="right">Contact:</th> <td><?php echo htmlspecialchars($host['contact']);?></td> </tr> <tr> <td align="center" colspan="2"> <input type="hidden" name="MODE" value="DELETE" /> <input type="hidden" name="hostid" value="<?php echo $hostid;?>" /> <input type="submit" value="Delete Entry" /> </td> </tr> </table> </form> <? commonFooter(); ?>

« previous php.mirrors (#9803) next »