Jump to content
php.lv forumi

Recommended Posts

Posted

šāds script

<?php
$url = "http://witality.put.lv/forum/index.php?showuser=";
$con = mysql_connect($host,$dbuser,$dbpass);
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }
mysql_select_db($dbname, $con);
 $result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");
while($row = mysql_fetch_array($result))
{
 echo "<b><a href=\"$url".$row['id']."\"></a></b>".$style;
 echo "<table width=\"163\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"153\" lign=\"left\">".$row['members_display_name']."</td><td width=\"10\" lign=\"left\">(".$row['posts'] .")</td></tr></table></a>";
 echo "</b>";

 }
 mysql_close($con);
?>

 

viņš ir šāds

 

1237930637.JPG

 

es gribētu šādi

1237930663.JPG

 

kāds var man palīdzēt to dabūt gatavu

kad es mēģinu man rāda tikai baltu lapu

help

Posted (edited)

<?php
$url = "http://witality.put.lv/forum/index.php?showuser=";
$con = mysql_connect($host,$dbuser,$dbpass);
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }
mysql_select_db($dbname, $con);
 $result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");
while($row = mysql_fetch_array($result))
{
 echo "<img src="LINKS_UZ_BILDI.png" alt="" /><b><a href=\"$url".$row['id']."\"></a></b>".$style;
 echo "<table width=\"163\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"153\" lign=\"left\">".$row['members_display_name']."</td><td width=\"10\" lign=\"left\">(".$row['posts'] .")</td></tr></table></a>";
 echo "</b>";

 }
 mysql_close($con);
?>

 

šo rindu

 

echo "<img src="LINKS_UZ_BILDI.png" alt="" /><b><a href=\"$url".$row['id']."\"></a></b>".$style;

 

labo pēc savām vajadzībām

Edited by yeahz
Posted

es izdariju ta ka tuteici bet nestrada -rada baltu lapu

 

šādi zskatijāš

 

<?php
$url = "http://witality.put.lv/forum/index.php?showuser=";
$con = mysql_connect($host,$dbuser,$dbpass);
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }
mysql_select_db($dbname, $con);
 $result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");
while($row = mysql_fetch_array($result))
{
 echo "<img src="http://www.lonelyplanet.tv/images/icon_user-small.gif" alt="" /><b><a href=\"$url".$row['id']."\"></a></b>".$style;
 echo "<table width=\"163\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"153\" lign=\"left\">".$row['members_display_name']."</td><td width=\"10\" lign=\"left\">(".$row['posts'] .")</td></tr></table></a>";
 echo "</b>";

 }
 mysql_close($con);
?>

Posted

Palasi par eskeipošanu.

Šo daļu

echo "<img src="http://www.lonelyplanet.tv/images/icon_user-small.gif" alt="" />

nomaini uz šādu

echo "<img src=\"http://www.lonelyplanet.tv/images/icon_user-small.gif\" alt=\"\" /> ...

Posted

Ja tu dabū baltu lapu, tad ieliec šādas divas rindiņas pašā pašā skripta šākumā (pēc pirmā <?php):

error_reporting(E_ALL);
ini_set("display_erors", 1);

Tad redzēsi visus kļūdas paziņojumus, nevis baltu lapu.

Posted

tikuntā balta :(

 

 

mēģināju arī šeit ielikt

<?php

// DATU NORADISANA

$platums = "198.5"; // jaunumu platums pikselos

$forums = ""; // pilna adrese uz forumu

$limits = "13"; // topiku limits

$host = ""; // db hosts

$dbname = ""; // DB

$dbuser = ""; // db useris

$dbpass = ""; // db parole

?>

 

error_reporting(E_ALL);

ini_set("display_erors", 1);

<?php

$url = "http://witality.put.lv/forum/index.php?showuser=";

$con = mysql_connect($host,$dbuser,$dbpass);

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db($dbname, $con);

$result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");

while($row = mysql_fetch_array($result))

{

echo "<img src="http://www.lonelyplanet.tv/images/icon_user-small.gif" alt="" /><b><a href=\"$url".$row['id']."\"></a></b>".$style;

echo "<table width=\"163\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"153\" lign=\"left\">".$row['members_display_name']."</td><td width=\"10\" lign=\"left\">(".$row['posts'] .")</td></tr></table></a>";

echo "</b>";

 

}

mysql_close($con);

?>

Posted

Tu neesi izlabojis ko jau tev teica.

...
echo "<img src="http://www.lonelyplanet.tv/images/icon_user-small.gif" alt="" /><b><a href=\"$url".$row['id']."\"></a></b>".$style;
...

Posted

Es jau sākumā tā dariju neiet

p.s izskatijās šādi

 

error_reporting(E_ALL);
ini_set("display_erors", 1);
<?php
$url = "http://witality.put.lv/forum/index.php?showuser=";
$con = mysql_connect($host,$dbuser,$dbpass);
if (!$con)
 {
 die('Could not connect: ' . mysql_error());
 }
mysql_select_db($dbname, $con);
 $result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");
while($row = mysql_fetch_array($result))
{
 echo "<img src="http://www.lonelyplanet.tv/images/icon_user-small.gif" alt="" /><b><a href=\"$url".$row['id']."\"></a></b>".$style;
 echo "<table width=\"163\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"153\" lign=\"left\">".$row['members_display_name']."</td><td width=\"10\" lign=\"left\">(".$row['posts'] .")</td></tr></table></a>";
 echo "</b>";

 }
 mysql_close($con);
?>

Posted (edited)

32dcad835c73a4ab11a1fddae5f5b97f.png

man sanaca shita, bet kaut kadu erroru vel dod ara par [Notice: Undefined variable: style in C:\xampp\htdocs\tposters.php on line 25]

<?php
// DATU NORADISANA
$platums = "198"; // jaunumu platums pikselos
$forums = "http://mclaren.oo.lv/f"; // pilna adrese uz forumu
$limits = "5"; // topiku limits
$host = "localhost"; // db hosts
$dbname = "f"; // DB
$dbuser = "root"; // db useris
$dbpass = "izeed dirsu, kartigi paeed"; // db parole
?>
<?php
error_reporting(E_ALL);
ini_set("display_erors", 1);

$url = "http://mclaren.oo.lv/f/index.php?showuser=";
$con = mysql_connect($host,$dbuser,$dbpass);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db($dbname, $con);
$result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");
while($row = mysql_fetch_array($result))
{
echo "<table width=\"130\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"153\" lign=\"center\"><img src='http://www.lonelyplanet.tv/images/icon_user-small.gif' alt='face' />   ".$row['members_display_name']."</td><td width=\"10\" lign=\"left\">(".$row['posts'] .")</td></tr></table></a>";
echo "</b>";


}
mysql_close($con);
?>

Edited by Odyssey
Posted (edited)

Nu sproti, echo "izvada"skaitās, ka ir izvade beigusies un vēl + error.

Sākas izvade ar dubultpēdiņām un ar nākamajām beidzas, ja tās neekranē/neeskepo.

Viss kas ir aiz otrajām dubutpēdiņām(vispār man quote tīk labāk, nav kāds normālāks datortermins?), skaitās jau ne izvade, un php sāks psihot, ja nav echo normāli pabeigts.

Tātad lai php to neuzskata par izvades beigām, vajag, kā jau minēja eskeipot, jeb ekranēt, kā norādija ketchums(ceru niku uzrakstiju pareizi).

 

$var='bomba';

echo "Man ir paslēpta $var."; //Uzdrukās to (Man ir paslēpta bomba.), neko vairāk.

Tas nav nekāds HTML kur drīkst, bet nav labi tagus atvērt un tos aizvērs pats lietotāja pārlūks.

echo "izvade"; ir vai echo 'izvade'; vai echo {izvade};. -sintakse tāda ir.

Gribi iekļaut $var vērtību izvadei:

echo "Man ir paslēpta ".$var."."; ir vai echo 'Man ir paslēpta '.$var.'.';

Tie nav vienīgie varianti, man vairāk tīk echo 'uotput'; , bet tas tā.

Edited by mounkuls
×
×
  • Create New...