Jump to content
php.lv forumi

jaunumu newsletters


zora

Recommended Posts

Sveiki, visiem. Leenaa garaa buros pa php pasauli un esmu veel galiigs cainiks - tas taa paskritikai...

bet nu gribas savu weblapu padariit daudz maz dinamiskaaku. Vot, nu esmu ieintgreejis tagad jaunumu newsletteru, skriptyu neemu no hotscripts.com. Skripts darbojas uz msql.

Probleema: ja enkodingu noraadu windows-1257, uz apollo.lv, tvnet.lv registreetiem e-pastiem zina nonaak ok, uz inbox.lv latviešu fontu vietaa atnaaak keburi.

Ja lieku utf-8, tad ir ok uz inbox, apollo, toties uz tvnet, one, latviešu fontu vietaa atnaak keburi....

Ja kaadam ir idejas kaapeec taa ( es skatos, ka sajaas e-pasta lapaas izmantots dazaads encodings, var buut tas ir pie vainas), varu ieposteet pasu kodu.

 

Jau ieprieks paldies

Link to comment
Share on other sites

Vienkāršākais risinājums - taisi pārbaudi e-mailam, un pēc tā izvēlies kādu kodējumu norādīt.

 

if (preg_match('/(@tvnet\.lv)|(@apollo\.lv)$/i', $email)) {
$enc = 'win...';
} else {
$enc = 'utf8';
}

 

Ceru, ka nenokļūdījos ar regexpu.

Link to comment
Share on other sites

Paldies. tad es sitaadu paarbaudi varu ievietot kodaa? Moska vareetu noraadiit kur tiesi mantas buutu jaaievieto...

Kods:

<?php

$version = "1.16";

require("settings.php");

require($languageFile);

 

mysql_connect($databaseHost, $databaseUsername, $databasePassword);

mysql_select_db($databaseName);

 

$uniktId = uniqid("pl");

$ekstraHeadere = "X-Mailer: Postlister $version";

 

function sidehoved($titel = "", $menu = 1) {

if (!$titel) $titel = "Postlister";

else $titel = "Postlister | $titel";

 

$aStyle = "text-decoration: none; color: white";

$adskiller = "    |    ";

 

echo "<html><head><title>Jaunumu listes admins</title>\n";

echo "<style type=text/css><!--\n";

echo "body, div {font-family: Tahoma; Arial; helvetica; }\n";

echo "td { font-family: Tahoma; Arial; helvetica; font-size: 8pt }\n";

echo "td.menu { background: black; color: white }\n";

echo "td.tilmelding { background: #E4E6D9; color: #333333 }\n";

echo "--></style>\n";

echo "</head>\n\n\n\n";

 

echo "<body marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>\n";

 

if ($menu != 0) {

echo "<table width=100% border=0 cellspacing=0 cellpadding=5>\n";

echo "<tr><td class=menu>\n";

echo "<center>\n";

 

echo "<a href=\"index111.php\" style=\"$aStyle\">$GLOBALS[s2]</a>\n";

echo "$adskiller\n";

echo "<a href=\"subscribers.php\" style=\"$aStyle\">$GLOBALS[s3]</a>\n";

echo "$adskiller\n";

echo "<a href=\"import.php\" style=\"$aStyle\">$GLOBALS[s105]</a>\n";

echo "$adskiller\n";

echo "<a href=\"edit.php\" style=\"$aStyle\">$GLOBALS[s4]</a>\n";

echo "$adskiller\n";

echo "<a href=\"lists.php\" style=\"$aStyle\">$GLOBALS[s5]</a>\n";

echo "$adskiller\n";

echo "<a href=\"README.html\" style=\"$aStyle\">$GLOBALS[s1]</a>\n";

 

echo "</center>\n";

echo "</td></tr>\n";

echo "</table>\n";

}

echo "<div style=\"margin: 15px\">\n\n";

}

 

 

 

function sidefod() {

echo "</div>\n";

echo "</body></html>";

}

 

 

 

function fejl($fejlbesked = "") {

echo "<h3>$GLOBALS[s8]</h3>\n";

echo "$fejlbesked\n";

echo "<form><input type=button value=\"<<< $GLOBALS[s9]\" onClick=history.back()></form>\n";

echo "</div>\n";

echo "</body></html>";

exit;

}

 

 

function vaelgListe($fil) {

if (!$GLOBALS[liste]) {

echo "<h3>$GLOBALS[s12]</h3>\n";

echo "<form action=\"$fil\" method=get>\n";

 

$kommando = mysql_query("select liste from $GLOBALS[mainTable]");

$antalRaekker = mysql_num_rows($kommando);

 

if ($antalRaekker == 0) {

# "There are no lists":

echo "$GLOBALS[s14]\n";

}

else {

echo "<select name=liste>\n";

 

while ($resultat = mysql_fetch_array($kommando)) {

echo "<option value=\"$resultat[liste]\">$resultat[liste]\n";

}

 

echo "</select>\n";

echo "<input type=submit value=\"$GLOBALS[s13]\">\n";

}

 

echo "</div>\n";

echo "</body></html>";

 

exit;

}

}

?>

Link to comment
Share on other sites

×
×
  • Create New...