Links View all Link Categories
 

SafetyTots International LTD
SafetyTots International LTD Homepage
'0') { echo " Please click on a category to view available links. To add a link, click on the category. and there will be an area to \"add your link.\"

"; for ($i = 0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); $queryr = "select * from links where categories_id = '$row[categories_id]' and linkapproved = '1'"; $resultr = mysql_query($queryr); $totalnumoflinks = mysql_num_rows($resultr); if (($i/2) == floor($i/2)) { $listbgcolor="BGCOLOR=\"#EEEEEE\""; } else { $listbgcolor="BGCOLOR=\"#DEDEDE\""; } echo " "; } echo "
Category Number of Links
$row[name] $totalnumoflinks
"; } else { echo "There are no users with that criteria. Try again

Add Link to $categoryname"; listLinkCategories(); } } function viewlinksincategory() { global $debug, $menu, $action, $action2, $keyword, $SUBMIT, $id, $PHP_SELF,$categories_id, $links_id,$categoryname; categorydetails(); $query = "select * from links where categories_id = '$categories_id' and linkapproved = '1'"; $result = mysql_query($query); $num_results = mysql_num_rows($result); //echo "$debug"; if ($num_results > '0') { echo "

Add Link to $categoryname

"; for ($i = 0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); if (($i/2) == floor($i/2)) { $listbgcolor="BGCOLOR=\"#FFFFFF\""; } else { $listbgcolor="BGCOLOR=\"#DEDEDE\""; } echo " "; } echo "
$categoryname
Link Name Description Contact Email Address
$row[linkname] $row[linkdescription] $row[linkcontactemail]
"; } else { echo "There are no links with that criteria. Try again

Add Link to $categoryname

"; listLinkCategories(); } } function categorydetails() { global $categories_id, $name,$categoryname; $query = "select * from links_categories where categories_id = '$categories_id'"; $result = mysql_query($query); $num_results = mysql_num_rows($result); $row = mysql_fetch_array($result); $categoryname = "$row[name]"; } function addlinkform() { global $categories_id, $categoryname, $contactemail, $url, $PHP_SELF, $links_id,$linkdescription,$linkcontactemail,$linkname,$action2, $linkapprovedchecked,$linkapproved; categorydetails(); echo "Please complete all information to add you link in $categoryname:

URL:

Link Name:

Description:

Contact E-mail Address:


"; } function insertlink() { global $url,$action2, $debug, $url, $linkcontactemail, $linkdescription, $linkname, $categories_id, $links_id, $action2, $SUBMIT, $id, $email, $PHP_SELF,$resellernum,$address,$city,$state,$zip,$country,$taxid,$website,$linkapproved; $badwords = array('viag','levitra','phentermine','tramadol','valium','http:','plaxis','blogger'); foreach($badwords as $variable) { //echo "Variable: $variable

"; if (preg_match ("/$variable/i", "$linkname")) { $linkname = ""; } if (preg_match ("/$variable/i", "$linkdescription")) { $linkdescription = ""; } if (preg_match ("/$variable/i", "$linkcontactemail")) { $linkcontactemail = ""; } } if (!$linkname || !$linkdescription || !$linkcontactemail) { addlinkform(); } else { require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "mailhost.wwwebtek.com"; // specify main and backup server $mail->SMTPAuth = false; // turn on SMTP authentication $mail->From = "pgeo@safetytots.com"; $mail->FromName = "Link Manager"; $mail->AddAddress("$linkcontactemail", "Link Request"); $mail->AddReplyTo("pgeo@safetytots.com", "Link Manager"); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Link Submission for $url"; $mail->Body = "Thank you for submitting your link to Safetytots. We will add your link after review and notification of our link on your web site.

Title: $linkname
Description: $linkdescription
Contact Email: $linkcontactemail

-------------------------------------------------------------------------------------------------------

Please add our link toy your page with the following information:

Link Name: Safetytots International
Description: Award winning, educational child safety aids that teach children how to safely react to everyday situations - CD ROM, flash cards, and more.
Contact Email: pgeo@safetytots.com

Thank you!
Paula Geonie
pgeo@safetytots.com"; $mail->AltBody = "Thank you for submitting your link to Safetytots. We will add your link after review and notification of our link on your web site. Title: $linkname Description: $linkdescription Contact Email: $linkcontactemail ------------------------------------------------------------------------------------------------------- Please add our link toy your page with the following information: Link Name: Safetytots International Description: Award winning, educational child safety aids that teach children how to safely react to everyday situations - CD ROM, flash cards, and more. Contact Email: pgeo@safetytots.com Thank you! Paula Geonie pgeo@safetytots.com"; if(!$mail->Send()) { echo "Message could not be sent.

"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } $mail = new PHPMailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "mailhost.wwwebtek.com"; // specify main and backup server $mail->SMTPAuth = false; // turn on SMTP authentication $mail->From = "linkmanager@safetytots.com"; $mail->FromName = "Link Manager"; $mail->AddAddress("pgeo@safetytots.com", "Link Request"); $mail->AddAddress("jferezy@wwwebtek.com"); // name is optional $mail->AddReplyTo("pgeo@safetytots.com", "Link Manager"); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Link Submission for $url"; $mail->Body = "A new URL has been added to the links site ($linkname - $url)

Go to the Link Administrator to approve."; $mail->AltBody = ""; if(!$mail->Send()) { echo "Message could not be sent.

"; echo "Mailer Error: " . $mail->ErrorInfo; exit; } $query = "insert into links (linkname,linkdescription,linkcontactemail,categories_id,url, linkapproved) values ('$linkname','$linkdescription','$linkcontactemail','$categories_id','$url','0')"; //echo "$query

"; $result = mysql_query($query); echo "$linkname has been added to our database and will be checked for approval..."; $linkname = ""; $url = ""; $linkcontactemail = ""; $linkdescription = ""; addlinkform(); } } ?>