heya
ik heb een random link script gemaakt en deel hem hier gratisch
config.inc.php
handler.class.php
index.php
plaats.php
admin/index.php
sql
voor de luie mensen : http://www.qago.nl/random.zip
Dit script mag niet verkocht worden en ook niet aangeboden worden op jouw website zonder mijn toestemming
in de volgende versie komen meerdere funties
voor vragen pm me
ik heb een random link script gemaakt en deel hem hier gratisch
config.inc.php
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
++++++++++++++++++
+ Config.inc.php +
++++++++++++++++++
Daimans Random Link systeem
Copyright 2010 - 2011 © HelpMijnSite.net
*/[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]handler.class.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$server[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"localhost"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Mysql server[/COLOR]
[COLOR= #0000BB]$database[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Database[/COLOR]
[COLOR= #0000BB]$gebruikersnaam[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// mysql gebruikersnaam[/COLOR]
[COLOR= #0000BB]$wachtwoord[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// Mysql wachtwoord[/COLOR]
[COLOR= #0000BB]$mysql_conn[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_connect"]mysql_connect[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"$server"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"$gebruikersnaam"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"$wachtwoord"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/mysql_select_db"]mysql_select_db[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"$database"[/COLOR][COLOR= #007700]);[/COLOR]
?> handler.class.php
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
++++++++++++++++++++++
+ handler.class.php +
++++++++++++++++++++++
Daimans Error handler
Copyright 2010 - 2011 © HelpMijnSite.net
*/[/COLOR]
[COLOR= #007700]function[/COLOR] error_handler[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fout[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$fout_string[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$bestand[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$lijn[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<title>Error in php!</title><div STYLE="background-color: red; color: white;"><b>Datum en tijd</b> : "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"m-d-Y H:i:s"[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]" <br><b>Fout</b> : $fout_string<br> <b>bestand</b> : $bestand
<br><b>lijn</b> : $lijn.<br><b>Host</b> : $_SERVER[HTTP_HOST]<br><b>Client ip</b> : $_SERVER[REMOTE_ADDR]<br></div><br>"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/set_error_handler"]set_error_handler[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]error_handler[/COLOR][COLOR= #007700]);[/COLOR]
?> index.php
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
++++++++++++++++++
+ index.php +
++++++++++++++++++
Daimans Random Link systeem
Copyright 2010 - 2011 © HelpMijnSite.net
*/[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.inc.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sqlq[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM links"[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$eind[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqlq[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$rand[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$eind[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM links WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$rand[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sqlq[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a href="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</a>[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Er zijn geen links![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br><br>Plaats jouw link ook klik <a href="plaats.php">hier</a>[/COLOR][COLOR= #007700];[/COLOR]
?> plaats.php
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
++++++++++++++++++
+ plaats.php +
++++++++++++++++++
Daimans Random Link systeem
Copyright 2010 - 2011 © HelpMijnSite.net
*/[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.inc.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<form name="form1" method="post" action="">
Link : <input type="text" name="link"><br>
Tekst : <input type="text" name="tekst"><br>
<input type="submit" name="Submit" value="Plaats">
</form>
[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$qu[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO links(link,tekst) VALUES("[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$qu[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Uw link is succesvol toegevoegd![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je link kon niet worden toegevoegd![/COLOR][COLOR= #007700];
}
}[/COLOR]
?> admin/index.php
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]/*
++++++++++++++++++
+ index.php +
++++++++++++++++++
Daimans Random Link systeem
Copyright 2010 - 2011 © HelpMijnSite.net
*/[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]../config.inc.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM links"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]del[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$qu[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM links WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]del[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$qu[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Succesvol verwijderd![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Verwijderen is mislukt![/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]edit[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM links WHERE id="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]edit[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
<form name="form1" method="post" action="?edit=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]edit[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">
Link : <input type="text" name="link" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><br>
Tekst : <input type="text" name="tekst" value="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"><br>
<input type="submit" name="Submit" value="Bewerk">
</form>
[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]]) && ![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$qu[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE links SET link=$_POST[link], tekst=$_POST[tekst] WHERE id=$_GET[edit]"[/COLOR][COLOR= #007700])[/COLOR] OR [URL="http://www.php.net/DIE"]DIE[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$qu[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Succesvol bewerkt![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]bewerken mislukt![/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Niet alle velden zijn ingevuld![/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<table width="794" border="1">
<tr>
<td width="256"><strong>Link</strong></td>
<td width="256"><strong>Tekst</strong></td>
<td width="260"><strong>Actie</strong></td>
</tr>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<tr><td width="256">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]link[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td><td width="256">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]tekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]</td> <td width="260"><a href="?del=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">Verwijder</a> || <a href="?edit=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$row[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">Bewerk</a></td></tr>[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</table>[/COLOR][COLOR= #007700];
}[/COLOR]
?> sql
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Machine: localhost
-- Genereertijd: 25 Jul 2010 om 17:51
-- Serverversie: 5.1.41
-- PHP-Versie: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `random_link`
--
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `links`
--
CREATE TABLE IF NOT EXISTS `links` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`link` varchar(255) NOT NULL,
`tekst` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Gegevens worden uitgevoerd voor tabel `links`
--
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; voor de luie mensen : http://www.qago.nl/random.zip
Dit script mag niet verkocht worden en ook niet aangeboden worden op jouw website zonder mijn toestemming
in de volgende versie komen meerdere funties
voor vragen pm me
