Link ophalen en laten zien
Paul du Long
08/11/2005 20:45:00Ik wil als je de naam van de website intikt een link uit een database halen en in een frame zetten de tabel is links_links de link is url en de titel van de site ( de naam ) title
Wat is hieronder fout aan ????
<form name="visit" method="post" action="">
<input type="text" name="url">
<input type="submit" name="submit" value="bekijk">
</form>
Wat is hieronder fout aan ????
<form name="visit" method="post" action="">
<input type="text" name="url">
<input type="submit" name="submit" value="bekijk">
</form>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$dbConnect = mysql_connect("sql04.backbone.tiscomhosting.nl", "****", "****") or die ("Verbinding mislukt");
mysql_select_db("****l", $dbConnect);
if (isset($_POST['url'])){
$titel_sql = "SELECT url FROM wsnlinks_links WHERE titel=" . $_POST['url'];
$ditisdelink = mysql_query($titel_sql) or die (mysql_error());
$fe = mysql_fetch_assoc($ditisdelink);
echo "<iframe width='80%' height='80%' src='".$fe['url']."'>";
}
?>
$dbConnect = mysql_connect("sql04.backbone.tiscomhosting.nl", "****", "****") or die ("Verbinding mislukt");
mysql_select_db("****l", $dbConnect);
if (isset($_POST['url'])){
$titel_sql = "SELECT url FROM wsnlinks_links WHERE titel=" . $_POST['url'];
$ditisdelink = mysql_query($titel_sql) or die (mysql_error());
$fe = mysql_fetch_assoc($ditisdelink);
echo "<iframe width='80%' height='80%' src='".$fe['url']."'>";
}
?>