dit is best makkelijk
maar bedoel je dan dat ze eerst op de titel moetten drukken en dat ze daarna naar de pagina gaan ?
Link gekopieerd
probeer een paginanummersscript is (op deze site, moet je even zoeken)
zoek link
en dan met de LIMIT werken (funtie van MySQL)
Link gekopieerd
Hé Vincent en Jason tof z`n snelle reactie
de bedoeling is dat
de pagina gevuld wordt met de info uit de database per aanmelding.
de inhoud van de site is dan
url
title
description
keywords
de mata tags nemen de title, descriptionen de keywords over.
en dan door tellen
Link gekopieerd
dat snap ik
maar moetten de gebruikers van de site eerst op een link drukken om de pagina met informatie te bezichtigen
of gaat dat zoals Jason zei ?
Link gekopieerd
correct
title = url
description
keywords
door op de title = url te klikken komen ze op de aangemelde site.
Link gekopieerd
Hoe heet de tabel waar je al die gegevens in hebt staan?
Link gekopieerd
Configuratie
<?
$host = 'jou host';
$db_user= 'jou database gebruikersnaam';
$db_pass = 'jou database wachtwoord';
$database = 'jou database';
?>
code om de pagina's op te roepen
<?
require_once('config.php');
$db_conn = mysql_connect($host,$db_user,$db_pass); if(!$db_conn) {echo "connection failed"; exit;}
mysql_select_db($database,$db_conn);
$query = "SELECT * FROM `tabel`"; if(!$query) {echo "query failed"; exit;}
$result = mysql_query($query) or die(mysql_error()); if(!$result) {echo "result failed"; exit;}
$num_results = mysql_num_rows($result);
for($i=0;$i<$num_results;$i++)
{
$title = $row['title'];
echo "<a href=\"joulink.php?link=".$title."\">".$title."</a>";
}
?>
om de gegevens op te halen kan je hetvolgende gebruiken.
kan je zelf in een leuk tabelletje gooien
<?
$title = $_GET['title'];
require_once('config.php');
$db_conn = mysql_connect($host,$db_user,$db_pass); if(!$db_conn) {echo "connection failed"; exit;}
mysql_select_db($database,$db_conn);
$query = "SELECT * FROM `tabel` WHERE title='$title'"; if(!$query) {echo "query failed"; exit;}
$result = mysql_query($query) or die(mysql_error()); if(!$result) {echo "result failed"; exit;}
$num_results = mysql_num_rows($result);
for($i=0;$i<$num_results;$i++)
{
$row = mysql_fetch_array($result);
$url = $row['url'];
$titel = $row['title'];
$desc = $row['description'];
$keyword = $row['keywords'];
}
?>
moet naar mijn weten werken
heb het zelf niet getest en een beetje snel in mekaar geflanst :P
vergeet niet de waardes te veranderen zodat ze kloppen ^^
Link gekopieerd
SELECT * FROM `gelderse_achterhoekpages
echo "<a href=\"index3.php?link=".$title."\">".$title."</a>";
bovenstaan aangepast naar mij situatie
ik krijg nix te zien alleen in de broncode staat:
<a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a><a href="index3.php?link="></a>
Link gekopieerd
hmm ja, k zie dat ik een klein typfoutje heb gemaakt
mijn excuses
de juiste code is
<?
$title = $_GET['title'];
require_once('config.php');
$db_conn = mysql_connect($host,$db_user,$db_pass); if(!$db_conn) {echo "connection failed"; exit;}
mysql_select_db($database,$db_conn);
$query = "SELECT * FROM `tabel` WHERE title='$title'"; if(!$query) {echo "query failed"; exit;}
$result = mysql_query($query) or die(mysql_error()); if(!$result) {echo "result failed"; exit;}
$num_results = mysql_num_rows($result);
for($i=0;$i<$num_results;$i++)
{
$row = mysql_fetch_array($result);
$url = $row['url'];
$title = $row['title'];
$desc = $row['description'];
$keyword = $row['keywords'];
}
?>
Link gekopieerd
Mogelijk is dit een goed uitgangs punt
dit presenteert alles in de database wat goed gekeurd is:
Nu wil ik slechts 1 vermelding per pagina
het mag ook zo dat alles zichtbaar is dan is de wens dat url naar een nieuwe presentatie wijst waar dan de :
url
title
description
keywords
worden weergegeven en de url verwijst naar de site
<?
flush();
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $bd);
$sql = mysql_query("SELECT {$prefix}pages.id, {$prefix}pages.url, {$prefix}pages.title, {$prefix}pages.description, {$prefix}pages.keywords, {$prefix}pages.accepted, {$prefix}pages.ip, {$prefix}pages.category, {$prefix}categories.name AS category_name FROM {$prefix}pages, {$prefix}categories WHERE {$prefix}categories.id = {$prefix}pages.category AND {$prefix}pages.accepted = 'y' ORDER BY {$prefix}pages.id");
$n_pages = mysql_num_rows($sql);
for ($x = 0; $x < $n_pages; $x++){
$pages[$x] = mysql_fetch_array($sql, MYSQL_ASSOC);
};
mysql_close();
if ($n_pages > 0){
echo ' <p style="margin-bottom: 0">
<B>Website`s in database:</B></p>
<p style="margin-bottom: 0">
<hr style="color: #dddddd; height: 1px; margin: 10px 0px" color="#dddddd" SIZE="1">'."\r\n";
for ($x = 0; $x < $n_pages; $x++){
echo '<P><A HREF="'.$pages[$x]["url"].'" TARGET="_blank"><B>'.$pages[$x]["title"].'</B></A>'."\r\n";
echo 'Rubriek: <A HREF="index.php?c='.$pages[$x]["category"].'">('.$pages[$x]["category_name"].')</A><BR>'."\r\n";
if ($pages[$x]["ip"]){
echo ''."\r\n";
};
echo '<BR>'.$pages[$x]["description"]."\r\n";
echo '<BR>Keywords: '.$pages[$x]["keywords"]."\r\n";
echo '<BR>'.$pages[$x]["url"]."\r\n";
};
};
?>
Link gekopieerd