syntax error in php

Gestart doorJvdw19 reacties70 weergaven

20 berichten · pagina 1 van 2

Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
hey!
Sorry voor al mijn vragen maar,

ik ben bezig met cutenews wat te editten.
bij common_form heb ik dit

[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]id[/COLOR][COLOR= #007700]])){[/COLOR]
?>
Je bent niet ingelogt, log <a href="index.php?p=pagina/login">hier</a> in
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
  <table border="0" width="370" cellspacing="0" cellpadding="0">
    <tr>
      <td width="60">Name:</td>
      <td><input type="text" name="name"></td>
    </tr>
    <tr>
      <td>E-mail:</td>
      <td><input type="text" name="mail"> (optional)</td>
    </tr>
    <tr>
      <td>Smile:</td>
      <td>{smilies}</td>
    </tr>
    <tr>
      <td colspan="2">
      <textarea cols="40" rows="6" id=commentsbox name="comments"></textarea><br />
      <input type="submit" name="submit" value="Add My Comment">
      <input type=checkbox name=CNremember  id=CNremember value=1><label for=CNremember> Remember Me</label> |
  <a href="javascript:CNforget();">Forget Me</a>
      </td>
    </tr>
  </table>


Als error krijg ik dit dan

syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/jvdw/domains/jvdw.one2xs.com/public_html/website2/cutenews/data/Default.tpl on line 2


Wat is er mis?
Alvast bedankt voor jouw hulpsmile
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je hebt

} else {

en dan sluit je else niet af.
0
Berichten
2.517
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[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]id[/COLOR][COLOR= #007700]])){[/COLOR]
?>
Je bent niet ingelogt, log <a href="index.php?p=pagina/login">hier</a> in
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
  <table border="0" width="370" cellspacing="0" cellpadding="0">
    <tr>
      <td width="60">Name:</td>
      <td><input type="text" name="name"></td>
    </tr>
    <tr>
      <td>E-mail:</td>
      <td><input type="text" name="mail"> (optional)</td>
    </tr>
    <tr>
      <td>Smile:</td>
      <td>{smilies}</td>
    </tr>
    <tr>
      <td colspan="2">
      <textarea cols="40" rows="6" id=commentsbox name="comments"></textarea><br />
      <input type="submit" name="submit" value="Add My Comment">
      <input type=checkbox name=CNremember  id=CNremember value=1><label for=CNremember> Remember Me</label> |
  <a href="javascript:CNforget();">Forget Me</a>
      </td>
    </tr>
  </table>
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@ Propje werkt niet.
@ Ttsam
waar moet ik em dan afsluiten?
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
onder
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
aan het einde van je code moet je dit neer zetten:

}
?>
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
thx ff proberen?

Geprobeerd ik heb zelfde? sadleynopompom
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[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]id[/COLOR][COLOR= #007700]])){[/COLOR]
?>
Je bent niet ingelogt, log <a href="index.php?p=pagina/login">hier</a> in
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
?>
  <table border="0" width="370" cellspacing="0" cellpadding="0">
    <tr>
      <td width="60">Name:</td>
      <td><input type="text" name="name"></td>
    </tr>
    <tr>
      <td>E-mail:</td>
      <td><input type="text" name="mail"> (optional)</td>
    </tr>
    <tr>
      <td>Smile:</td>
      <td>{smilies}</td>
    </tr>
    <tr>
      <td colspan="2">
      <textarea cols="40" rows="6" id=commentsbox name="comments"></textarea><br />
      <input type="submit" name="submit" value="Add My Comment">
      <input type=checkbox name=CNremember  id=CNremember value=1><label for=CNremember> Remember Me</label> |
  <a href="javascript:CNforget();">Forget Me</a>
      </td>
    </tr>
  </table>
[COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR] ?>


Dat heb je?
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb je voor het script dat je hebt laten zien, nog meer script staan?
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@ Nielsie, ja dat heb ik...

@Ttsam, hoe bedoel je?
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat voor de if conditie nog meer code staat.
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ja.
hier...De volledige code... Is van Cutenews

[COLOR= #0000BB]<?PHP[/COLOR]
[COLOR= #FF8000]///////////////////// TEMPLATE Default /////////////////////[/COLOR]
[COLOR= #0000BB]$template_active[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
                                
                                
                                <div class= "cadretop"><h4>{title}</h4>
                                </div>
                                <div class="cadrebg">
                                    <div class="text">
                                    {short-story}
<br><p align="right">[com-link]reageer[/com-link]<p><p align="left" style="margin-top: -26px;">Gepost door {author-name}<p>
                                    </div>
                                </div>
                                    <div class="cadrebot"><br />
                                </div>
                            </div>
<div class= "space"></div>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_full[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
                                
                                
                                <div class= "cadretop"><h4>{title}</h4>
                                </div>
                                <div class="cadrebg">
                                    <div class="text">
                                    {short-story}
<br><p align="right">Er is {comments-num} keer gereageerd<p><p align="left" style="margin-top: -26px;">Gepost door {author-name}<p>
                                    </div>
                                </div>
                                    <div class="cadrebot"><br />
                                </div>
                            </div>
<div class= "space"></div>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_comment[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<div style="width: 400px; margin-bottom:20px;">

<div style="border-bottom:1px solid black;"> by <strong>{author}</strong> @ {date}</div>

<div style="padding:2px; background-color:#F9F9F9">{comment}</div>

</div>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<?php
if(!isset($_SESSION[id])){
?>
Je bent niet ingelogt, log <a href="index.php?p=pagina/login">hier</a> in
<?php
else
{
?>
  <table border="0" width="370" cellspacing="0" cellpadding="0">
    <tr>
      <td width="60">Name:</td>
      <td><input type="text" name="name"></td>
    </tr>
    <tr>
      <td>E-mail:</td>
      <td><input type="text" name="mail"> (optional)</td>
    </tr>
    <tr>
      <td>Smile:</td>
      <td>{smilies}</td>
    </tr>
    <tr>
      <td colspan="2">
      <textarea cols="40" rows="6" id=commentsbox name="comments"></textarea><br />
      <input type="submit" name="submit" value="Add My Comment">
      <input type=checkbox name=CNremember  id=CNremember value=1><label for=CNremember> Remember Me</label> |
  <a href="javascript:CNforget();">Forget Me</a>
      </td>
    </tr>
  </table>
<?php
}
?>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_prev_next[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<p align="center">[prev-link]<< Previous[/prev-link] {pages} [next-link]Next >>[/next-link]</p>
HTML[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$template_comments_prev_next[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<p align="center">[prev-link]<< Older[/prev-link] ({pages}) [next-link]Newest >>[/next-link]</p>
HTML[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
212
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?PHP[/COLOR]
[COLOR= #FF8000]///////////////////// TEMPLATE Default /////////////////////[/COLOR]
[COLOR= #0000BB]$template_active[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
                                
                                
                                <div class= "cadretop"><h4>{title}</h4>
                                </div>
                                <div class="cadrebg">
                                    <div class="text">
                                    {short-story}
<br><p align="right">[com-link]reageer[/com-link]<p><p align="left" style="margin-top: -26px;">Gepost door {author-name}<p>
                                    </div>
                                </div>
                                    <div class="cadrebot"><br />
                                </div>
                            </div>
<div class= "space"></div>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_full[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
                                
                                
                                <div class= "cadretop"><h4>{title}</h4>
                                </div>
                                <div class="cadrebg">
                                    <div class="text">
                                    {short-story}
<br><p align="right">Er is {comments-num} keer gereageerd<p><p align="left" style="margin-top: -26px;">Gepost door {author-name}<p>
                                    </div>
                                </div>
                                    <div class="cadrebot"><br />
                                </div>
                            </div>
<div class= "space"></div>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_comment[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<div style="width: 400px; margin-bottom:20px;">

<div style="border-bottom:1px solid black;"> by <strong>{author}</strong> @ {date}</div>

<div style="padding:2px; background-color:#F9F9F9">{comment}</div>

</div>
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_form[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
?>
<?php
if(!isset($_SESSION[id])){
?>
Je bent niet ingelogt, log <a href="index.php?p=pagina/login">hier</a> in
<?php
else
{
?>
  <table border="0" width="370" cellspacing="0" cellpadding="0">
    <tr>
      <td width="60">Name:</td>
      <td><input type="text" name="name"></td>
    </tr>
    <tr>
      <td>E-mail:</td>
      <td><input type="text" name="mail"> (optional)</td>
    </tr>
    <tr>
      <td>Smile:</td>
      <td>{smilies}</td>
    </tr>
    <tr>
      <td colspan="2">
      <textarea cols="40" rows="6" id=commentsbox name="comments"></textarea><br />
      <input type="submit" name="submit" value="Add My Comment">
      <input type=checkbox name=CNremember  id=CNremember value=1><label for=CNremember> Remember Me</label> |
  <a href="javascript:CNforget();">Forget Me</a>
      </td>
    </tr>
  </table>
<?php
}
?>
<?PHP
HTML[/COLOR][COLOR= #007700];[/COLOR]


[COLOR= #0000BB]$template_prev_next[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<p align="center">[prev-link]<< Previous[/prev-link] {pages} [next-link]Next >>[/next-link]</p>
HTML[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$template_comments_prev_next[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]<<<HTML
<p align="center">[prev-link]<< Older[/prev-link] ({pages}) [next-link]Newest >>[/next-link]</p>
HTML[/COLOR][COLOR= #007700];[/COLOR]
?>


Dit moet werken
0
Jvdw

Lid · Topicstarter

Berichten
4.321
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
sadleyWerkt nietnopompom
Heb error on line 53 >> if(!isset($_SESSION[id])){
0
Berichten
1.916
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vervang regel 52 t.e.m. 59 door dit:

[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]id[/COLOR][COLOR= #007700]])){[/COLOR]
?>
Je bent niet ingelogt, log <a href="index.php?p=pagina/login">hier</a> in
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
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