cvs: php-hosts-web / host-add.php

From: Date: Thu, 25 Apr 2002 02:58:46 +0000
Subject: cvs: php-hosts-web / host-add.php
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-9850@lists.php.net to get a copy of this message
jimw Wed Apr 24 22:58:46 2002 EDT Modified files: /php-hosts-web host-add.php Log: fix adding of new hosts. Index: php-hosts-web/host-add.php diff -u php-hosts-web/host-add.php:1.8 php-hosts-web/host-add.php:1.9 --- php-hosts-web/host-add.php:1.8 Mon Apr 22 23:15:30 2002 +++ php-hosts-web/host-add.php Wed Apr 24 22:58:46 2002 @@ -16,19 +16,8 @@ if (empty($hostemail)) { $ERRORS[]="Email for company left blank"; } if (empty($useremail)) { $ERRORS[]="Contact Email left blank"; } - if (!get_magic_quotes_gpc()) { - $hostname2 = addslashes($hostname); - $hosturl2 = addslashes($hosturl); - $hostinfourl2 = addslashes($hostinfourl); - $hostemail2 = addslashes($hostemail); - $hostphone2 = addslashes($hostphone); - $hostfax2 = addslashes($hostfax); - $hostcity2 = addslashes($hostcity); - $hoststate2 = addslashes($hoststate); - $useremail2 = addslashes($useremail); - } - $hosturl2 = eregi_replace("^http://","",$hosturl2); - $hostinfourl2 = eregi_replace("^http://","",$hostinfourl2); + $hosturl = eregi_replace("^http://","",$hosturl); + $hostinfourl = eregi_replace("^http://","",$hostinfourl); if ($ERRORS) { echo "We can't add your listing because of the following errors:<BR>"; @@ -40,10 +29,22 @@ echo "Use your browser's back button to correct these errors."; } else { $password = randomstring(8); - $crypt = crypt($password,randomstring(2)); + $crypt = addslashes(crypt($password,randomstring(2))); + + $query = "INSERT INTO hosts SET" + . " HostName='$hostname'," + . " HostURL='$hosturl'," + . " HostInfoURL='$hostinfourl'," + . " HostEmail='$hostemail'," + . " HostPhone='$hostphone'," + . " HostFax='$hostfax'," + . " HostCity='$hostcity'," + . " HostState='$hoststate'," + . " HostCountry='$hostcountry'," + . " contact='$useremail'," + . " password='$crypt'," + . " created=NOW(),lastupdate=NOW()"; - $query = "INSERT INTO hosts (HostName,HostURL,HostInfoURL,HostEmail,HostPhone,HostFax,HostCity,HostState,HostCountry,created,lastupate,contact,password) "; - $query.= "values ('$hostname2','$hosturl2','$hostinfourl2','$hostemail2','$hostphone2','$hostfax2','$hostcity2','$hoststate2','$hostcountry',NOW(),NOW(),'$useremail2','".addslashes($crypt)."')"; $q1 = mysql_query($query) or die ("\"$query\" is a bad query."); $hostid = mysql_insert_id(); @@ -51,15 +52,15 @@ $msg.= "listing of PHP Hosting Companies (at http://hosts.php.net/).\n\n"; $msg.= "To update your listing, go to the \"Clients\" page, with the following "; $msg.= "username and password:\n\n"; - $msg.= "\tUsername: ".stripslashes($useremail2)."\n"; + $msg.= "\tUsername: ".stripslashes($useremail)."\n"; $msg.= "\tPassword: $password\n\n"; $msg.= "If you have any questions, email webmaster@php.net.\n\n"; $from = "From: \"PHP Hosting Listing\" <webmaster@php.net>"; - mail(stripslashes($useremail2),"PHP Hosting Companies Listing",$msg,$from); + mail(stripslashes($useremail),"PHP Hosting Companies Listing",$msg,$from); - echo "<P><B>".htmlentities(stripslashes($hostname2))."</B> has been added to the list of PHP hosting companies.</P>\n"; + echo "<P><B>".htmlentities(stripslashes($hostname))."</B> has been added to the list of PHP hosting companies.</P>\n"; echo "<P>An email has been sent to ".htmlentities(stripslashes($useremail))." with information on how to edit your listing.</P>\n"; } } else {

« previous php.mirrors (#9850) next »