Jump to content
php.lv forumi

web lapas iekšējais mail


Vecteevs

Recommended Posts

Sveiki, tātad atkal jautājums, kā var sūtīt vēstules pa web lapu takā draugiem.lv vai trackeros.

Varbūt var kāds iedot kādu pamācību, jo nezinu kā meklēt(pēc kādiem nosaukumiem)

Paldies!

Link to comment
Share on other sites

Ir tabula vēstules vēstules (kolonna - sutitajs_id, sanemens_id, temats, saturs).

 

Lai nosutitu vestuli, pievieno ierakstu vestulju tabulai

Lai apskatītu vestules, atlasa pec attieciga lietotaja...

 

Man liekas, ka šī jau nu būtu lieta, kuru vajadzētu pašam izdomāt.. nav jau tik sarežģīti...

Link to comment
Share on other sites

Takā visu sataisīju, bet rādās viena kļūda:

<?php

include ("../dbc.php");

$sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'" or die(mysql_error());
$result=mysql_query($sql);

while($rows=mysql_fetch_array($result)){
?><br />
From: <? echo $rows['sender_id']; ?><br />
Topic: <? echo $rows['topic']; ?><br />
Massage: <? echo $rows['massage']; ?><br />
<p><?

}

mysql_close();
?> </p>
<?php } ?>  

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

 

Vai kā savādāk ir jātais? Nu ērtāks variants..

Edited by Vecteevs
Link to comment
Share on other sites

$sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'" or die(mysql_error());

 

Tas ir interesanti, ka tu pieļauj domu, ka mainīgajam pieškirot string tipa datus varētu rasties mysql errors :))

Link to comment
Share on other sites

<?php

include ("../dbc.php");

$sql="SELECT sender_id, topic, massage FROM massages WHERE user_email='$_SESSION[user]'";
$result=mysql_query($sql) or die(mysql_error());

while($rows=mysql_fetch_array($result)){
?><br />
From: <? echo $rows['sender_id']; ?><br />
Topic: <? echo $rows['topic']; ?><br />
Massage: <? echo $rows['massage']; ?><br />
<p><?

}

mysql_close();
?> </p>
<?php } ?> 

Link to comment
Share on other sites

 if(!isset($_GET['lapa'])){
  $pages = 1;
} else {
  $pages = $_GET['lapa'];
}
$max_results = 30;
$from = (($pages * $max_results) - $max_results);
//Parbaudam, cik produktus ir jaizvada viena lapa
$number_in_page = 30;
//Aprekinam lapu skaitu
$total_query = mysql_query("SELECT COUNT(id) name FROM users");
$user_value = mysql_fetch_array($total_query);
$users = $user_value['name'];
$total = (($users - 1) / $number_in_page) + 1;
$total = intval($total);
$start = $curent_page * $number_in_page - $number_in_page;
///Tavs vēstules scripta kods

}
// Ieprieksheejaa lapa


       $page .='';
       echo $page;

       echo "</div>";

<?

$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM users"),0);
$total_pages = ceil($total_results / $max_results);
echo "<center><hr><div class='navs'><br />";


for($i = 1; $i <= $total_pages; $i++){
  if(($lapa) == $i){
      echo "<span><a href='' class='nummuri'><active>$i</active></a> </span>";
      } else {

          echo "<span><a href=\"".$_SERVER['PHP_SELF']."?do=lietotaji&lapa=$i\"  class='nummuri1'>$i</a></span> ";
  }
}
echo "</div></center>";
?>

Edited by gta1151
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...