Jump to content
php.lv forumi

hEiti

Reģistrētie lietotāji
  • Posts

    128
  • Joined

  • Last visited

Everything posted by hEiti

  1. hEiti

    sessions

    <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: error.php"); exit(); } ?> <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { echo "neizdevas"; exit(); } ?>
  2. hEiti

    sessions

    <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: error.php"); exit(); } ?> sheit ja nav ielogojies parmet uz error.php, ka lai panaku kad nedirekto bet tur pat parada kad neizdevas pieslegties? meginaju echo "neizdevas pieslegties"; bet tad lapa nestrada vnk blanks un neielade saturu :(
  3. index.php?lapa=admin .. ir admina panelis.. bet kad es lietoju direktorija/fails.php tad vinsh pirms ielaiz prasa paroli.. bet kad lietoju index.php?lapa=admin kur faila switch.php ir defineta includi vinsh bez logina prasishanas ielaiz admina paneli kas par vainu.. vai vajadzigi kodi.. ??? <?php //initialize the session if (!isset($_SESSION)) { session_start(); } // ** Logout the current user. ** $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true"; if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){ $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){ //to fully log out a visitor we need to clear the session varialbles $_SESSION['MM_Username'] = NULL; $_SESSION['MM_UserGroup'] = NULL; $_SESSION['PrevUrl'] = NULL; unset($_SESSION['MM_Username']); unset($_SESSION['MM_UserGroup']); unset($_SESSION['PrevUrl']); $logoutGoTo = "login.php"; if ($logoutGoTo) { header("Location: $logoutGoTo"); exit; } } ?> <?php if (!isset($_SESSION)) { session_start(); } $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && true) { $isValid = true; } } return $isValid; } $MM_restrictGoTo = "login.php"; if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) { $MM_qsChar = "?"; $MM_referrer = $_SERVER['PHP_SELF']; if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&"; if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) $MM_referrer .= "?" . $QUERY_STRING; $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer); header("Location: ". $MM_restrictGoTo); } ?>
  4. hEiti

    par linkiem

    andrisp Liels paldies skatos tu man ka paligs.. uz vieiem jautajumiem pagaidam esi izpalidzejis ;) zhetons tev un cepums ari ;)
  5. hEiti

    par linkiem

    Paldies problema atrisinajas :)
  6. hEiti

    sesions

    session_start(); if(isset($_SESSION['allow'])) $_SESSION['allow']=1; echo "<br><a href=\"news/{$lang}/read_more.php?newsid=$myrow[newsid]\">Read More...</a> || <a href=\"news/{$lang}/edit_news.php?newsid=$myrow[newsid]\">Edit</a> || <a href=\"news/{$lang}/delete_news.php?newsid=$myrow[newsid]\">Delete</a><br><hr>"; } else echo "Views=". $_SESSION['views']; echo "<br><a href=\"news/{$lang}/read_more.php?newsid=$myrow[newsid]\">Read More...</a>"; }//end of loop Ideja shim ir sekojosha kad logina ielogojoties pieskjir vertibu 1 ja ne tad 0 bet sheit news lapa ja lietotajam sesija ir 1 tad vinsh var edit un delite bet ja 0 tad var tikai read more .. sakiet kur man te sakas kljudainiba un nedarbiga zona... Kods no logina daljas //Login Successful session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID']=$member['member_id']; $_SESSION['ses_login']['id'] = $object->id; $_SESSION['ses_login']['usergroup'] = $object->usergroup; $_SESSION['allow']=1; session_write_close(); header("location: index.php?lapa=admin_suc"); exit(); }else { //Login failed $_SESSION['allow']=2; header("location: login-failed.php"); exit(); ceru kad kodi nav par garu priex shejienes :)
  7. hEiti

    mainigais

    liels paldies ta vareji normali paskaidrot un paradit ne jau man shobrid vajag lai tu mana vieta uztaisit es centos saprast bet vnk nav ta fishka uz shadam lietam.. vairak censhos uz realo sistemas izdomu iziet bet paldies 2x.. tiesham palidzeji.
  8. hEiti

    mainigais

    es te galvu sakjeris sezu biroja jau ~40 min un domaju ,.. taka davay bez ironijas un parakajam pargudriban vnk skaidri un gaishi pasaki ko vajag izmainit lai tur kkas ripotu uz priexu..
  9. hEiti

    mainigais

    nu man ir eng_raksts, lv_raksts un pareja gara pentere :)
  10. hEiti

    mainigais

    pie form action ir insert.php nuu ja itka es ielieku taja starpa $sql="INSERT INTO "$_POST['valoda']" (virsraksts, teksts) bet tik un ta kad spiezu post pogu vinsh paliek pie balta ekrana nevis padod zinju kad 1 rec ievietots .. :(
  11. hEiti

    mainigais

    Salasijos pa $_GET bet tik un ta sezu domaju nevar izprast to veidu ka es vinju sheit varu iexa iemest jo itka pec butibas vinjam vertipu pieskjir formas.php bet norade par db ir faila insert.php .. varbut vari kko uz dzivas adas paradit? jo tiesham nevar saprast shito lietu.. galu gala man ir padoma sataiist news sistem kas rakstus nem atkarigi no valodas kas izveleta lapa.. <?php if (valoda = 'lv') { $tabula = 'l_raksts'; } elseif (valoda = 'eng') { $tabula = 'eng_raksts' } elseif (valoda = 'esp') { $tabula = 'esp_raksts' } elseif (valoda = 'fr') { $tabula = 'fra_raksts' } elseif (valoda = 'de') { $tabula = 'de_raksts' } elseif (valoda = 'ru') { $tabula = 'ru_raksts' } $con = mysql_connect("","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("", $con); $sql="INSERT INTO ?????? (virsraksts, teksts) VALUES ('$_POST[virsraksts]','$_POST[teksts]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?>
  12. hEiti

    mainigais

    isti nesanak tikt gala .. html dalja forma ir : <select name="valoda"> <option value="eng">Eng</option> <option>Rus</option> <option value="lv">Lat</option> <option>Esp</option> <option>Por</option> <option>Fra</option> </select> bet php dalja ka tu teici : <?php if (valoda = "lv") { $tabula = 'lv_raksts'; } elseif (valoda = "eng") { $tabula = 'eng_raksts' $con = mysql_connect("...","...","..."); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("baltrotors", $con); $sql="INSERT INTO ".$tabula." (virsraksts, teksts)
  13. hEiti

    mainigais

    $sql="INSERT INTO raksts (virsraksts, teksts, ) Ideja tada .. html menucis ar idejisku eng un lv ja lietotajs izvelas eng tad pirms raksts tiek pielikts eng_raksts, bet ja lv tad lv_raksts un pec izveleta tekstu ko raxta feeldos raxta db atkarigaja db.. ceru kad domu saprata. Dodat kadu padomu
  14. hEiti

    problema

    skrijn shoots neatbilst patiesibai jo ir photo zopots bet reali tas baltais laukums ir reizes 2x lielaks :(
  15. hEiti

    problema

    amm ka papeti menjucis ir augsheja dalja bet patshas zinjas iet leja (sadface)
  16. hEiti

    problema

    http://www.largegame.lv/lg/index.php?optio...ask=userProfile atverot redzams kad modulis sadalas divas dalas .. pirma ideja bija kad modulis vainigs bet ne jo pameginajus citus un citi modulji strada cik lasiju forumos arzemju tad vaina esot css faila bet nekadigi nespeju atrast ... Ceru kad atradisies kads kas vares palidzet (sadface) /* @group Main */ html { height: 100%; margin-top: 1px; } body { margin: 0; padding: 0; } p { margin-top: 10px; margin-top: 15px; } h1, h2, h3, h4, h4, h5, h6 { padding-top: 5px; margin: 15px 0; } fieldset { border: 0; padding: 5px 0; } /* @group Fonts */ /* @group Sizes */ body.f-smaller { font-size: 10px; } body.f-default { font-size: 10px; } body.f-larger { font-size: 15px; } h1,h2,h3,h4 { font-family: Helvetica, Arial, sans-serif; } h1 { font-size: 100%; /* color: see style css */ } h2 { font-size: 100%; /* color: see style css */ } h3 { font-size: 100%; } h4 { font-size: 100%; } h5 { font-size: 100%; font-style: italic; } .small, .modifydate, .createdate, div.mosimage_caption { font-size: 95%; /* color: see style css */ } #nav a, #tabmenu a, #nav-main a, #nav-sub a, .moduletable h3, .module h3, .module-hilite1 h3, .module-hilite2 h3, .module-hilite3 h3, .module-hilite4 h3, #vert-menu a, a.mainlevel, a.sublevel, .componentheading { font-size: 92%; font-family: Helvetica, Arial, sans-serif; text-transform: uppercase; font-weight: bold; } .componentheading { /* color: see style css */ margin-top: 15px; } td.componentheading { padding-top: 15px; } /* @end */ /* @group Family */ body { line-height: 125%; font-family: Lucida Grande, Helvetica, Arial, sans-serif; /* color: see style css */ } .contentheading { font-family: Arial Narrow, Helvetica, sans-serif; font-size: 140%; font-weight: bold; /* see style css */ } a:link, a:visited { text-decoration: none; /* color: see style css */ } a:hover { text-decoration: underline; /* color: see style css */ } /* @end */ /* @end */ /* @end */ /* @group Custom */ /* @group accessibility */ /* accessibility stuff */ #access span { background-repeat: no-repeat; } #access a { text-decoration: none; } #access #buttons { float: right; } #access .button { display: block; float: right; width: 38px; height: 18px; margin-left: 1px; background-repeat: no-repeat; cursor: pointer; } /* @end */ /* @group layout */ #page-bg { height: 100%; padding: 0; margin-top: 1px; /* background: see style css */ } /***************************************************** * CHANGE WIDTH SETTINGS HERE * * To change the width of this template just edit this * div#wrapper element. * * Fixed - just chagne the width to your desired width * Fluid - remove the width element completely * *****************************************************/ div#wrapper { width: 1000px; margin: 0 auto; position: relative; } #mainbody #header { /* background: see style css */ width: 100%; position: relative; height: 142px; } .suckerfish #mainbody #header { /* background: see style css */ height: 151px; } #header #access { position: absolute; left: 300px; top: 6px; width: 150px; height: 21px; border: 0; } #header #tabmenu { position: absolute; right: 30px; top: 3px; width: 400px; height: 30px; } #header #nav-main ul { padding-top: 82px; } #header #logo { position: absolute; left: 35px; top: 38px; width: 150px; height: 85px; } #header #search { position: absolute; left: 55px; top: 0px; width: 230px; height: 32px; } #header #nav-main { height: 74px; padding-top: 42px; margin-right: 23px; margin-left: 214px; } #header #nav-main.splitmenu2 { height: 116px; padding: 0; margin-right: 23px; margin-left: 214px; } #header #nav-sub { margin-right: 23px; margin-left: 214px; } .border-pad { margin-left: 5px; margin-right: 5px; padding: 0 1px; } .border-top { padding-top: 1px; } #content-bg { margin-left:15px; margin-right: 15px; } #showcase { padding: 5px 7px 0 7px; } .usermodule { float: left; } #fakecolumn2 { } #fakecolumn1.sc_0 { border-left: 0; } #fakecolumn1.sc_0 #fakecolumn2 { margin-left: 0; background: none; } div#middlecolumn .padding { padding: 10px 20px; } div#leftcolumn { float: left; width: 195px; margin-left: -195px; padding-top: 10px; position: relative; } div#align-padding { margin-left: 2px; margin-right: -1px; } div#inset { padding: 1px; } div#rightcolumn { float: right; width: 191px; padding: 5px 5px 0 0; } div#componentcolumn { margin-right: 206px; } div#componentcolumn.sc_0 { margin-right: 0; } #footer { padding: 7px 7px 5px 7px; } #top { margin-top: 20px; } #top .shad-1 { } #top .shad-2 { height: 74px; } #top .rocket { } /* @end */ /* @group modules */ div.moduletable { margin-top: 15px; } div.moduletable-flush { margin: 0; padding: 0; } div.module, div.module-hilite1, div.module-hilite2, div.module-hilite3, div.module-hilite4 { margin-top: 10px; } div.moduletable h3, div.module h3, div.module-hilite1 h3, div.module-hilite2 h3, div.module-hilite3 h3, div.module-hilite4 h3 { margin: 10px 0; padding: 0 0 1px 0; line-height: 100%; height: auto; } div#showcase div.moduletable, div#footer div.moduletable { padding: 10px 5px; margin: 0; } #showcase div.moduletable h3 { margin: 0 0 10px 0; } #leftcolumn div.moduletable { padding: 0 10px 20px 10px; } div.module h3, div.module-hilite4 h3, div.module-hilite1 h3 { margin: 0 0 10px 0; } div.module-hilite2 h3 { margin: 0 0 10px 0; } div.module-hilite3 h3, #footer div.moduletable h3 { margin: 0 0 10px 0; } div.module div div div, div.module-hilite1 div div div, div.module-hilite2 div div div, div.module-hilite3 div div div, div.module-hilite4 div div div { padding: 15px 15px; } div.module-hilite1, #componentcolumn div.module { padding-top: 5px } div.module-hilite1 div, #componentcolumn div.module div { background: none; } div.module div div div div, #rightcolumn div.module div div div div, div.module-hilite1 div div div div, div.module-hilite2 div div div div, div.module-hilite3 div div div div, div.module-hilite4 div div div div { background: none; padding: 0; } /* @end */ /* @group menus */ /* For other menu CSS see individual style files: splitmenu.css and suckerfish.css */ /* @group top tabmenu */ /* styles are in the style.css for tabs */ #tabmenu ul { list-style: none; margin: 0; padding: 0; float: right; } #tabmenu li { float: left; margin: 0; padding: 0; } #tabmenu a { float: left; margin: 0; height: 28px; line-height: 34px; padding: 0 20px; } #tabmenu li { background-repeat: no-repeat; background-position: 100% 0; } #tabmenu li a { background-repeat: no-repeat; background-position: -2px 0; } #tabmenu li.index-1 a { background-position: 0 0; } /* @end */ /* @end */ /* @group content */ /* @group headers */ /* see style css files for colors */ /* @end */ /* @group search box */ #search form { margin: 0; padding: 0; } #search .search { float: left; margin-top: 5px; margin-left: 10px; } #search input.inputbox { width: 130px; padding-left: 5px; } span.searchtitle { display: block; float: left; height: 33px; line-height: 33px } /* @end */ /* @group lists */ ul { list-style: none; padding: 0; padding-left: 10px; } ul li { margin: 5px 0; padding-left: 25px; /* background: see style css */ } #componentcolumn ul li { margin: 15px 0; } div.moduletable ul li { margin: 5px 0; padding-left: 20px; } ul.arrow { } ul.arrow li { /* background: see style css */ padding-top: 10px; padding-left: 40px; } ul.check li { /* background: see style css */ padding-top: 10px; padding-left: 40px; } ul.big li { padding-top: 10px; padding-left: 55px; } /* @end */ /* @group alert styles */ span.alert { /*background: see style css*/ display: block; margin: 10px; padding: 10px 10px 10px 45px; } span.info { /*background: see style css*/ display: block; margin: 10px; padding: 10px 10px 10px 45px; } span.star { /*background: see style css*/ display: block; margin: 10px; padding: 10px 10px 10px 45px; } span.note { /*background: see style css*/ display: block; margin: 10px; padding: 10px 10px 10px 45px; } span.download { /*background: see style css*/ display: block; margin: 10px; padding: 10px 10px 10px 45px; } /* @end */ /* @group quote */ span.quote { display: block; font-style: italic; } div.author { text-align: right; font-weight: bold; } /* @end */ /* @group blockquote */ blockquote { /* background: see style css */ margin: 10px; padding: 10px 10px 5px 45px; } blockquote p { /* background: see style css */ padding-right: 35px; } /* @end */ /* @group code */ pre { margin: 10px; padding: 10px 10px 10px 40px; font-family: "courier new",helvetica,"times new roman",serif; font-size: 1.1em; } /* @end */ /* @group content area */ .left_image { float: left; margin-right: 10px; } .right_image { float: right; margin-left: 10px; } /* @end */ /* @group styles */ img.album.left { margin-right: 5px; } img.alubm.right { margin-right: 5px; } div.style { float: left; margin-left: 10px; width: 175px; text-align: center; margin-top: 20px; } .style .album { border: 0; } /* @end */ #rocket { display: block; border: 0; width: 146px; margin: 0 auto; height: 49px; } .vert_spacing { margin: 15px 0; } .hide { display: none; } form { border: 0; margin: 0; padding: 0; } table.blog span.article_seperator { display: block; height: 20px; } table.pollstableborder td { text-align: left; padding: 2px 0; } input#mod_search_searchword { width: 120px; } a:link.nounder, a:visited.nounder, a:hover.nounder { text-decoration: none; border: 0; } /* @end */ /* @end */ /* @group Joomla Core */ /* @group content */ .contentheading { padding: 10px 0; margin-top: 10px; margin-top: 10px; line-height:100%; } #showcase .contentheading { padding-top: 0; } td.buttonheading { vertical-align: middle; } td.buttonheading img { margin-right: 5px; } table.contentpaneopen, table.contentpane { border-collapse: collapse; padding: 0; margin: 0; width: 100%; } div.contentpane, div.contentpaneopen { width: 100%; } .clr { clear: left; } div.mosimage { margin: 5px; } a.readon { display: block; float: left; padding-left: 25px; padding-top: 2px; margin-top: 10px; line-height: 14px; height: 16px; /* background: see style css */ } .modifydate { height: 20px; vertical-align: top; } .createdate { height: 20px; vertical-align: top; vertical-align: top; padding-top: 5px; padding-top: 0px; } table.contenttoc { margin: 5px; padding: 5px; } table.contenttoc td { padding: 0 5px; } /* @end */ /* @group pathway */ span.pathway { display: block; height: 16px; line-height: 16px; vertical-align: middle; margin-top: 5px; margin-top: 15px; } span.pathway a { } span.pathway img { border: 0; width: 10px; margin: 0 7px 0 9px; /* background: see style css */ } div#pathway { margin-top: 10px; padding-left: 8px; } /* @end */ /* @group sections */ /* @end */ /* @group mainmenu */ a.mainlevel:link, a.mainlevel:visited { display: block; padding: 0px 0 0px 0px; margin-top: 5px; /* background: see style css */ } a.mainlevel:hover { background-position: 100% -40px; text-decoration: none; } a.mainlevel#active_menu, a.sublevel#active_menu { background-position: 100% -20px; } a.sublevel:link, a.sublevel:visited { text-decoration: none; } a.sublevel:hover { text-decoration: none; } /* @end */ /* @group modules */ /* @end */ /* @group misc */ table.adminform textarea { width: auto; } .sectiontableheader { font-weight: bold; padding: 4px; } .sectiontableentry1, .sectiontableentry2 { padding: 4px; } .pollstableborder .sectiontableentry1, .pollstableborder .sectiontableentry2 { border: 0; background: none; } /* @end */ /* @end */ /* My Comment */
  17. hEiti

    Luduz padomu

    un ar linkiem bus shadi?? echo "<a href=\"forums/profile.php?mode=sendpassword\" class=\"menulinkactive\" TARGET="_top">Atgriest paroli /</a>";
  18. hEiti

    Luduz padomu

    vinji parada talak ejosho pioem profila sadaljas to pagruti izskaidrot vnk gribu zinat vai var?? uztaisit ta? ka raxtiju pirms tam... cik saprotu runa iet par kko lidzigu shim <A HREF="selftarget.html" TARGET="_top">top</A> bet nevaru saprast ka tas notiekas
  19. hEiti

    Luduz padomu

    idejiski echo "<form action=\"forums/login.php\" method=\"post\">"; echo ("<input type=\"hidden\" name=\"redirect\" value=\"." . $_SERVER['REQUEST_URI'] . "\">"); echo "Logins: <input type=\"text\" name=\"username\" size=\"18\" class=\"post\"><br>"; ?><br><? echo "Parole: <input type=\"password\" name=\"password\" size=\"18\" class=\"post\"><br>"; echo "<input type=\"checkbox\" name=\"autologin\">Automatiski"; echo "<input type=\"submit\" value=\"Ieiet\" name=\"login\" class=\"mainoption\">"; echo "<br>"; echo "<a href=\"forums/profile.php?mode=sendpassword\" class=\"menulinkactive\">Atgriest paroli /</a>"; echo "<a href=\"forums/profile.php?mode=register\" class=\"menulinkactive\"> Registreties</a>"; ta ir ta koda dalja kura tas ir vajadzigs visur kur ir a href tur :) man nav ne mazakas nojausmas par to ko pateici vai ir kads kas var man nedaudz palidzet?
  20. hEiti

    Luduz padomu

    Ideja tada * ir iframe vinja ieksha logins ielogojoties atveras profils profila ir 2 izejas uz forumu un foruma profilu (bet kad uzspiez talaka lapa atveras tani mazaja iframe) vai maz tas ir iespejams ar kkadu kodu palidzibu izdarit ta kad ja nospiez tad neatveras taja mazaja bet gan visa lielaja lapa? ...ceru kad ideju sapratat...
  21. hEiti

    include

    Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\index.php:7) in C:\AppServ\www\lietotaji\common.php on line 72 jav esmu ticis tik talu... 72: header('Location: lietotaji/login.php');
  22. hEiti

    include

    ja nemaldos lasiju kad ir ta KAD 1 IZRAISA OTRU ERROR tad iznak kad man problema sakas ar kko lidzigu sham session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\AppServ\www\sakums.php:3) in
  23. hEiti

    include

    nja palasiju vinji tur stasta par 2. problemam 1. ir tas kad atsptarpes etc.. bet to 2. es lidz galam ta ari nesaprotu varbut kads var skadirak izteikties? sheit ir kods paste.php.lv lūdzu (bubu)
  24. hEiti

    include

    ludzu paskadiro sikak via iedod link ar sho problemu sasaros pirmo reizi
×
×
  • Create New...