T_STRING fout

Gestart doorBjarnootjuh11 reacties57 weergaven

12 berichten · pagina 1 van 1

Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi,

ik krijg deze error:

*Parse error*: syntax error, unexpected T_STRING, expecting , or ; in*/home/djbjarnx/public_html/radioxs/rds/test/index.php*on line*27*


En dit is mijn code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"functions.php"[/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]checklogin[COLOR= #007700]()) {[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]location:menu.php[/COLOR][COLOR= #007700]);
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]location:inloggen.php[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sworm - Free CSS Template by spyka Webmaster</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>
<body>
<div id="container">
    <div id="header">
        <h1><a href="/">RDS Admin Paneel</a></h1>
        <h2>Handig DJ Paneel voor webradios!</h2>
        <div class="clear"></div>
    </div>
    [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rank[/COLOR][COLOR= #007700]] ==[/COLOR][COLOR= #DD0000]"dj"[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<div id="[/COLOR]nav[COLOR= #DD0000]">
        <ul>
            <li class="[/COLOR]start selected[COLOR= #DD0000]"><a href="[/COLOR]index[COLOR= #007700].[/COLOR]html[COLOR= #DD0000]">Home</a></li>
            <li><a href="[/COLOR]examples[COLOR= #007700].[/COLOR]html[COLOR= #DD0000]">Examples</a></li>
            <li><a href="[/COLOR][COLOR= #FF8000]#">Products</a></li>[/COLOR]
            [COLOR= #007700]<[/COLOR]li[COLOR= #007700]><[/COLOR]a href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"#"[/COLOR][COLOR= #007700]>[/COLOR]Solutions[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]><[/COLOR]/li[COLOR= #007700]>
            <[/COLOR]li [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"end"[/COLOR][COLOR= #007700]><[/COLOR]a href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"#"[/COLOR][COLOR= #007700]>[/COLOR]Contact[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]><[/COLOR]/li[COLOR= #007700]>
        <[/COLOR]/ul[COLOR= #007700]>
    <[/COLOR]/div[COLOR= #007700]>[/COLOR][COLOR= #DD0000]";
}
?>
    <div id="[/COLOR]body[COLOR= #DD0000]">
        <div id="[/COLOR]content[COLOR= #DD0000]">
            <h2>RDS Admin (DJ Panel)</h2>
            <p>Welkom bij RDS Admin.</p>
            <p>RDS Admin is een voor Radionomy optimaliseerde DJ Panel.</p>
    
            <h3>Inloggen</h3>
            <p><?php
include "[/COLOR]config[COLOR= #007700].[/COLOR]php[COLOR= #DD0000]";
include "[/COLOR]functions[COLOR= #007700].[/COLOR]php[COLOR= #DD0000]";

if(checklogin()) {
header(location:menu.php);
} else {
header(location:inloggen.php);
}
?>
</p>



        </div>
        
        <?php
if ($get_userdata[rank] =="[/COLOR]admin[COLOR= #DD0000]") {
echo "[/COLOR][COLOR= #007700]<[/COLOR]div [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"sidebar"[/COLOR][COLOR= #007700]>
            <[/COLOR]ul[COLOR= #007700]>    
               <[/COLOR]li[COLOR= #007700]>
                    <[/COLOR]h3[COLOR= #007700]>[/COLOR]Admin Paneel[COLOR= #007700]<[/COLOR]/h3[COLOR= #007700]>
                    <[/COLOR]ul [URL="http://www.php.net/class"]class[/URL][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"blocklist"[/COLOR][COLOR= #007700]>
                        <[/COLOR]li[COLOR= #007700]><[/COLOR]a href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"admin_leden.php"[/COLOR][COLOR= #007700]>[/COLOR]Ledenbeheer[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]><[/COLOR]/li[COLOR= #007700]>
                        <[/COLOR]li[COLOR= #007700]><[/COLOR]a href[COLOR= #007700]=[/COLOR][COLOR= #DD0000]"admin_rds.php"[/COLOR][COLOR= #007700]>[/COLOR]RDS Opties[COLOR= #007700]<[/COLOR]/a[COLOR= #007700]><[/COLOR]/li[COLOR= #007700]>
                    <[/COLOR]/ul[COLOR= #007700]>
                <[/COLOR]/li[COLOR= #007700]>
                
            <[/COLOR]/ul[COLOR= #007700]> 
        <[/COLOR]/div[COLOR= #007700]>[/COLOR][COLOR= #DD0000]";
}
?>
        <div class="[/COLOR]clear[COLOR= #DD0000]"></div>
    </div>
    <div id="[/COLOR]footer[COLOR= #DD0000]">
        <div class="[/COLOR]footer[COLOR= #007700]-[/COLOR]content[COLOR= #DD0000]">
        </div>
        <div class="[/COLOR]footer[COLOR= #007700]-[/COLOR]bottom"[COLOR= #007700]>
            <[/COLOR]p[COLOR= #007700]>[/COLOR] RDS Admin[COLOR= #007700].[/COLOR] Door Bjarn[COLOR= #007700]<[/COLOR]/p[COLOR= #007700]>
         <[/COLOR]/div[COLOR= #007700]>
    <[/COLOR]/div[COLOR= #007700]>
<[/COLOR]/div[COLOR= #007700]>
<[/COLOR]/body[COLOR= #007700]>
<[/COLOR]/html[COLOR= #007700]>[/COLOR]


Ik ben nog noob in PHP.
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
echo "<div id="nav">
        <ul>
            <li class="start selected"><a href="index.html">Home</a></li>
            <li><a href="examples.html">Examples</a></li>
            <li><a href="#">Products</a></li>
            <li><a href="#">Solutions</a></li>
            <li class="end"><a href="#">Contact</a></li>
        </ul>
    </div>";


wordt

echo <div id="nav">
        <ul>
            <li class="start selected"><a href="index.html">Home</a></li>
            <li><a href="examples.html">Examples</a></li>
            <li><a href="#">Products</a></li>
            <li><a href="#">Solutions</a></li>
            <li class="end"><a href="#">Contact</a></li>
        </ul>
    </div>;
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het werkt. Thx. Slotje!
0
Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je kan beter PHP sluiten, HTML erin en weer PHP openen ipv dit. Dit doe je niet in echo. Nu zit je weer met die irritante haakjes ook.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Of je gebruikt single-quotes voor je echo.
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Of je gebruikt single-quotes voor je echo.
Die gebruik ik nu.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Als je nu naar die code kijkt in je SP zie je ook dat die highlight kleuren niet helemaal goed lopen, en als je dan kijkt waar het mis gaat dat in combinatie met welke regel er vermeld word, heb je zo de fout gevonden.

In dit geval open je dus echo met " en gebruik je daarbinnen weer een " php denkt dan dat je daarmee bedoeld dat je de echo wilt afsluiten, dus daarom, zoals je nu hebt, gewoon single quotes gebruiken of html scheiden van php, dat is nog beter shiny
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Of je gebruikt single-quotes voor je echo.
In html/javascript moet je soms ook gebruiken, je kan ze wel escapen maar tenzij dat je met 1 of 2 gevallen zit doe je het dus beter niet met een echo.
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu zit ik met een syntax fout van $end:
Dit is mijn inloggen.php (als je niet bent ingelogd krijg je redirect hierheen):

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"functions.php"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$maintenance[/COLOR][COLOR= #007700]) {[/COLOR]
 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR]checklogin[COLOR= #007700]()) {[/COLOR]
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>RDS Admin Login</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
</head>
<body>
<div id="container">
    <div id="header">
        <h1><a href="/">RDS Admin Paneel</a></h1>
        <h2>Handig DJ Paneel voor webradios!</h2>
        <div class="clear"></div>
    </div>
    [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rank[/COLOR][COLOR= #007700]] ==[/COLOR][COLOR= #DD0000]"dj"[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div id="nav">
        <ul>
            <li class="start selected"><a href="index.html">Home</a></li>
            <li><a href="examples.html">Examples</a></li>
            <li><a href="#">Products</a></li>
            <li><a href="#">Solutions</a></li>
            <li class="end"><a href="#">Contact</a></li>
        </ul>
    </div>[/COLOR][COLOR= #007700];
}[/COLOR]
?>
    <div id="body">
        <div id="content">
            <h2>RDS Admin (DJ Panel)</h2>
            <p>Welkom bij RDS Admin.</p>
            <p>RDS Admin is een voor Radionomy optimaliseerde DJ Panel.</p>
    
            <h3>Inloggen</h3>
            <p><form method="POST" action="">
  <table border="0" cellpadding="0" cellspacing="0" width="361">
  <tr>
    <td width="73">Gebruikersnaam:</td>
    <td width="284"><input type="text" name="username" size="20"></td>
  </tr>
  <tr>
    <td width="73">Wachtwoord: </td>
    <td width="284"><input type="password" name="password" size="20"></td>
  </tr>
  <tr>
    <td width="73">Sessie:</td>
    <td width="284"><select size="1" name="sessiontime">
        <option value="3600">1 uur</option>
        <option value="43200">12 uur</option>
        <option value="86400">1 dag</option>
        <option value="604800">1 week</option>
        <option value="2592000">1 maand</option>
        <option value="31104000">1 jaar</option>
      </select></td>
  </tr>
  </table>
  <p><input type="submit" value="Inloggen" name="login">
  </p>
</form>
<div style="color:red">[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$bericht[/COLOR][COLOR= #007700];[/COLOR] ?></div>
<sub>&copy; RDS Admin, door Bjarn. [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$version[/COLOR][COLOR= #007700];[/COLOR] ?></sub>
</p>



        </div>
        
        <div class="sidebar">[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rank[/COLOR][COLOR= #007700]] ==[/COLOR][COLOR= #DD0000]"admin"[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
            <ul>    
               <li>
                    <h3>Admin Paneel</h3>
                    <ul class="blocklist">
                        <li><a href="admin_leden.php">Ledenbeheer</a></li>
                        <li><a href="admin_rds.php">RDS Opties</a></li>
                    </ul>
                </li>
                
            </ul> 
        [/COLOR][COLOR= #007700];
}[/COLOR]
?></div>
        <div class="clear"></div>
    </div>
    <div id="footer">
        <div class="footer-content">
        </div>
        <div class="footer-bottom">
            <p> 2012 RDS Admin. Door Bjarn.</p>
         </div>
    </div>
</div>
</body>
</html>


Dit is de error:

Parse error: syntax error, unexpected $end in /home/djbjarnx/public_html/radioxs/rds/test/inloggen.php on line 101


Ik snap dit niet want het is gewoon HTML ??
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
} op het einde

Had je google gebruikt wist je dit emo
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Was de verkeerde code. Nu goed biggrin
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
if(!$maintenance) {
if (!checklogin()) {

sluit je beide niet af.

Dus PHP verwacht nog 2x }

Dus een unexpected $end.
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