[PHP]Vage error

Gestart doorAdmir19 reacties65 weergaven

20 berichten · pagina 1 van 2

Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hey,

Ik ben bezig met een script maar hij geeft een vage error:
Parse error: syntax error, unexpected T_STRING in /home/user4003/domains/straat-power.nl/public_html/pages/lyric.php on line 42

En dit is line 42:

[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form method="post" action="index.php?p=lyric&act=add">[/COLOR][COLOR= #007700];[/COLOR] ?>
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je kan beter je form uit de PHP code halen.
0
Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog steeds:
Parse error: syntax error, unexpected T_STRING in /home/user4003/domains/straat-power.nl/public_html/pages/lyric.php on line 42
0
Berichten
3.283
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is die regel die je geeft wel regel 42?
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je kan beter regel 41 en 43 ook geven
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rogier schreef:
je kan beter regel 41 en 43 ook geven
Ik denk idd dat je op regel 41 iets niet goed hebt afgesloten
0
Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]is_auth[COLOR= #007700]([/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
    {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]add[/COLOR][COLOR= #007700])
            {[/COLOR]
                 [COLOR= #0000BB]$sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM member_news WHERE nId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [COLOR= #0000BB]$sFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$nameQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT uId, uName, uCol FROM member_accounts WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nAuthor[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$nameFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$nameQuery[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
    INSERT INTO    
        lyric
        (
        id,
        titel,
        artiest,
        songtekst,
        door
        )
    VALUES
        (
        
        "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
        "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artiest[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
        "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]songtekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
        "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]door[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
    );
    
    echo Lyric Is toegevoegd <br /> Ga terug naat het admin menu!;
}
else
{
?>
<center><b>Test Versie!</b><br />
Dit songtekst script word aangepast met middel van UBB ectra!</center><br />
<br />
<form method="[/COLOR]post[COLOR= #DD0000]" action="[/COLOR]index[COLOR= #007700].[/COLOR]php[COLOR= #007700]?[/COLOR]p[COLOR= #007700]=[/COLOR]lyric[COLOR= #007700]&[/COLOR]act[COLOR= #007700]=[/COLOR]add[COLOR= #DD0000]">
Geadd Door:<br />
<?php echo $show[uName]; ?><input type=hidden name=door value=<?php echo $show[uName]; ?>><br />
Titel: Ft moet achter titel! dus bijv nummer Ik Dek je Rug Ft. Jan<br />
<input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]titel[COLOR= #DD0000]" size="[/COLOR][COLOR= #0000BB]35[/COLOR][COLOR= #DD0000]" /><br />
Artiest: Let op! 1 artiest alleen toevoegen, Zijn er meer artiesten moet je dit songtekst vaker toevoegen met andere artiest!<br />
<input type="[/COLOR]text[COLOR= #DD0000]" name="[/COLOR]artiest[COLOR= #DD0000]" size="[/COLOR][COLOR= #0000BB]35[/COLOR][COLOR= #DD0000]" /><br />
Artiest: Staat de artiest op Straat-Power? Dan moet je hier boven van "[/COLOR]Artiest[COLOR= #DD0000]" niks invullen, maar klik hier je artiest aan.<br />
<?php echo <select name="[/COLOR]artiesten[COLOR= #DD0000]">;
        
        $rap_select = mysql_query("[/COLOR]
        
            SELECT 
                uId[COLOR= #007700],[/COLOR]uName
            FROM 
                member_accounts
            WHERE
            uRang [COLOR= #007700]=[/COLOR][COLOR= #DD0000]2[/COLOR]
            ORDER BY
                uId ASC
            
        [COLOR= #DD0000]") or die(mysql_error());
        
        while ($show = mysql_fetch_assoc($rap_select))
        {
        
            $show[artiesten] = stripslashes($show[artiesten]);
            $show[artiesten] = htmlentities($show[artiesten]);
            
            echo "[/COLOR][COLOR= #007700]<[/COLOR]option value[COLOR= #007700]=[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"">"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uName[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</option>"[/COLOR][COLOR= #007700];
        
        }[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</select>[/COLOR][COLOR= #007700];[/COLOR]
?>
Songtekst:<br />
<input type="text" name="songtekst" size="100" width="425" />
<br />
<input type="sumbit" name="sumbit" value="Songtekst Toevoegen" /></form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR] 
?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
mysql_query("
INSERT INTO
lyric
(
id,
titel,
artiest,
songtekst,
door
)
VALUES
(

".$_POST[titel].",
".$_POST[artiest].",
".$_POST[songtekst].",
".$_POST[door]."
)");
0
Miel

Lid

Berichten
4.462
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
mysql_query("
    INSERT INTO    
        lyric
        (
        id,
        titel,
        artiest,
        songtekst,
        door
        )
    VALUES
        (
        
        ".$_POST[titel].",
        ".$_POST[artiest].",
        ".$_POST[songtekst].",
        ".$_POST[door]."
    );


->

mysql_query("
    INSERT INTO    
        lyric
        (
        id,
        titel,
        artiest,
        songtekst,
        door
        )
    VALUES
        (
        
        ".$_POST[titel].",
        ".$_POST[artiest].",
        ".$_POST[songtekst].",
        ".$_POST[door].""
    );
0
Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
bedankt nielsie,

Er is nog alleen 1 probleem

Ik zie nu dit: Track is toegevoegd.
Ga terug naar de beheerpagina. Maar geen Tabbelen

dit is nou me code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
?>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]is_auth[COLOR= #007700]([/COLOR][COLOR= #0000BB]4[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]]))
    {[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]add[/COLOR][COLOR= #007700])
            {[/COLOR]

[URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
INSERT INTO
lyric
(
id,
titel,
artiest,
songtekst,
door
)
VALUES
(

"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artiest[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]songtekst[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]",
"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]door[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"
)"[/COLOR]
[COLOR= #007700]);[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Track is toegevoegd.<br />
            <a href="index.php">Ga terug naar de beheerpagina</a>.<br />"[/COLOR][COLOR= #007700];
        
        
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<center><b>Test Versie!</b><br />
Dit songtekst script word aangepast met middel van UBB ectra!</center><br />
<br />
<form method="post" action="index.php?p=lyric&act=add">
Geadd Door:<br />
[COLOR= #0000BB]<?php                  $sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM member_news WHERE nId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [COLOR= #0000BB]$sFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$nameQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT uId, uName, uCol FROM member_accounts WHERE uId = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]nAuthor[/COLOR][COLOR= #007700]]);[/COLOR]
    [COLOR= #0000BB]$nameFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$nameQuery[/COLOR][COLOR= #007700]);[/COLOR] ?>
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uName[/COLOR][COLOR= #007700]];[/COLOR] ?><input type=hidden name=door value=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uName[/COLOR][COLOR= #007700]];[/COLOR] ?>><br />
Titel: Ft moet achter titel! dus bijv nummer Ik Dek je Rug Ft. Jan<br />
<input type="text" name="titel" size="35" /><br />
Artiest: Let op! 1 artiest alleen toevoegen, Zijn er meer artiesten moet je dit songtekst vaker toevoegen met andere artiest!<br />
<input type="text" name="artiest" size="35" /><br />
Artiest: Staat de artiest op Straat-Power? Dan moet je hier boven van "Artiest" niks invullen, maar klik hier je artiest aan.<br />
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<select name="artiesten">[/COLOR][COLOR= #007700];[/COLOR]
        
        [COLOR= #0000BB]$rap_select[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"
        
            SELECT 
                uId,uName
            FROM 
                member_accounts
            WHERE
            uRang =2
            ORDER BY
                uId ASC
            
        "[/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/while"]while[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$show[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rap_select[/COLOR][COLOR= #007700]))
        {[/COLOR]
        
            [COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artiesten[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artiesten[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artiesten[/COLOR][COLOR= #007700]] =[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]artiesten[/COLOR][COLOR= #007700]]);[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<option value=""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uId[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"">"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$show[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uName[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"</option>"[/COLOR][COLOR= #007700];
        
        }[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</select>[/COLOR][COLOR= #007700];[/COLOR]
?>
Songtekst:<br />
<input type="text" name="songtekst" size="100" width="425" />
<br />
<input type="sumbit" name="sumbit" value="Songtekst Toevoegen" /></form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR] 
?>
0
Berichten
9.969
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
session_start();
?
0
Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Robbert schreef:
session_start();
?

Ik weet niet wat fout is.
Alleen dit zie ik dan:

echo "Track is toegevoegd.<br />
            <a href="index.php">Ga terug naar de beheerpagina</a>.<br />";
0
Berichten
10.409
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
session_start();

moet altijd bovenaan (Na de PHP tag)
0
Admir

Lid · Topicstarter

Berichten
1.950
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
nope, nog steeds niet.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
maak van

mysql_query("
INSERT INTO
lyric
(
id,
titel,
artiest,
songtekst,
door
)
VALUES
(

".$_POST[titel].",
".$_POST[artiest].",
".$_POST[songtekst].",
".$_POST[door]."
)"
);


eens

mysql_query("
INSERT INTO
lyric
(
id,
titel,
artiest,
songtekst,
door
)
VALUES
(

".$_POST[titel].",
".$_POST[artiest].",
".$_POST[songtekst].",
".$_POST[door]."
)"
) or print(mysql_error());
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