#!/usr/bin/perl $topsites_php_url = "http://www.you.com/topsites"; use CGI qw/:standard/; $q = new CGI; %form = map { $_ => $q->param($_) } $q->param; if ($form{action} eq "button" && $form{id} >= 1) { print "Location: $topsites_php_url/button.php?id=$form{id}nn"; } elsif ($form{action} eq "in" && $form{id} >= 1) { print "Location: $topsites_php_url/in.php?id=$form{id}nn"; } else { print "Location: $topsites_php_url/index.phpnn"; }

Devam

Execute("SELECT id, password, url, title, description, category, urlbanner, email FROM ".$CONFIG['sql_prefix']."_members WHERE id = ".$FORM['id']." LIMIT 1"); list($TMPL['id'], $password, $TMPL['url'], $TMPL['title'], $TMPL['description'], $TMPL['cat'], $TMPL['urlbanner'], $TMPL['email']) = $db->FetchArray($result); $TMPL['catselect'] = ""; $FORM['password'] = md5($FORM['password']); if ($FORM['password'] == $password) { $TMPL['content'] = do_template("edit_form2"); } else { $TMPL['content'] = $LNG['edit_error']."

n".$LNG['edit_error_id_password']; } } elseif ($FORM['do'] == "submit") { $result = $db->Execute("SELECT password FROM ".$CONFIG['sql_prefix']."_members WHERE id = ".$FORM['id']." LIMIT 1"); list($password) = $db->FetchArray($result); $FORM['password'] = md5($FORM['password']); if ($FORM['password'] == $password) { if (!preg_match("/http/", $FORM['url'])) { $error_url = 1; } if (!preg_match("/.+@.+.w+/", $FORM['email'])) { $error_email = 1; } if (!$FORM['title']) { $error_title = 1; } if ($FORM['urlbanner'] == '' || $FORM['urlbanner'] == "http://") { $FORM['urlbanner'] = $CONFIG['defbanner']; } elseif ($CONFIG['max_banner_width'] && $CONFIG['max_banner_height']) { $size = @getimagesize($FORM['urlbanner']); if ($size[0] > $CONFIG['max_banner_width'] || $size[1] > $CONFIG['max_banner_height']) { $error_urlbanner = 1; } if (!$size[0] && !$size[1]) { $error_urlbanner = 1; } } if ($error_url || $error_email || $error_title || $error_urlbanner) { $TMPL['content'] .= $LNG['edit_error']."

n"; $TMPL['content'] .= $LNG['edit_error_forgot']."
n"; if ($error_url) { $TMPL['content'] .= $LNG['edit_error_url']."
"; } if ($error_email) { $TMPL['content'] .= $LNG['edit_error_email']."
"; } if ($error_title) { $TMPL['content'] .= $LNG['edit_error_title']."
"; } if ($error_password) { $TMPL['content'] .= $LNG['edit_error_password']."
"; } if ($error_urlbanner) { $TMPL['content'] .= $LNG['join_error_urlbanner']." ".$CONFIG['max_banner_width']."x".$CONFIG['max_banner_height']."
"; } $TMPL['content'] .= "
".$LNG['edit_error_back']; } else { $TMPL['id'] = $FORM['id']; $TMPL['url'] = $FORM['url']; $TMPL['title'] = $FORM['title']; $TMPL['description'] = $FORM['description']; $TMPL['cat'] = $FORM['cat']; $TMPL['urlbanner'] = $FORM['urlbanner']; $TMPL['email'] = $FORM['email']; $db->Execute("UPDATE ".$CONFIG['sql_prefix']."_members SET url = '".$TMPL['url']."', title = '".$TMPL['title']."', description = '".$TMPL['description']."', category = '".$TMPL['cat']."', urlbanner = '".$TMPL['urlbanner']."', email = '".$TMPL['email']."' WHERE id = ".$TMPL['id']." AND password = '".$FORM['password']."'"); $TMPL['content'] = $LNG['edit_success']."

n".$LNG['edit_info_edited']; } } else { $TMPL['content'] = $LNG['edit_error']."

n".$LNG['edit_error_id_password']; } } else { $TMPL['content'] = $LNG['edit_error']."

n".$LNG['edit_error_id_password']; } ?>