m8t Posted April 2, 2010 Report Share Posted April 2, 2010 (edited) Ak mī un žē. Nomaini $row['bilde'] ar $row['Imgurl'] un viss būs kārtībā. <img src="' . $row['Imgurl'] . '" alt="Bilde" /> Edited April 2, 2010 by m8t Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted April 2, 2010 Author Report Share Posted April 2, 2010 Nē tas vis man bija tikai te nepareizi iepostoju! Es pat izmēģināju tā <? echo '<img src="' . $row['Imgurl'] . '" alt="Bilde" />'; ?> Bit izvada tikai Nosaukumu Bilde alt="Bilde" Quote Link to comment Share on other sites More sharing options...
rATRIJS Posted April 2, 2010 Report Share Posted April 2, 2010 Iekš src tev ir jābūt ceļam uz bildi, piemēram http://localhost/public/images/bizha.png vai /public/images/bizha.png Quote Link to comment Share on other sites More sharing options...
m8t Posted April 2, 2010 Report Share Posted April 2, 2010 Viss ar karotīti jādod. Tavs skripts: <?php include "base.php"; ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Profils</title> </head> <body> <?php session_start(); $query = "SELECT id, Username, Imgurl FROM users"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "ID :{$row['id']} <br>" . "Lietotājvards : {$row['Username']} <br>" . "Bildes url : {$row['Imgurl']} <br><br>"; } ?> </body> </html> Pamaini Bildes url : {$row['Imgurl']} <br><br> uz <img src="{$row['Imgurl']}" alt="Bilde" /> Pārsteidzošā kartā bilde parādās!!!! Cik noprotu, tad tavs pašreizējais projekts nav nekas nopietns, tādēl neteikšu ka būtu īpaša jēga informāciju likt sessijās utt. Vienkārši pie katras bildes izvades lapas sākuma pieliec SQL konjekciju un vietā kur gribi bildi ieliec $query = "SELECT Imgurl FROM users"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<img src="{$row['Imgurl']}" alt="Bilde" />"; } Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted April 2, 2010 Author Report Share Posted April 2, 2010 Nekas vienkāršāks nevar būt par šo te? <img src="<?php session_start(); $query = "SELECT id, Username, Imgurl FROM users"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "{$row['Imgurl']}"; } ?>" /> m8t Ir tāda lieta ka neuzrādās! Quote Link to comment Share on other sites More sharing options...
waplet Posted April 2, 2010 Report Share Posted April 2, 2010 kpc tur ir vajadzīgs session start? Quote Link to comment Share on other sites More sharing options...
m8t Posted April 2, 2010 Report Share Posted April 2, 2010 Vai esi piekonektojies savai datubāzei? Cik saprotu, tad šī ir tava konekcija - <?php include "base.php"; ?>. Iemet viņu sākumā un viss ies. Quote Link to comment Share on other sites More sharing options...
Snaip3Rs Posted April 2, 2010 Author Report Share Posted April 2, 2010 Tāpat iet jo pārbaudiju vairākos veidos, bet negāja un atcerējos ka php skriptu ar varēja likt image tagos ne tikai tur vienu daļu! Es uzzināju ka ar šo vien nepietiks <?php echo "Bildes url : {$row['Imgurl']} <br><br>"; ?> Un pamanīju ka neizvada bildes linku tad izdomāju visu lieko lai nemaisa izdzēsīšu un atstāšu tikai linku un pielikšu klāt image un vis sanāca! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.