Jump to content
php.lv forumi

ziedinjsh

Reģistrētie lietotāji
  • Posts

    789
  • Joined

  • Last visited

Everything posted by ziedinjsh

  1. ir sadaļa report kur ir 3 titpi. ar select izvēlas vienu no viņiem aizpilda pārējo informāciju un ievada datu bāzē.. kā lai es izvadu katru tipu atsevišķi meiģināju šādi: $r = (isset($_GET['r'])) ? $_GET['r'] : ''; echo "<a href='index.php?id=report&r=payment'>Payment</a> | "; echo "<a href='index.php?id=report&r=bug'>Bug</a> | "; echo "<a href='index.php?id=report&r=advice'>Advice</a>"; if($r=='payment'){ $query = "SELECT * FROM d7 WHERE type='payment'"; $result = mysql_query($query); while($data = mysql_fetch_assoc($result)) { echo "".$data['date'].""; echo "".$data['title'].""; echo "".$data['message'].""; } } if($r=='bug'){ } if($r=='advice'){ } Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in D:\WEB\xampp\htdocs\sell\admin\report.php on line 14 ko es daru nepareizi?
  2. ziedinjsh

    Login

    un kas tad tur ir par daudz?
  3. ziedinjsh

    Login

    nu jā, bet kurā vietā :?
  4. ziedinjsh

    Login

    tagad ir sekojoša problēma.. ielogojoties man atver to ko vajadzētu atvērt, bet kad uzspiež uz kāda linka man atkal aizmet pie logina <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="" class=""> <head> <title>projekts</title> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-language" content="en" /> <meta name="description" content="" /> <link rel="alternate" media="handheld" href="" /> <link rel="shortcut icon" href="" /> <link type="text/css" rel="stylesheet" href="../misc/style.css" /> <link type="text/css" rel="stylesheet" href="../misc/add-style.css" /> </head> <body> <?php error_reporting(E_ALL); include "../misc/connect.php"; include "../misc/paypal.php"; include "../misc/player.php"; if(isset($_POST['login'])){ $admin_name = $_POST['admin_name']; $admin_pass = $_POST['admin_pass']; $result = mysql_query("SELECT * FROM admin WHERE admin_name='$admin_name' AND admin_pass=md5('$admin_pass')"); $query = sprintf("SELECT * FROM users WHERE admin_name='$admin_name' AND admin_pass='$admin_pass'", mysql_real_escape_string($admin_name), mysql_real_escape_string($admin_pass)); if(mysql_num_rows($result) > 0) { $_SESSION['is_logged_in'] = 1; } } if(!isset($_SESSION['is_logged_in'])) { echo "<form method='post' action='".$_SERVER['PHP_SELF']."'>"; echo "Admin:<input type='text' name='admin_name' class='input'>"; echo "Password:<input type='password' name='admin_pass' class='input'>"; echo "<input type='submit' name='login' value='Eneter' class='button'>"; echo "</form>"; } else { //////////////////Page $id = (isset($_GET['id'])) ? $_GET['id'] : ''; echo "<div id='top'>"; echo "</div>"; echo "<div class='warp'>"; echo "<div id='admin-menu'>"; echo "<a href='../index.php'>Page | </a>"; echo "<a href='index.php'>Admin stage</a> | "; echo "<a href='index.php?id=add_d7&d7=list'>D7</a> |"; echo "</div>"; echo "<div class='page'>"; if($id==''){ echo "<center>Admin stage</center>"; } if ($id=='add_d7'){ include "d7.php"; } echo "</div>"; echo "</div>"; } ?> </body> </html>
  5. ziedinjsh

    Login

    Notice: Undefined index: admin_pass in D:\WEB\xampp\htdocs\sell\admin\index.php on line 30 if(isset($_POST['login'])){ $admin_name = $_POST['admin_name']; $admin_pass = $_POST['admin_pass']; $result = mysql_query("SELECT * FROM admin WHERE admin_name='$admin_name' AND admin_pass=md5('$admin_pass')"); if(mysql_num_rows($result) > 0) { $_SESSION['is_logged_in'] = 1; } } if(!isset($_SESSION['is_logged_in'])) { echo "<form method='post' action='".$_SERVER['PHP_SELF']."'>"; echo "Admin:<input type='text' name='admin_name' class='input'>"; echo "Password:<input type='password' name='admin-pass' class='input'>"; echo "<input type='submit' name='login' value='Eneter' class='button'>"; echo "</form>"; } else { echo "Lapa"; } Kapēc tā? :?
  6. ahā.. atradu kaut kādu informāciju, bet ir tāda lieta, kā man neļauj tādu failu izveidot ar nosaukumu .htpasswd saka ka man jābūt file name :D
  7. Sveiki! kā var uztaisīt tāda veida loginu kā: ieejot piem. http://www.nosaukums.lv/admin izlec windows popup un tur jāievada admin name un password. Tā arī ir kad ielogojies datubāzē ja ir uzlikta parole. Kā kaut ko tādu var uztaisīt? Paldies jau iepriekš! :)
  8. Varbūt kāds tad var ieteikt kādu citu ajax kodu ar kuru ielādēt div saturu?
  9. nu šitā tagad iet <?php if (isset($_GET['del'])) { $data = mysql_fetch_array(mysql_query("SELECT * FROM d7 WHERE d7_id='".$_GET['del']."' LIMIT 1")); $sql = "DELETE FROM d7 WHERE d7_id ='".$data['d7_id']."'"; $result = mysql_query($sql); echo "Deleted!"; } ?>
  10. nu tagad ir šādi <?php if (isset($_POST['del'])) { $data = mysql_fetch_array(mysql_query("SELECT * FROM d7 WHERE d7_id='".$_GET['del']."")); $sql = "DELETE FROM d7 WHERE d7_id='".$_GET['del']'"; header('location: index.php?id=add_d7&d7=list'); } ?> bet tāpat nekas nenotiek :?
  11. šāds ir links ar ko dzēš datus: <a href='delete_d7.php?del=".$data['d7_id']."'>Delete</a> un delete_d7.php <?php if($_GET='del'){ $sql = "DELETE FROM d7 WHERE d7_id='".$data['d7_id']."'"; $result = mysql_query($sql); header('location:index.php?id=add_d7&d7=list'); } ?> bet nekas nenotiek
  12. lejupielādēju šādu ajax loader. gribu izmantot viņu kā div loaderu. <script type='text/javascript'> QueryLoader.selectorPreload = ".page"; QueryLoader.init(); </script> </head> <?php error_reporting(E_ALL); include "misc/connect.php"; include "misc/paypal.php"; include "misc/player.php"; $id = (isset($_GET['id'])) ? $_GET['id'] : ''; echo "<div class='warp'>"; echo "<div class='menu'>"; echo "<ul>"; echo "<li><a href='index.php' ".(($id == "") ? "class='current'" : "")."\">Home</a></li>"; echo "<li><a href='index.php?id=samples' ".(($id == "samples") ? "class='current'" : "")."\">Samples</a></li>"; echo "<li><a href='index.php?id=d7' ".(($id == "d7") ? "class='current'" : "")."\">D7</a></li>"; echo "<li><a href='index.php?id=add_d7'>ADD D7</a></li>"; echo "<div class='fix'></div>"; echo "</ul>"; echo "</div>"; echo "<div class='page'>"; if($id==''){ echo "Home"; } if ($id=='samples'){ echo "Samples"; include "samples.php"; } if ($id=='d7'){ include "d7.php"; } if ($id=='add_d7'){ include "add/d7.php"; } echo "</div>"; echo "</div>"; uzspiežot uz linku home rādās viss melns, uzspiežot uz linku samples rādās viss melns, uzspiežot uz linku d7 viss nostrādā ielādē div, bet atkal nospiežot uz nākamo linku viss ir melns.. kapēc tā?
  13. pārveidoju, bet datubāzē dati vienalga netiek ielikti! :(
  14. ko tur likt pēc kārtas.. viņam būtu jastrādā!
  15. nu lab, tagad ievade ir šāda <?php if (isset($_GET['add_d7'])) { echo "<br>GET nostrādāja<br><br>"; $d7_name = $_POST['d7_name']; $d7_size = $_POST['d7_size']; $d7_demo = $_POST['d7_demo']; $d7_link = $_POST['d7_link']; $d7_buy = $_POST['d7_buy']; $q="INSERT INTO `d7` (d7_name, d7_size, d7_demo, d7_link, d7_buy) VALUES ('$d7_name', '$d7_size', '$d7_demo', '$d7_link', '$d7_buy')"; $add = mysql_query($q,$connection); echo "<br>Query: ",$q,"<br><br>"; echo "<br>Error: ",mysql_error($connection),"<br><br>"; } echo "<form method='post' action='index.php?id=add_d7'>"; echo "<div id='add-d7'>"; echo "<div class='title'>File name</div><div class='input'><input type='text' name='d7_name' size='35'></div>"; echo "<div class='title'>File size</div><div class='input'><input type='text' name='d7_size' size='2'></div>"; echo "<div class='title'>Demo link</div><div class='input'><input type='text' name='d7_demo' size='60' ></div>"; echo "<div class='title'>Download link</div><div class='input'><input type='text' name='d7_link' size='60' ></div>"; echo "<div class='title'>Buy id</div><div class='input'><input type='text' name='d7_buy' size='2'></div>"; echo "<div class='fix'></div>"; echo "<center><input type='submit' name='add_d7' value='ADD' class='button'></center>"; echo "</div>"; echo "</form>"; ?> bet informāciju datubāzē neievadās :?
  16. Sveiki! šādi pieslēdzot datubāzei: <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("sell") or die(mysql_error()); ?> un šādie ievadu datus{ <?php if (isset($_GET['add_d7'])) { $d7_name = $_POST['d7_name']; $d7_size = $_POST['d7_size']; $d7_demo = $_POST['d7_demo']; $d7_link = $_POST['d7_link']; $d7_buy = $_POST['d7_buy']; $add = mysql_query("INSERT INTO `d7` (d7_name, d7_size, d7_demo, d7_link, d7_buy) VALUES ('$d7_name', '$d7_size', '$d7_demo', '$d7_link', '$d7_buy') "); $result = mysql_query($sql); if($result){ echo "All done!"; }else { echo "ERROR"; } } echo "<form method='post' action='index.php?id=add_d7'>"; echo "<div id='add-d7'>"; echo "<div class='title'>File name</div><div class='input'><input type='text' name='d7_name' size='35'></div>"; echo "<div class='title'>File size</div><div class='input'><input type='text' name='d7_size' size='2'></div>"; echo "<div class='title'>Demo link</div><div class='input'><input type='text' name='d7_demo' size='60' ></div>"; echo "<div class='title'>Download link</div><div class='input'><input type='text' name='d7_link' size='60' ></div>"; echo "<div class='title'>Buy id</div><div class='input'><input type='text' name='d7_buy' size='2'></div>"; echo "<div class='fix'></div>"; echo "<center><input type='submit' name='add_d7' value='ADD' class='button'></center>"; echo "</div>"; echo "</form>"; ?> piespiežot pogu lapa vienkāršī refrešojas un viss.. informāciju iekš datubāzes neievada.. Kas par vainu??
  17. Paldies par palīdzību! :)
  18. php funkcija: function player(){ echo '<div class="song" onclick="snd=new Audio(\'demo/somewhere_is_something_demo.mp3\'); snd.play();"></div>'; } php funkcijas izvade echo "<div class='play'>".player()."</div>"; css: .play{ padding-left:20px; border:1px solid #ACD334; float:left; margin-right:20px; } izvadītā funkcija nav iekš paradzētā div, kapēc tā?
  19. Sapratu :) tagad izkstās šādi: function player(){ echo '<div class="song" onclick="snd=new Audio(\'demo/somewhere_is_something_demo.mp3\'); snd.play();"></div>'; } izvadās echo "".player().""; Tagad kā var uztaisīt šadu izvadi: echo "".player('demo/somewhere_is_something_demo.mp3').""; Lai nebūtu jātaisa jauna funkcija visu laiku pie katra nākamā mp3 faila :?
  20. izmantojot šo man izmet parse erroru: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\WEB\xampp\htdocs\sell\misc\player.php on line 4 <?php function player(){ echo '<div class="song" onclick="snd=new Audio('song.mp3'); snd.play();">Play</div>'; } ?>
  21. Paldies! Bet nu vai nu es neredzēju vai nebija licenze?! Tas tieks izmantots lapā kur iespējams apgrozīsies nauda
  22. Sveiki! Kā varētu uztaisīt tādu lietu kā: pie dziesmas nosaukuma ir play poga uzspiežot uz tās atskaņo mp3 failu un play pogas vietā parādas stop poga. satura lapā tas varētu izskatīties kaut kā šādi echo '<div class="song">'.player('song/demo.mp3').'</div>'; bet kāda tad ir jātaisa funkcija lai kaut ko tādu izvadītu un kāds man atskaņošanas kods vajadzīgs? Paldies jau iepriekš :)
×
×
  • Create New...