Nog tips voor dit script?

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Jaha

Jaha

06/01/2006 12:05:00
Quote Anchor link
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php session_start(); ?>

<html>
<head>
<meta http-equiv="Content-Language" content="nl">
<meta http-equiv="Content-Type" content="text/html">
<meta name="Title" content="- WesselB.nl | The chat page! -">
<meta name="Author" content="Wessel B">
<meta name="Subject" content="Fun">
<meta name="Description" content="- WesselB.nl | The chat page! -">
<meta name="Keywords" content="wesselb, site, kids, wessel, fun, chat">
<meta name="Language" content="Dutch">
<meta name="Robots" content="All">
<link rel="shortcut icon" href="../Plaatjes/Favicon.ico">
<script type="text/javascript" language="JavaScript">
function Status_Run_1(run)
{
if (run == "run")
{
window.status = "WesselB.nl! | The chat page! News! -
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php include 'Text/News.txt'; ?>
- ! !";
setTimeout("Status_Run_2('run')",10);
}
else
{
alert("Lock on status...");
}
}

function Status_Run_2(run)
{
if (run == "run")
{
window.status = "WesselB.nl! | The chat page! News! -
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php include 'Text/News.txt'; ?>
- ! !";
setTimeout("Status_Run_1('run')",10);
}
else
{
alert("Lock on status...");
}
}

Status_Run_1('run');

function Titel_Run_1(run)
{
if (run == "run")
{
document.title = "WesselB.nl! | The chat page!";
setTimeout("Titel_Run_2('run')",1000);
}
else
{
alert("Lock on title...");
}
}

function Titel_Run_2(run)
{
if (run == "run")
{
document.title = "WesselB.nl! | The chat page!!";
setTimeout("Titel_Run_1('run')",1000);
}
else
{
alert("Lock on title...");
}
}

Titel_Run_1('run');

function goLoc(loc)
{
document.location = loc;
}

function ReLoad()
{
document.location = document.location;
}

function GoToTop()
{
document.location = "#topofthepage";
}

function GoToDown()
{
document.location = "#downofthepage";
}
</script>
<style type="text/css">
BODY
{
font-family: Arial, Sans Serif;
font-size: 15;
color: #000000;
scrollbar-arrow-color: #000000;
scrollbar-base-color: #969696;
scrollbar-dark-shadow-color: #FFFFFF;
scrollbar-face-color: #FFFFFFF;
scrollbar-highlight-color: #FFFFFF;
scrollbar-shadow-color: #FFFFFF;
}

HR
{
color: #000000;
}

INPUT
{
font-family: Arial, Sans Serif;
font-size: 14;
border-color: #000000;
border-style: solid;
border-width: 1;
background-color: #FFFFFF;
color: #000000;
}

INPUT.knop
{
font-family: Arial, Sans Serif;
font-size: 12;
border-color: #000000;
border-style: solid;
border-width: 1;
background-color: #FFFFFF;
color: #000000;
}

A
{
text-decoration: none;
color: #000000;
}

A:hover
{
text-decoration: none;
color: #FF0000;
}

table.basis
{
border-width: 0;
background-color: #FFFFFF;
}

table.knop
{
border-width: 1;
background-color: #969696;
border-style: solid;
border-color: #000000;
}
</style>
<title>
- WesselB.nl | The chat page! -
</title>
</head>
<body>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
            $ipdat
['fopen'] = fopen('IP/IPS.ips','a+');
            fclose(fopen('IP/BlokIPS.ips','a+'));
            $ipdatf = file('IP/BlokIPS.ips');
            $ipdat['count'] = count($ipdatf);
            
            for ($nr = 1; ($nr <= $ipdat['count']-1); $nr++)
            {

                $adressen = explode(';',$ipdatf[($nr-1)]);
                if ($_SERVER['REMOTE_ADDR'] == $adressen[0])
                {

                    echo '<script type="text/javascript" language="JavaScript">
                    document.location="IP/IP-Blok.php";</script>'
;
                }
            }

            $paginas = fopen('IP/PaginaOphaal_Teller.ips','a+');
            fwrite($paginas,'
'
);
            fclose($paginas);
            
            fwrite($ipdat['fopen'],'IP --> '.$_SERVER['REMOTE_ADDR'].'<-- om tijd --> '.date('H:i:s').' <-- en datum --> '.date('d-m-Y').' <--.<br />
'
);
            fclose($ipdat['fopen']);
            
            switch ($_GET['p'])
            {
                case
'h_home':
        ?>

<table class="basis" height="100%" width="100%">
<tr height="100%" width="100%">
<td height="100%" width="100%">
<div align="center">
Deze pagina wordt weergeven als een link niet werkt of de pagina bestaat niet.
<br />
Om terug te gaan klik
<a href="index.php">
hier<font color="#000000">.</font>
</a>
</div>
</td>
</tr>
</table>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
<?php
                    break;
                case
'logout':
                    unset($_SESSION['log']);
                    echo '<script type="text/javascript" language="JavaScript">document.location="index.php";</script>';
                    break;
                case
'login':
                ?>

<table class="basis" height="100%" width="100%">
<tr height="100%" width="100%">
<td height="100%" width="100%">
<div align="center">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
                    echo 'Even wachten...<br /><br />';
                    $_file = file('Login/Logins.txt');
                    $us = $_POST['user'];
                    $ps[0] = $_POST['pas'];
                    $nr = 1;
                    while ($nr <= count($_file))
                    {

                        $pss = explode(';',$_file[($nr-1)]);
                        if (!($nr == count($_file)))
                        {

                            $ps[1] = substr($pss[1],0,(strlen($pss[1])-2));
                        }

                        else
                        {
                            $ps[1] = $pss[1];
                        }

                        if ($us == $pss[0] && $ps[0] == $ps[1])
                        {

                            $userfound = '';
                            $_SESSION['log'] = $pss[0];
                            echo 'User gevonden! <a href="index.php?p=user">Verder<font color="#000000">...</font></a>';
                            break;
                        }

                        $nr++;
                    }

                    if (!(isset($userfound)))
                    {

                        echo 'Geen user gevonden.<br /><a href="index.php">Terug<font color="#000000">...</font></a>';
                        unset($userfond);
                    }

                    break;
                ?>

</div>
</td>
</tr>
</table>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                case 'user':
                    if(isset($_SESSION['log']))
                    {

                        ?>

<a name="#topofthepage"></a>
<table class="base">
<tr>
<td>
<table class="knop">
<tr>
<td>
<a href="index.php?p=user">
Home
</a>
</td>
</tr>
</table>
</td>
<td>
<table class="knop">
<tr>
<td>
<a href="javascript:GoToDown()">
Down
</a>
</td>
</tr>
</table>
</td>
<td>
<table class="knop">
<tr>
<td>
<a href="index.php?p=user&p_id=algemeen_forum">
Algemeen forum
</a>
</td>
</tr>
</table>
</td>
<td>
<table class="knop">
<tr>
<td>
<a href="index.php?p=user&p_id=poll">
Poll
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<hr />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'algemeen_forum')
                            {

                                ?>

<b>
Algemeen forum
</b>
<br /><br />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'webbeheer' && $_SESSION['log'] == 'wesselb')
                            {

                                ?>

<b>
Webbeheer
</b>
<br /><br />
<a href="index.php?p=user&p_id=html_editor">
[ Html editor ]
</a>
<br /><br />
Aantal pagina's opgehaald:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo (count(file('IP/PaginaOphaal_Teller.ips'))-1); ?>

<input type="button" value="Reset" name="knop" class="knop" OnClick="javascript:goLoc('index.php?p=user&p_id=reset_ophaalteller');" />
<br /><br />
Alle bezoek met IP(server:remote_addr) en datum:
<br />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
                                include "IP/IPS.ips";
                                ?>

<input type="button" value="Reset" name="knop" class="knop" OnClick="javascript:goLoc('index.php?p=user&p_id=reset_ips');" />
<input type="button" value="Blok IP" name="knop" class="knop" OnClick="javascript:goLoc('index.php?p=user&p_id=webbeheer-voegtoe_blok_ip');" />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'poll')
                            {

                                ?>

<b>
Poll
</b>
<br /><br />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'reset_ophaalteller' && $_SESSION['log'] == 'wesselb')
                            {

                                ?>

Bezig...
<br />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
                                fclose(fopen('IP/PaginaOphaal_Teller.ips','w'));
                                ?>

<a href="index.php?p=user&p_id=webbeheer">[ Voltooi ]</a>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'html_editor' && $_SESSION['log'] == 'wesselb')
                            {

                                ?>

<b>
Html editor
</b>
- Open file
<br /><br />
<a href="index.php?p=user&p_id=html_editor-nieuws">
Een regel nieuws
</a>
<br />
<a href="index.php?p=user&p_id=html_editor-login_home">
Login home
</a>
<br /><br />
<a href="index.php?p=user&p_id=webbeheer">
Terug
</a>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'html_editor-nieuws' && $_SESSION['log'] == 'wesselb')
                            {

                                if (isset($_POST['text']) && ereg('^[a-zA-Z0-9_!.? ]{1,}$',$_POST['text']))
                                {

                                    fclose(fopen('Text/News.txt','w'));
                                    $dat = fopen('Text/News.txt','a+');
                                    fwrite($dat,$_POST['text']);
                                    fclose($dat);
                                }

                                else
                                {
                                    echo 'Kan niet wijzigen...<br /><br />';
                                }

                                ?>

<b>
Html editor
</b>
- Edit file - Een regel nieuws
<br />
<form action="index.php?p=user&p_id=html_editor-nieuws" method="POST">
<input type="text" value="
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php include 'Text/News.txt'; ?>
" name="text" size="40" />
<br />
<input type="submit" value="Save">
</form>
<br />
<a href="index.php?p=user&p_id=html_editor">
Terug
</a>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'html_editor-login_home' && $_SESSION['log'] == 'wesselb')
                            {

                                if (isset($_POST['text']))
                                {

                                    fclose(fopen('Text/Login_Home.txt','w'));
                                    $dat = fopen('Text/Login_Home.txt','a+');
                                    fwrite($dat,$_POST['text']);
                                    fclose($dat);
                                }

                                else
                                {
                                    echo 'Kan niet wijzigen...<br /><br />';
                                }

                                ?>

<b>
Html editor
</b>
- Edit file - Login home
<br />
<form action="index.php?p=user&p_id=html_editor-login_home" method="POST">
<textarea name="text" cols="50" rows="7">
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php include 'Text/Login_Home.txt'; ?>
</textarea>
<br />
<input type="submit" value="Save">
</form>
<br />
<a href="index.php?p=user&p_id=html_editor">
Terug
</a>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'webbeheer-voegtoe_blok_ip' && $_SESSION['log'] == 'wesselb')
                            {

                                if (isset($_POST['ip1']) && isset($_POST['ip2']) && $_POST['ip1'] == $_POST['ip2'] && !($_POST['ip1'] == ''))
                                {

                                    $dat = fopen('IP/BlokIPS.ips','a+');
                                    fwrite($dat,$_POST['ip1'].';
'
);
                                    fclose($dat);
                                    echo 'Geblokt!<br /><br />';
                                }

                                else
                                {
                                    echo 'Kan niet toevoegen...<br /><br />';
                                }

                                ?>

<b>
Blok IP
</b>
<br />
<form action="index.php?p=user&p_id=webbeheer-voegtoe_blok_ip" method="POST">
IP : <input type="text" name="ip1" size="10"><br />
Bevestiging IP : <input type="text" name="ip2" size="10">
<br />
<input type="submit" value="Blok">
</form>
<br />
<a href="index.php?p=user&p_id=webbeheer">
Terug
</a>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            if (isset($_GET['p']) && $_GET['p'] == 'user' && isset($_GET['p_id']) && $_GET['p_id'] == 'reset_ips' && $_SESSION['log'] == 'wesselb')
                            {

                                ?>

Bezig...
<br />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
<?php
                                fclose(fopen('IP/IPS.ips','w'));
                                ?>

<a href="index.php?p=user&p_id=webbeheer">[ Voltooi ]</a>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            if (!(isset($_GET['p_id'])) && isset($_GET['p']) && $_GET['p'] == 'user')
                            {

                                ?>

<b>
Welkom
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<?php echo $_SESSION['log']; ?>
op het forum!
</b>
<br /><br />
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
                                include "Text/Login_Home.txt";
                            }

                        ?>

<a name="#downofthepage"></a>
<hr />
<table class="base">
<tr>
<td>
<table class="knop">
<tr>
<td>
<a href="index.php?p=logout">
Logout
</a>
</td>
</tr>
</table>
</td>
<td>
<table class="knop">
<tr>
<td>
<a href="javascript:ReLoad()">
Refresh
</a>
</td>
</tr>
</table>
</td>
<td>
<table class="knop">
<tr>
<td>
<a href="javascript:GoToTop()">
Top
</a>
</td>
</tr>
</table>
</td>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
                            if (isset($_SESSION['log']) && $_SESSION['log'] == 'wesselb')
                            {

                        ?>

<td>
<table class="knop">
<tr>
<td>
<a href="index.php?p=user&p_id=webbeheer">
Webbeheer
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
<?php
                            }
                            else
                            {
                        ?>

</tr>
</table>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
<?php    
                            }
                    }

                    else
                    {
                        echo '<script type="text/javascript" language="JavaScript">document.location="index.php";</script>';
                    }

                    break;
                default:

        ?>

<table class="basis" height="100%" width="100%">
<tr height="100%" width="100%">
<td height="100%" width="100%">
<div align="center">
<form action="index.php?p=login" method="POST">
<b>
Login
</b>
<br />
User :
<input name="user" type="text" value="" />
<br />
Pass :
<input name="pas" type="password" value="" />
<br />
<input type="submit" class="knop" name="knop" value="Login" />
<input type="button" class="knop" name="knop" value="Maak account"
OnClick="javascript:goLoc('index.php?p=m_account');" /><br /><br />
<input type="button" class="knop" name="knop" value="Waarom ben ik hier?"
OnClick="javascript:goLoc('index.php?p=h_home');" />
</form>
</div>
</td>
</tr>
</table>
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<?php
                break;
            }

        ?>

</body>
</html>
 
PHP hulp

PHP hulp

04/12/2024 20:11:59
 
Frank -

Frank -

06/01/2006 12:13:00
Quote Anchor link
- Haal de css uit je script en zit dit in een extern stylesheet. Dat maakt je script een stuk overzichtelijker en je kunt je stylesheet ook voor andere pagina's gebruiken. Dat maakt het onderhoud ook een stuk eenvoudiger.
- Voor de Javascript kun je dit ook overwegen.
- Begin je script met al je php-code en zet dan pas aan het einde je html-code. Daarin neem je dan alleen de benodigde echo's op, maar geen functies e.d. Deze staan aan het begin van je script.
- Begin al je scripts altijd met error_reporting(E_ALL);
- Ik ben niet in de Javascript gedoken, maar je webpagina mag daar (in mijn ogen) niet van afhankelijk zijn. Werkt jouw pagina ook zonder Javascript?
 
Jaha

Jaha

06/01/2006 12:15:00
Quote Anchor link
ja
 
Jaha

Jaha

06/01/2006 12:17:00
Quote Anchor link
en bedankt
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.