PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    html&css in user pages

    Share
    avatar
    Grim

    Number of posts : 5
    Age : 30
    Localisation : Finland, Kuopio
    Registration date : 2009-04-08

    html&css in user pages

    Post  Grim on Wed Apr 08, 2009 6:37 am

    I have downloaded the login system and installed it to my website. It works very well and seems to be what I have been looking for. When I decided to start pimping the site I found out problem that can not be solved with my skills, so I registered myself here to ask some help since Jpmaster77 seemed to disappear long ago from evolt.

    I can not get the pages work with html and css if there is session logged in with or without included session.php. In my userpage is tables, css, javascript etc. How can I make them work with your script (pages allowed only for registered users)? Like a Star @ heaven
    I believe this is simpler than I think, but still can not figure it out. I have been trying many different things with codes about week right now and starting to feel frusturated. No

    Ps. Sorry for my broken english, I'm from finland.
    avatar
    Linchpin311

    Number of posts : 220
    Age : 33
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: html&css in user pages

    Post  Linchpin311 on Wed Apr 08, 2009 6:56 am

    welcome! its nice to see many different parts of the world represented in our forum.

    php works well with HTML CSS Javascript and many other languages. im not sure why its not working for you but i would think you have an error in your code somewhere. without knowing what kind of error or in which language the error exists its kind of hard to plan out a course of action for you. can you give me more information about exactly what isnt working. what should you be seeing and what are you actually seeing?


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    Grim

    Number of posts : 5
    Age : 30
    Localisation : Finland, Kuopio
    Registration date : 2009-04-08

    Re: html&css in user pages

    Post  Grim on Wed Apr 08, 2009 7:19 am

    Thankies. Smile

    So, here is my index page at the moment (this is virtual RP site). There is login form and it seems to work. When it submits it goes to main.php page which is my problem. HTML is made with frontpage -program, so the html part of the code may have much not-needed extra things.
    Code:
    <?
    include("include/session.php");
    ?>


    <style type="text/css">

    #hintbox{
    position:absolute;
    top: 0;
    background-color: #0f110d;
    width: 150px;
    padding: 3px;
    border:1px solid #421702;
    font:normal 11px Verdana;
    line-height:18px;
    z-index:100;
    visibility: hidden;
    color:f59743;
    }

    .hintanchor{
    text-decoration: none;
    text-transform: none;
    color: #F29027;
    font-weight: none;
    }

    </style>

    <script type="text/javascript">
          
    var horizontal_offset="9px"


    var vertical_offset="0"
    var ie=document.all
    var ns6=document.getElementById&&!document.all

    function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
    parentEl=parentEl.offsetParent;
    }
    return totaloffset;
    }

    function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }

    function clearbrowseredge(obj, whichedge){
    var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
    if (whichedge=="rightedge"){
    var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
    dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
    if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
    }
    else{
    var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
    dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
    if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
    edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
    }
    return edgeoffset
    }

    function showhint(menucontents, obj, e, tipwidth){
    if ((ie||ns6) && document.getElementById("hintbox")){
    dropmenuobj=document.getElementById("hintbox")
    dropmenuobj.innerHTML=menucontents
    dropmenuobj.style.left=dropmenuobj.style.top=-500
    if (tipwidth!=""){
    dropmenuobj.widthobj=dropmenuobj.style
    dropmenuobj.widthobj.width=tipwidth
    }
    dropmenuobj.x=getposOffset(obj, "left")
    dropmenuobj.y=getposOffset(obj, "top")
    dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
    dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
    dropmenuobj.style.visibility="visible"
    obj.onmouseout=hidetip
    }
    }

    function hidetip(e){
    dropmenuobj.style.visibility="hidden"
    dropmenuobj.style.left="-500px"
    }

    function createhintbox(){
    var divblock=document.createElement("div")
    divblock.setAttribute("id", "hintbox")
    document.body.appendChild(divblock)
    }

    if (window.addEventListener)
    window.addEventListener("load", createhintbox, false)
    else if (window.attachEvent)
    window.attachEvent("onload", createhintbox)
    else if (document.getElementById)
    window.onload=createhintbox

    </script>



    <SCRIPT LANGUAGE="JavaScript">
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=550');");
    }
    </script>

    <head>


    <title>>> Siperia - by Grimhild</title>
    <link rel="Shortcut Icon" href="" type="image/x-icon" />
    <LINK href="style.css" title="style" rel="stylesheet" type="text/css">

    <body style="background-image: url('bgn.gif')"><center><br>

    <table valign=top cellpadding=0 cellspacing=0 border=0 width=795 class=stats>
    <tr><td valign=top class=top>
    <table width=795 height=159 cellpadding=2>
    <tr>
    <td width=530> </td>
    <td width=255>


    <form action="process.php" method="POST">
    <table class=susi width=236 height=118><tr><td colspan=3>
    <h1>Kirjaudu</h1><center>
    <p></p>
      </tr></td>
    <tr><td>Tunnus:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
    <tr><td>Salasana:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>

    <tr><td colspan=2>
    <center><input type=submit name=submit value=Sisään></center></tr></td></table>
    </form></center>


    </td></tr></table>


    <tr><td bgcolor=white valign=top>

    <IMG SRC="outtop.gif"
    <br width="795" height="11">

    <TABLE WIDTH=100% CELLPADDING=1 CELLSPACING=3 valign=top>
    <tr><td valign=top>
    <table width=150 cellpadding=0 cellspacing=0 valign=top height=100%>

    <TR><TD valign=top align=center>
      <img src=ttop.gif width="150" height="10"></tr></td><TR>
      <TD valign=top background=tbbg.gif>
    <h2>Tervetuloa</h2>

    - <strike>Vieraskirja</strike>
    [<a href=index.php class="hintanchor" onMouseover="showhint('Vieraskirja on toistaiseksi suljettu, mutta pidä sivustoa silmällä, sillä viekku avataan pian.', this, event, '150px')">?</a>]<br>
    - <strike>Liittyminen</strike>
    [<a href=index.php class="hintanchor" onMouseover="showhint('Liittyminen on toistaiseksi suljettu, mutta pidä sivustoa silmällä, sillä liityminen avataan pian.', this, event, '150px')">?</a>]

    <br><br>

    - <a href=siperia.php>Siperia</a><br>

    - <a href=roolipeli.php>Roolipeli-info</a><br>
    - <strike>Peli chat</strike> [<a href=index.php class="hintanchor" onMouseover="showhint('Peli chat on näkyvillä vain rekisteröityneille jäsenille!', this, event, '150px')">?</a>]

    <br>
    - <a href=sarjakuva.php>Sarjakuva</a>   <br>
    - <a href=taide.php>Muu taide</a> <br>
    - <a href="fanart.php">FanArt</a>
    <br><br>

    <h2>tilanne</h2>
    <font color="#8B98BD"><b>Sarjakuvan sivuja:</b></font> 3<br><font color="#8B98BD"><b>Pelaajia:</b> </font> 43<br><font color="#8B98BD"><b>Hahmoja:</b> </font>
    47<br><br>


    <h2>sarjakuva</h2><center>
    <form action="sarjakuva.php" method="post">
    <style>
    .donate {
    color: #000000;
    background: transparent;
    border: solid black 0px;
    }
    </style>

    <form action="sarjakuva.php" method="post">
    <input type="image" class="donate" src="sarjakuva.png" border="0" name="submit" alt="Klikkaa päästäksesi lukemaan" width="120" height="176">
    </form>
    Lue sarjakuvaa!<br>
    </tr></td><TR><TD valign=top align=center>
      <img src=tbot.gif width="150" height="10"></tr></td></table>

    <br><br>
    </TD>

    <TD valign=top><DIV ALIGN=JUSTIFY valign=top>
    <div align=justify>


         <center><b>Sarjakuvan neljäs sivu ilmestyy pian!<br><br><br></b>
    </center>

    <h1>SIPERIA - Tervetuloa</h1>
          <p style="margin-left: 20; margin-right: 20">
          <br>
          Olet saapunut Grimhildin (ShadowKiro) ylläpitämille sarjakuva-taide-roolipeli sivustolle.
          Sarjakuva ja taide on kaikkien nähtävillä, mutta väärinkäytösten ja peeloilun estämiseksi tänne on järjestetty portaali, johon jokaisen
          roolipelaamaan ja foorumiin juttelemaan mielivän on luotava oma tunnus.
          Siperia on tarkoitettu kaiken ikäisille, mutta varoituksen sanana
          ilmaistakoon, että sivustolla saattaa esiintyä paikoin kiroilua,
          roolipelissä raakuuksia ja K-15 materiaalia.<br>
          Sivustolla järjestystä valvovat muutamat moderaattorit/valvojat, joiden &quot;valvojuus&quot;
          ei näy missään, joten näitä ei pysty tunnistamaan, eikä heitä voida
          asettaa sivustolla ylempään asemaan kuin muita käyttäjiä. Näin pyritään
          myös ehkäisemään ongelmia, kun häiriköt eivät tiedä keitä vältellä
          chatissa ja foorumeilla.<br>
          <br>
    &nbsp;

    <br>

          </p>

    <h1>päivitykset sivustolla</h1>
          <p style="margin-left: 20; margin-right: 20">&nbsp;<br>
          <b>8 huhtikuuta 2009</b><br>
          Siperia sai uuden ulkoasun, mutta silti sivustolla riittää vielä
          säätämistä ja laiteltavaa. Liittyminen ja vieraskirja ovat toistaiseksi
          suljettu, mutta nekin avataan piakkoin. Toivomme jo vanhojen pelaajiemme
          kanssa paljon uusia liittyjiä mukaan Siperiaan.<br>
    &nbsp;<br>
          <img border="0" src="grim.png" width="108" height="25"><br></p>
          <center>
    &nbsp;</div>
    </TR></TD></TABLE><br><br>
    <img src=footop.gif width="795" height="11"><br></tr></td>
      <tr>
        <td align=center class=foot><font color=white><center>
    Copyright © 2009 Grimhild / ShadowKiro. Kopiointi kielletty!<br>
    </font><a href="webmaster.php">Ylläpito</a><font color=white> | </font>
    <a href="copyright.php">Tekijänoikeudet</a><font color=white> | </font>
    <a href="linkit.php">Linkit & Yhteistyö</a><font color=white> <br>
    &nbsp;</font>

    I need to get the index login go to userpage [main.php], that can be viewed only by users logged in. Userpage should look same like index page, but there should be some extra links in menu/navigation. Also login form shoulbe be placed with "hello, blah blah blah, youre now logged in" -thing. How can I do that?

    Mostly I have been tried this:

    Code:

    <?
    include("include/session.php");

    if($session->logged_in){
      echo "*imagine whole index html here with editions*";
    }
    else{
      echo "*imagine here index page just like it is in the html*";
    }
    ?>
    Gasp. I know I'm n00b with these. ^^'At the moment with this coding my site gives this error message:

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/shadowki/public_html/siperia/main.php on line 5
    avatar
    Linchpin311

    Number of posts : 220
    Age : 33
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: html&css in user pages

    Post  Linchpin311 on Wed Apr 08, 2009 7:05 pm

    try using full php tags (like <?php) instead of short tags (like <?). when using different languages in the same file php short tags have a habit of screwing things up.


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    Grim

    Number of posts : 5
    Age : 30
    Localisation : Finland, Kuopio
    Registration date : 2009-04-08

    Re: html&css in user pages

    Post  Grim on Thu Apr 09, 2009 2:42 am

    Hi. Thankies for advice.
    I tried that today and found out that it does not work. Error message is saying about unexpected " letters in line 5. So it is saying about style types letters. I already tested does the row number change if I change style type infos row.

    Code:
    <?php
    include("include/session.php");
    php?>
    <?php

    if($session->logged_in)
    {
      echo "<style type="text/css"> etc.

    Could it be about my encoging? It is now ansi_x3.110-1983 (goes automatically as my sites encoding), I have also tried utf8 and iso8859-1.
    avatar
    Linchpin311

    Number of posts : 220
    Age : 33
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: html&css in user pages

    Post  Linchpin311 on Thu Apr 09, 2009 6:46 am

    why dont you post exactly what you have on lines 3 to 7 and post the exact error message php is giving you. im willing to bet its a simple mistake with a simple fix.


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    Grim

    Number of posts : 5
    Age : 30
    Localisation : Finland, Kuopio
    Registration date : 2009-04-08

    Re: html&css in user pages

    Post  Grim on Thu Apr 09, 2009 8:08 am

    So, here is the whole start. Smile

    Code:
    <?php
    include("include/session.php");
    php?>
    <?php

    if($session->logged_in)
    {
      echo "<style type="text/css">

    #hintbox{
    position:absolute;
    top: 0;
    background-color: #0f110d;
    width: 150px;
    padding: 3px;
    border:1px solid #421702;
    font:normal 11px Verdana;
    line-height:18px;
    z-index:100;
    visibility: hidden;
    color:f59743;
    }

    .hintanchor{
    text-decoration: none;
    text-transform: none;
    color: #F29027;
    font-weight: none;
    }

    </style>

    Error message:
    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/shadowki/public_html/siperia/main.php on line 8
    avatar
    Linchpin311

    Number of posts : 220
    Age : 33
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: html&css in user pages

    Post  Linchpin311 on Thu Apr 09, 2009 4:40 pm

    you are getting this error cause you never escaped your double quotes on line 7. you may want to use the heredoc syntax for this. check this out


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    Grim

    Number of posts : 5
    Age : 30
    Localisation : Finland, Kuopio
    Registration date : 2009-04-08

    Re: html&css in user pages

    Post  Grim on Thu Apr 09, 2009 6:34 pm

    Omg! What a Face
    I got the whole page&system working!!
    Thank you very, very much for your help! I love you

    Sponsored content

    Re: html&css in user pages

    Post  Sponsored content


      Current date/time is Wed Nov 14, 2018 12:18 am