Kleine Vragen Topic #1

Gestart doorLennard4.284 reacties15.585 weergaven

4.285 berichten · pagina 43 van 286

Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
wrm log ik hier niet uit? emo
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();
}[/COLOR]
?>
<meta http-equiv="REFRESH" content="2; url=index.php" />


Ik snap dr niks van, en ik werk alleen met een sessie, niet met een cookie
0
Berichten
832
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bartv schreef:
wrm log ik hier niet uit? emo
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
    [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();
}[/COLOR]
?>
<meta http-equiv="REFRESH" content="2; url=index.php" />
Ik snap dr niks van, en ik werk alleen met een sessie, niet met een cookie

Gebruik gewoon unset($_SESSION[trixo])
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Heb je wel een session_start();?

Klinkt duf, maar die heb je nodig om een sessie te kunnen beëindigen.
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Heb je wel een session_start();?

Klinkt duf, maar die heb je nodig om een sessie te kunnen beëindigen.
ja zat ik ook al aan te denken, maar ik zal toch is nog een x includen, ik zal is ff kijken
emo, nu doet ie t wel, dan heb ik een vraag wrm dit het niet doet? emo
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]inc/inc.php[/COLOR][COLOR= #007700]);[/COLOR]
?>
<!DOCTYPE HTML SYSTEM>
<html>
<head>
<title>Trixo</title>
    <LINK REL=StyleSheet HREF="style.css" TYPE="text/css" MEDIA=screen>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
            [COLOR= #0000BB]<?php[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]]))
            {[/COLOR]
?>
        <div id="bwrapper">
            <div id="bcontainer">
                <div id="bhead">
                    <div id="hl"></div>
                    <div id="hcb"></div>
                    <div id="hr"></div>
                    <div style="clear:both;"></div>
                </div>
                <div id="ccb">
                    <div id="ccbl">
                                <b><u>Algemeen</u></b><br />
                                <u><a href="?p=a_home">Home</a></u><br />
                                <u><a href="?p=loguit">Uitloggen</a></u><br /><br />
                                <b><u>MWCZ App</u></b><br />
                                <u><a href="?p=mwcz_maken">Nieuws aanmaken</a></u><br />
                    </div>
                    <div id="ccbr">
                    [COLOR= #0000BB]<?php[/COLOR]
                    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]])
                    {[/COLOR]
                        [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]pagina/[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000].php[/COLOR][COLOR= #007700];[/COLOR]
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check[/COLOR][COLOR= #007700]))
                        {[/COLOR]
                            [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check[/COLOR][COLOR= #007700]);
                        }[/COLOR]
                        [URL="http://www.php.net/else"]else[/URL]
                        [COLOR= #007700]{[/COLOR]
                            [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]inc/404.php[/COLOR][COLOR= #007700]);
                        }
                    }[/COLOR]
                    [URL="http://www.php.net/else"]else[/URL]
                    [COLOR= #007700]{[/COLOR]
                        [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina/a_home.php[/COLOR][COLOR= #007700]);
                    }[/COLOR]
                    ?></div>
                    <div style="clear:both;"></div>
                </div>
            </div>
        </div>
[COLOR= #0000BB]<?php[/COLOR]
            [COLOR= #007700]}[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
?>
        <div id="wrapper">
            <div id="container">
                <div id="head">
                    <div id="hl"></div>
                    <div id="hc"></div>
                    <div id="hr"></div>
                </div>
            <div id="content">
            <div id="cc">
            [COLOR= #0000BB]<?php[/COLOR]
                [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina/home.php[/COLOR][COLOR= #007700]);[/COLOR]
            ?>
            </div>
            <div id="ce"></div>
        </div>
    </div>
</div>
            [COLOR= #0000BB]<?php[/COLOR]
            [COLOR= #007700]}[/COLOR]
            ?>
</body>
</html>


Waarom include ie dan niet die inc?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Hij bestaat niet? Wat staat er in die inc.php?
Kom eens op, doe eens wat meer vertellen....
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dit staat in inc:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]function.php[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [COLOR= #0000BB]$UserQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE id = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]trixo[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/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][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$UserQuery[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
    {[/COLOR]
        [URL="http://www.php.net/session_destroy"]session_destroy[/URL][COLOR= #007700]();[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<meta HTTP-EQUIV="REFRESH" content="0; url=index.php">[/COLOR][COLOR= #007700];
    }
}[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
?>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Waarom een metatag boven je doctype? Klopt niet wink

Op dit na, zie ik hier niet in waarom dit niet werkt. Om te kijken of het ingeladen wordt zou een simpele echo al kunnen voldoen.
0
Berichten
4.451
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik denk hierdoor, dit is de pagina, een JS spulletje:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]loggedIn[COLOR= #007700]() ===[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
?>
<script type="text/javascript">
function loguit() {
    $(#loguit2).load(pagina/ajax/loguit.php);
    $(#done).toggle();
}
</script>
<div id="loguit2" style="display:none;"></div>
<div id="done" style="display:none;">Je bent uitgelogd.
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]pagina/ajax/loguit.php[/COLOR][COLOR= #007700]))
{[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]Bestaat[/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[/COLOR][COLOR= #007700];
}[/COLOR]
?></div>
<strong>Weet je zeker dat je wilt uitloggen?</strong><br />
<button onclick="loguit()">Ja</button><a href="?p=a_home"><button>Nee</button></a>
[COLOR= #0000BB]<?php[/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[/COLOR][COLOR= #007700];
}[/COLOR]
?>


En vanuit daar doet ie t niet, ja nu wel met die include
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb dus een javascript functie, ik neem nu als voorbeeld de naam: JSFunctie

Hoe roep ik dat dan op tussen in PHP?
Zo:

if (statement)
{

//Hier wil ik hem oproepen

}
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Fanorg schreef:
Misschien wel door te Googelen
Wat een fantastische reactie. Eigenlijk zou ik je zelf twee stickertjes willen geven zeg emo
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik vind het niet:
Ik wil deze functie oproepen:

function alert ()
{
alert(Alert);
}
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
JS is client side, dus je zult het moeten echoen...

Als je data uit JS naar PHP wilt halen, dan zou je echt met AJAX moeten gaan werken...
0
Berichten
11.263
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
JS is client side, dus je zult het moeten echoen...

Als je data uit JS naar PHP wilt halen, dan zou je echt met AJAX moeten gaan werken...
Dan moet het op deze mannier:

echo "<script type="text/javascript">";
echo "aler(Alert)";
echo "</script>";
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
alert() dan wink
En waarom een string per regel? wink
0
Berichten
22.444
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Zodra jullie basen maken jullie dan voor teksten een aparte DIV aan in de css en vullen dan de waardes in.

En zetten dan in de html:

<div id="tekst">Hier komt de tekst</div>


Of werken jullie met h1, h2, h3 ?

En wat is er beter?
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren