Jump to content
php.lv forumi

ziedinjsh

Reģistrētie lietotāji
  • Posts

    789
  • Joined

  • Last visited

Everything posted by ziedinjsh

  1. Sveiki, Šāds ir logina scritps: <?php //Checks if there is a login cookie if(isset($_COOKIE['ID_my_site'])) //if there is, it logs you in and directes you to the members page { $epasts = $_COOKIE['ID_my_site']; $pass = $_COOKIE['ID_my_site']; $check = mysql_query("SELECT * FROM users WHERE email = '$email'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass != $info['pass']) { } else { header("Location: index.php"); } } } //if the login form is submitted if (isset($_POST['login'])) { // if form has been submitted // makes sure they filled it in if(!$_POST['email'] | !$_POST['pass']) { die('Aizpildi visus lauciņus.'); } // checks it against the database if (!get_magic_quotes_gpc()) { $_POST['email'] = addslashes($_POST['email']); } $check = mysql_query("SELECT * FROM users WHERE email = '".$_POST['email']."'")or die(mysql_error()); //Gives error if user dosen't exist $check2 = mysql_num_rows($check); if ($check2 == 0) { die('Šāds producents nav šeit reģistrējies'); } while($info = mysql_fetch_array( $check )) { $_POST['pass'] = stripslashes($_POST['pass']); $info['pass'] = stripslashes($info['pass']); //gives error if the password is wrong if ($_POST['pass'] != $info['pass']) { die('Nepareiza parole.'); } else { // if login is ok then we add a cookie $_POST['email'] = stripslashes($_POST['email']); $hour = time() + 60 * 60 * 3; setcookie('ID_my_site', $_POST['email'], $hour); setcookie('Key_my_site', $_POST['pass'], $hour); //then redirect them to the members area header("Location: index.php"); } } } else { echo"<form name='login' method='post' action='index.php'>"; echo"<table width='210' border='0' align='center' cellpadding='0' cellspacing='0' class='login'> <tr> <th align='right' scope='col'>e-pasts:</th> <th align='right' scope='col'> <input type='text' name='email' class='ltextbox'></th> </tr> <tr> <th align='right' scope='col'>parole:</th> <th align='right' scope='col'> <input type='password' name='pass' class='ltextbox'> </th> </tr> <tr> <th align='right' scope='col'> </th> <th align='right' scope='col'> <input type='submit' name='login' value='ieiet' class='lbutton'> </th> </tr> </table> "; echo"</form>"; } ?> Kad ielogojas tad vienalga var atvērt login.php scriptu.. lai gan viņam vajadzētu mest uz index.php sanāk tā ka lietotājs ielogojas, bet viņš nav ielogojies.. es īsti nesaprotu būtu vajadzīgs kaut kas tāds: if (user) { header("Location: index.php"); } if (guest) { header ("Location: login.php"); } Kaut kā tā, tikai nezinu kā īsti uztaisit to, jo logina scripts nav manis taisīts
  2. es izdzēsu BOM simbolus, bet nu problēma ir vienalga..
  3. nu es izņēmu viņu ārā, bet nu nekas nemainās.. k\ludu ziņā! ahh..
  4. :) Laikam jau.. Headers already sent.. Tur arī iet run par par šām rindiņām: setcookie('ID_my_site', $_POST['email'], $hour); setcookie('Key_my_site', $_POST['pass'], $hour); //then redirect them to the members area header("Location: index.php"); \ Es nevaru saparast kur tad viņš pirmstam ir izvadījis.. <?php error_reporting(E_ALL); ini_set("display_errors", 1); echo '<pre>'; print_r($_POST); print_r($_GET); print_r($_COOKIE); echo '</pre>'; include "misc/opendb.php"; include "misc/functions.php"; //Checks if there is a login cookie if(isset($_COOKIE['ID_my_site'])) //if there is, it logs you in and directes you to the members page { $email = $_COOKIE['ID_my_site']; $pass = $_COOKIE['ID_my_site']; $check = mysql_query("SELECT * FROM users WHERE email = '$email'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass != $info['pass']) { } else { header("Location: index.php"); } } } //if the login form is submitted if (isset($_POST['login'])) { // if form has been submitted // checks it against the database if (!get_magic_quotes_gpc()) { $_POST['email'] = addslashes($_POST['email']); } $check = mysql_query("SELECT * FROM users WHERE email = '".$_POST['email']."'")or die(mysql_error()); //Gives error if user dosen't exist $check2 = mysql_num_rows($check); if ($check2 == 0) { die('ðâds producents nav ðeit reìistrçjies'); } while($info = mysql_fetch_array( $check )) { $_POST['pass'] = stripslashes($_POST['pass']); $info['pass'] = stripslashes($info['pass']); //gives error if the password is wrong if ($_POST['pass'] != $info['pass']) { die('Nepareiza parole.'); } else { // if login is ok then we add a cookie $_POST['email'] = stripslashes($_POST['email']); $hour = time() + 60 * 60 * 3; setcookie('ID_my_site', $_POST['email'], $hour); setcookie('Key_my_site', $_POST['pass'], $hour); //then redirect them to the members area header("Location: index.php"); } } include "skin/header.php"; include "skin/menu.php"; echo '<table id="warp" align="center">'; echo '<tr>'; echo '<td id="left" valign="top">'; echo '<div id="panel-left">'; include "skin/left.php"; echo '</div>'; echo '</td>'; echo '<td id="center" valign="top">'; if ($set == '') { include "home/index.php"; } if ($set == 'news') { include "news/index.php"; } if ($set == 'music') { include "music/index.php"; } if ($set == 'producers') { include "producers/index.php"; } if ($set == 'register') { include "reg.php"; } echo '</td>'; echo '<td id="right" valign="top">'; echo '<div id="panel-right">'; include "skin/right.php"; echo '</div>'; echo '</td>'; echo '</tr>'; echo '</table>'; include "skin/footer.php"; } else { echo"<form name='login' method='post' action='index.php'>"; echo"<table width='210' border='0' align='center' cellpadding='0' cellspacing='0' class='login'> <tr> <th align='right' scope='col'>e-pasts:</th> <th align='right' scope='col'> <input type='text' name='email' class='ltextbox'></th> </tr> <tr> <th align='right' scope='col'>parole:</th> <th align='right' scope='col'> <input type='password' name='pass' class='ltextbox'> </th> </tr> <tr> <th align='right' scope='col'> </th> <th align='right' scope='col'> <input type='submit' name='login' value='ieiet' class='lbutton'> </th> </tr> </table> "; echo"</form>"; } include "misc/closedb.php"; ?>
  5. tā tad izvada logina informāciju parāda e-pastu, paroli un pogu echo '<pre>'; print_r($_POST); print_r($_GET); print_r($_COOKIE); echo '</pre>'; Viņam nepatīk kaut kas šijā: $_POST['email'] = stripslashes($_POST['email']); $hour = time() + 60 * 60 * 3; setcookie(ID_my_site, $_POST['email'], $hour); setcookie(Key_my_site, $_POST['pass'], $hour); //then redirect them to the members area header("Location: index.php"); Use of undefined constant ID_my_site - assumed 'ID_my_site' Use of undefined constant Key_my_site - assumed 'Key_my_site' Šis arī ir iemesls droši vien kapēc uzpiežot uz kādu linku, viņš man atmet atpakaļ uz loginu
  6. es nevaru saprast kurā vietā!!!
  7. nu labi, bet tas es īsti nesaprotu kapēc ielogojoties man rāda kļudas: headers already sent ?
  8. nu jā, tā arī ir, ka rāda Warning: Cannot modify header information - headers already sent by Kā tad es varu izveidot cookie?
  9. ieejot lapā es vēlos lai ir redzams tikai login forma, piec ielogošanās atveras paša lapa <?php $con = mysql_connect("localhost","root","nls2236300"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pro"); //Checks if there is a login cookie if(isset($_COOKIE['ID_my_site'])) //if there is, it logs you in and directes you to the members page { $epasts = $_COOKIE['ID_my_site']; $pass = $_COOKIE['ID_my_site']; $check = mysql_query("SELECT * FROM users WHERE email = '$email'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($pass != $info['pass']) { } else { header("Location: index.php"); } } } //if the login form is submitted if (isset($_POST['login'])) { // if form has been submitted // checks it against the database if (!get_magic_quotes_gpc()) { $_POST['grupa'] = addslashes($_POST['grupa']); } $check = mysql_query("SELECT * FROM users WHERE email = '".$_POST['email']."'")or die(mysql_error()); //Gives error if user dosen't exist $check2 = mysql_num_rows($check); if ($check2 == 0) { die('sheit taads lietotaajs nav'); } while($info = mysql_fetch_array( $check )) { $_POST['pass'] = stripslashes($_POST['pass']); $info['pass'] = stripslashes($info['pass']); //gives error if the password is wrong if ($_POST['pass'] != $info['pass']) { die('Nepareiza parole.'); } else { // if login is ok then we add a cookie $_POST['email'] = stripslashes($_POST['mail']); $hour = time() + 60 * 60 * 3; setcookie(ID_my_site, $_POST['epasts'], $hour); setcookie(Key_my_site, $_POST['pass'], $hour); //then redirect them to the members area header("Location: http://62.63.191.54/"); } } echo 'Mana lapa'; } else { echo"<form name='login' method='post' action='index.php'>"; echo"<table width='210' border='0' align='center' cellpadding='0' cellspacing='0' class='login'> <tr> <th align='right' scope='col'>e-pasts:</th> <th align='right' scope='col'> <input type='text' name='epasts' class='ltextbox'></th> </tr> <tr> <th align='right' scope='col'>parole:</th> <th align='right' scope='col'> <input type='password' name='pass' class='ltextbox'> </th> </tr> <tr> <th align='right' scope='col'> </th> <th align='right' scope='col'> <input type='submit' name='login' value='ieiet' class='lbutton'> </th> </tr> </table> "; echo"</form>"; } ?> ieelogojoties man rāda ka šāds lietotājs nav!! un kā lai izvada tādu lietu kā piemēram: if (user) { echo 'kautkas'; } else (guest) { header("Location: index.php"); }
  10. izveidojas brīdinājums: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\WEB\htdocs\reg.php on line 58 artist email location genere pass pass2 producer_id
  11. Sveiki, man nepieciešama palīdzība šādā jautājumā: es ievadu informāciju no feildiem: mysql_query("INSERT INTO users (artist, email, location, genere, pass, pass2, producer_id)VALUES ('$_POST[artist]','$_POST','$_POST[location]','$_POST[genere]','$_POST[pass]','$_POST[pass2]','$_POST[producer_id]')"); bet kāviņu izvadīt? atpakaļ php kodā?
  12. iegāju www.kloth.net/services/nslookup.php Rezūltāts: ;; connection timed out; no servers could be reached
  13. nu jau iet 2trā diena un vēljoprojām nekas.. vai nu es kaut ko esmu nepareizu izdarījis vai vēljoprojām ir jāgaida. es nezinu kas ir nslookup :D
  14. Sveiki, Kādu laiku atpakaļ nic.lv reģistrēju domēnu, bet nebija kur viņu piesaistīt. Vakar iegādājos hostu www.dream-hosting.co.uk It kā es viņu piesaistīju pie sava domena, bet nu kad ievada domēnu parādas server not found un kad iekš CMD nopingoju parādas could not find host No hosta tika doti 4 nameservers, bet nic.lv mājas lapa varu tiaki it kā vienu piesaistīt
  15. es jau nenoniecinu Latvijas programmētājus! Vnk man personīgi ir nervi pa īsu, lai iemācītos un naudas arī nav.. Tapēc jau teicu, jāsāk krāt! :D Un PRojekts ko vēlos nav naudas ienesīgs :)
  16. Labi, es te parakņājos pa forumu un uzināju aptuvenās izmaksas :D 10 Ls/h bez nodokļiem.. 30% nodoklis.. tātad 13 Ls/h. Jāsāk krāt :D
  17. nu labi, bet cik varētu izmaksāt tādu lapu izveidošana? :)
  18. Cik varētu izmaksāt tāda lapa kā piemēram djtop.lv vai draugiem.lv mūzikas sadaļas uzkodēšana? kā vispar sanāk lētāl, php vai ajax? droši vien jau php
  19. es nezinu, jo neesmu progrmētājs.. Vnk tā bišķ māku parediģēt.. vairkak nedaudz zinu kaut ko no CSS un html.. lapu var apskatīt šeit http://netmaniack.oo.lv/ uzliku uz citu serveri un vairāk tādu problēmu nav
  20. no pirmajām 3 diži nekāda jēga nav, bet es jau pameiģināju šādi: echo '<div id="lang"><a href="?lang=lv"><img src="misc/lu.png"></a> <a href="?lang=ru"><img src="misc/ru.png"></a> <a href="?lang=en"><img src="misc/en.png"></a></div>'; bet tas tukšums vienalga ir.. Tas ir lai lapā parādītos Karodziņi, lai varētu mainīt valodas.. Bildi var apskatīt pie attach
  21. Uztaisīju tagad pēc tā parauga http://innonesen.se/test/l-4/ pārtaisiju uz savu dizainu.. viss ir ok, bet ir viena lieta $lv = '<img src="misc/lv.png">'; $ru = '<img src="misc/ru.png">'; $en = '<img src="misc/en.png">'; $languages = array( 'lv' => 'lv', 'ru' => 'ru', 'en' => 'en', ); if (isset($_GET['lang']) AND array_key_exists($_GET['lang'], $languages)) { include 'lang/' . $languages[$_GET['lang']] . '.php'; } else { include './lang/lv.php'; } echo '<div id="layout">'; echo '<div id="header">'; echo '<div id="logo"><img src="css/img/logo2.png" title="Producer Records"></div>'; echo '<div id="lang"><a href="?lang=lv">'.$lv.'</a> <a href="?lang=ru">'.$ru.'</a> <a href="?lang=en">'.$en.'</a></div>'; echo '</div>'; Ielieku valodas slēdzi, uzslēdziet EN viss ir ok, bet kās uzslēdz LV un RU tad augšā parādās atkal tā atstarpe no browsera malas līdz headeram..
  22. Jā, kaut ko tādu! :) Tā bija.. Viss bija ok gan uz FF un IE. Ieliku valodas flagus kādu brīdi bija ok, bet pēkšiņi un IE viss ir šķībi un greizi un valodas īsti nesalasāmas!
  23. Headers un footers man ir 100% vidus daļas 70% Vidusdaļā iekšā man kreisā pusē stāv div 25% un labājā pusē div- 70% Samazinot browseri uz Firefox viņi saspiežas kopā.. vienīgi burti pārkāpj div robežas, bet uz IExplorer labā pala palec zem kreisas un tad spiežas.. vai tā varētu būt vai tajā, ka vidu daļas manir 70% un augstums ir 550px? it kā jau nevajadzētu būt.. Te būs mans css: body{ background-color:#F0F0F0; background-image:url(''); margin: 0px 0px 0px 0px; font-family:Agency FB; } img { border:0px } a:link { color: #CC3399; text-decoration: none; } a:visited { text-decoration: none; color: #CC3399; } a:hover { text-decoration: none; color: #333333; } a:active { text-decoration: none; color: #CC3399; } #logo{ width:376px; height:102px; padding:2em 0em 0em 2em; position:absolute; } #header{ height:200px; background-image:url('img/header.gif'); } #lang{ float:right; margin-top:8em; margin-right:2em; clear: both; } #midlle{ height:550px; width:70%; margin-left:20%; margin-rigth:20%; margin-top:1em; margin-bottom:1em; } #midlle-left{ border:1px solid #CF8DE9; width:25%; float:left; text-align:left; font-family:Agency FB; font-size:20px; padding:5px 5px 5px 5px; } #midlle-right{ border:1px solid #CF8DE9; width:70%; float:right; text-align:left; font-size:20px; padding:5px 5px 5px 5px; } #footer{ background-image:url('img/footer.gif'); height:70px; width:100%; position: fixed; bottom: 0px; } #title{ background-image:url('img/title.gif'); height:38px; padding:2px 0px 0px 2px; font-size:25px; font-weight:bold; } h2 { margin: 10px 0px 5px 0px; color:#006600; }
  24. nu es paprovēju samainītie vietām padding ar margin un otrādi, bet neka.. Pilnīgs sviests!
×
×
  • Create New...