Pereiti prie turinio

php kategorijos info index'e rodo, o paspaudus ne


Rekomenduojami pranešimai

Man reikia, kad ten kur padariau, kad įrašyčiau skelbimą, man skelbimo info rodytų ne tik index.php, bet ir paspaudus ant to skelbimo antraštės,prašau, padėkit..

 

ĮDĖJIMAS:

<?php

if(isset($_POST['name'], $_POST['description']) and $_POST['name']!='')

{

$name = $_POST['name'];

$description = $_POST['description'];

if(get_magic_quotes_gpc())

{

$name = stripslashes($name);

$description = stripslashes($description);

}

$name = mysql_real_escape_string($name);

$description = mysql_real_escape_string($description);

if(mysql_query('insert into categories (id, name, description, position) select ifnull(max(id), 0)+1, "'.$name.'", "'.$description.'", count(id)+1 from categories'))

{

?>

<div class="message">Skelbimas sėkmingai įdėtas, jį galima pamatyti pagrindiniame puslapyje.<br />

<a href="<?php echo $url_home; ?>">Pagrindinis puslapis</a></div>

<?php

}

else

{

echo 'An error occured while creating the category.';

}

}

else

{

?>

<form action="add_ad.php" method="post">

<label for="name">Pavadinimas</label><input type="text" name="name" id="name" /><br />

<label for="description">Aprašymas</label><br />

<textarea name="description" id="description" cols="70" rows="6"></textarea><br />

<input type="submit" value="Create" />

</form>

<?php

}

 

 

 

 

 

 

 

 

INDEX`E

 

 

 

 

<table

>

<tr>

<th

>Skelbimas</th>

</tr>

 

<tr>

<?php

$dn1 = mysql_query('select c.id, c.name, c.description, c.position, (select count(t.id) from topics as t where t.parent=c.id and t.id2=1) as topics, (select count(t2.id) from topics as t2 where t2.parent=c.id and t2.id2!=1) as replies from categories as c group by c.id order by c.position asc');

$nb_cats = mysql_num_rows($dn1);

while($dnn1 = mysql_fetch_array($dn1))

 

{

?>

<td><a href="ad.php?parent=<?php echo $dnn1['id']; ?>" class="title"><?php echo htmlentities($dnn1['name'], ENT_QUOTES, 'UTF-8'); ?></a>

<div class="description"><?php echo $dnn1['description']; ?></div></td>

 

</tr>

<?php

}

?>

</table>

 

http://image.prntscr.com/image/1965be794ddb44b1a559193d39ee2769.png

Redagavo Mantas2173
Nuoroda į pranešimą
Dalintis kituose puslapiuose

<a href="ad.php?parent=<?php echo $dnn1['id']; ?>" class="title"><?php echo htmlentities($dnn1['name'], ENT_QUOTES, 'UTF-8'); ?></a> 

 

sita vieta perasyti galima bandyti sitaip, jei gerai supratau kad nuoroda blogai nukreipia

 

<?php echo "<a href='ad.php?parent=".$dnn1['id']."' class='title'>". htmlentities($dnn1['name'], ENT_QUOTES, 'UTF-8') ."</a>";?> 

Redagavo nerjok
Nuoroda į pranešimą
Dalintis kituose puslapiuose

Prisijunkite prie diskusijos

Jūs galite rašyti dabar, o registruotis vėliau. Jeigu turite paskyrą, prisijunkite dabar, kad rašytumėte iš savo paskyros.

Svečias
Parašykite atsakymą...

×   Įdėta kaip raiškusis tekstas.   Atkurti formatavimą

  Only 75 emoji are allowed.

×   Nuorodos turinys įdėtas automatiškai.   Rodyti kaip įprastą nuorodą

×   Jūsų anksčiau įrašytas turinys buvo atkurtas.   Išvalyti redaktorių

×   You cannot paste images directly. Upload or insert images from URL.

Įkraunama...
  • Dabar naršo   0 narių

    Nei vienas registruotas narys šiuo metu nežiūri šio puslapio.

×
×
  • Pasirinkite naujai kuriamo turinio tipą...