Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Gryzące się skrypty
mefjiu
post
Post #1





Grupa: Zarejestrowani
Postów: 313
Pomógł: 5
Dołączył: 22.03.2005

Ostrzeżenie: (0%)
-----


Mam taki problem chodzi o stronę http://smsportal.boo.pl !
wstawiłem na stronkę include do logowania jednego ze skrytów i niżej pod nią skrypt subskrypcji i jezeli dodaje np jakiegos emaila to odsyla mnie do strony tego pierwszego skryptu dlaczego sie tak dzieje sprawdzcie sam bo moze to troszkę żle wytlumaczylem ale lepiej nie potrafię (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif)
jezeli chcecie podam kody php do tych skryptó (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif)

Ten post edytował mefjiu 24.04.2005, 22:00:24
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mefjiu
post
Post #2





Grupa: Zarejestrowani
Postów: 313
Pomógł: 5
Dołączył: 22.03.2005

Ostrzeżenie: (0%)
-----


o to kod includa subskrypcji (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif)
Kod
<?php
/*********************************************************************/
/*                             CcMail 1.0                            */
/*  Written by Emanuele Guadagnoli - cicoandcico[at]cicoandcico.com  */
/*      Reference page: http://www.cicoandcico.com/products.php      */
/*                            License: GPL                           */
/*             DO NOT EDIT UNLESS YOU KNOW WHAT YOU'RE DOING         */
/*********************************************************************/

//INCLUDE.php - User interface to Subscribe/Unsubscribe/Modify

include (dirname(__FILE__) . "/config.php");
if (!class_exists('crypto')) include ($functions_dir . "/crypt.php");
if (!function_exists('mail_array')) include ($functions_dir . "/shared.php");

//Retrieving $PHP_SELF;
if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

//Retrieving settings...
include ($settings_dir . "/company_name.ccmail");
include ($settings_dir . "/company_site.ccmail");
include ($settings_dir . "/company_email.ccmail");
include ($settings_dir . "/send_copy_to.ccmail");
include ($settings_dir . "/signature.ccmail");
include ($settings_dir . "/banned_addresses.ccmail");
include ($settings_dir . "/send_copy_to.ccmail");
include ($settings_dir . "/notify_user.ccmail");
include ($settings_dir . "/notify_admin.ccmail");

//Creating folders
if (!is_writable($data_dir)) @chmod ($data_dir, 0755);
if (!@is_dir($addresses_dir)) if (!@mkdir ($addresses_dir)) {
    print "Data directory is not writeable! Chmod it to 775 or 777 to proceed."; exit();};
if (!is_dir($groups_dir)) mkdir ($groups_dir);
if (!is_dir($mails_dir)) mkdir ($mails_dir);
if (!is_writable($addresses_dir)) @chmod ($addresses_dir, 0755);
if (!is_writable($groups_dir)) @chmod ($groups_dir, 0755);
if (!is_writable($mails_dir)) @chmod ($mails_dir, 0755);

//Generating crypt key (first time only)
if (!file_exists($data_dir . "/key.php")) {include ($functions_dir . "/keygen.php"); key_gen($password);}
include ($data_dir . "/key.php"); //retrieving key ($pass)

//Retrieving POST address
$address = "";
if (isset($_GET['address'])) $address = stripslashes(trim($_GET['address']));

//Removing banned addresses
$banned_array = explode(",", $banned_addresses);
$banned_array_trim = array();
foreach ($banned_array as $ban) array_push($banned_array_trim, trim($ban));
if (in_array($address, $banned_array_trim)) {$address = ""; print "<b><div class=\"standard\">You are not allowed to subscribe</div></b>"; }

//Retrieving Groups
$groups = getgroups(true, false);

/*Visualization: if you want to edit CSS styles,
'standard' = standard text
'link' = link
'button' = button
'tbox_max' = input field
*/
print '<table border="0" cellpadding="0" cellspacing="0"><tr><td width="100%"><font face="Verdana" size="2">';

//Default Form
if (!isset($_GET['action']) || $address == "" ||  !validate_email($address))
{
    print "<form method=\"get\" action=\"$PHP_SELF\"><p class=\"right1\">Chcesz być informowany o niusach? Podaj swój email</p>";
    if ($address != "" && !validate_email($address)) echo " <font color=\"red\"><b>Niepoprawny Adres!</b></font>";
    print "
    <input name=\"address\" size=\"14\" value=\"$address\" class=\"tbox_max\">
    <select name=\"action\" class=\"tbox\">
    <option value=\"subscribe\" selected>Wpisz się</option>
    <option value=\"unsubscribe\">Wypisz się</option>";
    if (count($groups) > 1) print "<option value=\"modify\">Modify</option>";
    print "</select><input type=\"submit\" size=\"144\" value=\"Ok\" class=\"button\"><br><br>";

    if (count($groups) > 1)
    {
  print "I'd like to receive informations about:<br>
  <input type=\"checkbox\" name=\"everything\" value=\"everything\" checked>Everything<br>\n";
  $gr_count = 0;
  foreach($groups as $item)
  {
     $gr_count ++;
     print "<input type=\"checkbox\" name=\"group_$gr_count\" value=\"$item\">$item<br>\n";
  }
    }
    print "</form>\n";
}

//Modify existing User
elseif (isset($_GET['action']) && $_GET['action'] == "modify")
{
    $crypt = new Crypto;
    $user = $crypt->encrypt ($pass, $address);
    
    if (file_exists($addresses_dir . "/" .$user)) {
    //apply selected changes
    if (isset($_GET['modify']) && $_GET['modify'] == "yes")
    {
  //retrieves informations about subscribed groups
  $selected_groups = array();
  $gr_count = 0;
  if (isset($_GET['everything']) && $_GET['everything'] == "everything") $selected_groups = $groups; //select everything
  else foreach ($groups as $item)
  {
     $gr_count ++;
     if (isset($_GET["group_" . $gr_count]) && stripslashes(trim($_GET["group_" . $gr_count])) == stripslashes(trim($item))) array_push($selected_groups, $item); //add selected groups
  }
  if (count($selected_groups) == 0) //if none was selected, display unsubscribe choice
  {
     $selected_groups = $groups;
     print "<b>Perhaps you want to <a href=\"$PHP_SELF?address=$address&action=unsubscribe\" class=\"link\">Unsubscribe</a>?</b><br><br>";
  }
  
  //writes groups into file
  $string = ""; foreach ($selected_groups as $item) $string .= $item . "\n"; //create group string
  unlink ($addresses_dir . "/" .$user);
  if (write_to_file($addresses_dir . "/" .$user, $string))
     print "<b>Changes applied! <a class=\"link\" href=\"$PHP_SELF?action=\"><b>Wróć</b></a><br><br></b>";
  else print "<b>Changes not applied! Contact Administrator.<br></b>";
    }
    print "<form method=\"get\" action=\"$PHP_SELF\">
    <input readonly name=\"address\" size=\"20\" value=\"$address\" class=\"tbox_max\">
    <input type=\"hidden\" name=\"action\" value=\"modify\">
    <input type=\"hidden\" name=\"modify\" value=\"yes\">
    <input type=\"submit\" value=\"Ok\" class=\"button\"><br><br>";

    $subscribed_group = get_user_details($pass, $user, false);
    if (count($groups) > 1)
    {
  print "Edit your preferred Groups:<br>
  <input type=\"checkbox\" name=\"everything\" value=\"everything\"";
  if (count($subscribed_group) == 0)  print "checked";
  print ">Everything<br>\n";
  $gr_count = 0;
  foreach($groups as $item)
  {
     $gr_count ++;
     print "<input type=\"checkbox\" name=\"group_$gr_count\" value=\"$item\"";
     if (in_array($item, $subscribed_group)) print "checked";
     print ">$item<br>\n";
  }
    }
    print "</form>\n";
    }
    else print "<b>Nie ma takiego adresu email w naszej bazie</b>"; //User is not subscribed
}

//Unsubscribe User
elseif (isset($_GET['action']) && $_GET['action'] == "unsubscribe")
{
    $crypt = new Crypto;
    $mailto = $address;
    $address = $crypt->encrypt ($pass, $address);
    if (file_exists ($addresses_dir . "/" . $address))
    {
  unlink($addresses_dir . "/" . $address);
  print "<b>Email został usunięty. <a class=\"link\" href=\"$PHP_SELF?action=\">Wróć</a></b><br><br>";
  //Sending notification...
  include ($settings_dir . "/on_unsubscription.ccmail");
  include ($settings_dir . "/notify_message.ccmail");
  if ($notify_user == "YES") mail_array($pass, $mailto, $notify_message, $on_unsubscription, "text", false);
  if ($notify_admin == "YES" && $send_copy_to != "") mail_array($pass, $send_copy_to, $notify_message, "User $mailto unsubscribed from your mailing list.", "text", false);
    }
    else print "<b>Nie ma takiego adresu email w naszej bazie <a class=\"link\" href=\"$PHP_SELF?action=\">wróć</a></b><br><br>";
}

//Subscribe User
elseif (isset($_GET['action']) && $_GET['action'] == "subscribe")
{
    //Retrieving informations about subscribed groups
    $selected_groups = array();
    $gr_count = 0;
    if (isset($_GET['everything']) && $_GET['everything'] == "everything") $selected_groups = $groups; //select everything
    else foreach ($groups as $item)
    {
  $gr_count ++;
  if (isset($_GET["group_" . $gr_count]) && stripslashes(trim($_GET["group_" . $gr_count])) == stripslashes(trim($item))) array_push($selected_groups, $item); //add selected groups
    }
    
    $crypt = new Crypto;
    $user = $crypt->encrypt ($pass, $address);

    if (!file_exists($addresses_dir . "/" .$user) && !file_exists($addresses_dir . "/" .$user . "~--OLD--~"))
    {
  //Save address and subscribed groups
  $string = "";
  foreach ($selected_groups as $item) $string .= $item . "\n"; //create group string
  
  //Write groups into file
  if(write_to_file($addresses_dir . "/" . $user, $string)){
     echo "<b>$address</b> został dodany do naszej bazy";
     if (count($selected_groups) != 0)
     {
    $string = "";
    print " to the following group(s):<br>";
    foreach ($selected_groups as $item) $string .= $item ." - ";
    print (substr($string, 0, strlen($string)-3));
     }
     else print "";
     print "<br><br><center><a class=\"link\" href=\"$PHP_SELF?action=\"><b>Wróć</b></a></center>";
     //Sending notification...
     include ($settings_dir . "/on_subscription.ccmail");
     include ($settings_dir . "/notify_message.ccmail");
     if ($notify_user == "YES") mail_array($pass, $address, $notify_message, $on_subscription, "text", false);
     if ($notify_admin == "YES" && $send_copy_to != "") mail_array($pass, $send_copy_to, $notify_message, "User $address subscribed to your mailing list.", "text", false);
  }
  else print "Could not save subscription! Contact Administrator.";
    }
    elseif (file_exists($addresses_dir . "/" .$user . "~--OLD--~")) print "<b>You have been removed by Administrator.<br>You can't Subscribe.</b>";
    else { print "<b>Email jest już w naszej bazie danych</b><br><br><center>";
    if (count($groups) > 1) print "<a href=\"$PHP_SELF?address=$address&action=modify\" class=\"link\">Modify</a> | ";
    print "<a href=\"$PHP_SELF?address=$address&action=unsubscribe\" class=\"link\">Wypisz się</a></center>"; }
}
print '</div></td></tr></table>';
?>


z tego co wynika to wszystko tu jest niby dobrze (IMG:http://forum.php.pl/style_emoticons/default/exclamation.gif) !
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 16:43