[PHP] Query werkt niet...

Gestart doorJosnl11 reacties42 weergaven

12 berichten · pagina 1 van 1

Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Goedenavond allemaal,

Ik ben zojuist verder gegaan met een systeem waarmee ik bezig ben, maar loop tegen een fout aan die ik niet zo snel kan vinden...

Alles werkt, behalve de opgegeven waardes invoeren in de database.



Ik hoop dat een van jullie dit namelijk ziet, normaal is dit allemaal geen probleem om te maken.

Alvast bedankt thumbsup
PS: Let niet op de sessie, deze heb ik even zo gezet omdat ik er nog nergens eentje aanmaak. smile
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat krijg je te zien dan?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Gebruik eens mysql_error()
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Quote:
Er ging iets mis, probeer het nog een keer of neem contact op met de eigenaar van deze website.

Heb error_reporting(e_all); ook gebruikt maar krijg daar ook geen error...
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Gebruik eens mysql_error()
toevoeging op 28 april 2012, 21:42:50:
Aarclay schreef:
Eerdere citaten tonen
Aarclay schreef:
Gebruik eens mysql_error()
En het is E_ALL, let op de hoofdletters
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Quote:
Notice: Undefined index: titel in /home/onehosted/domains/leniweb.nl/public_html/bs/2/add_column.php on line 49

Notice: Undefined index: auteur in /home/onehosted/domains/leniweb.nl/public_html/bs/2/add_column.php on line 50

Notice: Undefined index: column in /home/onehosted/domains/leniweb.nl/public_html/bs/2/add_column.php on line 51

@Aarclay, heb m ook met hoofdletters. smile
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Lijn 47 t/m 50 binnen je statement van lijn 52.
Deze variabelen zijn namelijk helemaal nog niet beschikbaar op dit moment.
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oh, ik had die waardes buiten mn if staan die kijkt of er iets gepost wordt... Errors zijn nu weg, maar op de een of andere manier werkt ie nog niet.
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/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/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[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>- Beursnieuws, opinies en analyses</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

    <div id="top_balk">
        <div id="top_balk_container">
            
            

        </div>
    </div>
    
    <div id="header">
        <div id="header_container">
            <div id="header_logo"></div>
            <div id="header_img"></div>
        </div>
    </div>
    
    <div id="main_container">
    
    [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]ingelogd[/COLOR][COLOR= #007700]])){[/COLOR] ?>
        
        <div id="column_2">
        <br />
            <h2>Nieuwe column toevoegen</h2>
            <div class="column_divider"></div>        
            
                <form method="post" action="">
                
                    <strong>Titel:</strong><br />
                    <input type="text" name="titel" /><br /><br />
                    <strong>Auteur:</strong><br />
                    <input type="text" name="auteur" /><br /><br />
                    <strong>Column:</strong><br />
                    <textarea name="column" cols="196" rows="15" style="font-family: Tahoma, Geneva, sans-serif; font-size: 12px;"></textarea><br /><br />
                    <input type="submit" value="&nbsp;Opslaan en publiceren&nbsp;" />
                       
                </form>
            [COLOR= #0000BB]<?php[/COLOR] 
                    
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]){[/COLOR]
                
            [COLOR= #0000BB]$p_titel[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_auteur[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_column[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]column[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_datum[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]datum[/COLOR][COLOR= #007700];[/COLOR]
                
                [COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen titel ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen auteur ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                 
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen tekst ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                 
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO columns (titel,auteur,column,datum) VALUES("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_datum[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700])){[/COLOR]
                                    
                        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br />Je bericht is opgeslagen en gepubliceerd.[/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]<br />Er ging iets mis, probeer het nog een keer of neem contact op met de eigenaar van deze website.[/COLOR][COLOR= #007700];[/COLOR]
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700])){[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br /><br />De volgende fouten werden gevonden:<br /><br /><font style="color: #FF0000;">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</font><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                        
                        [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                        
                        }
                        
                    }    
                    
                }
                    
            }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
                
                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br />Je bent niet gemachtigd om deze pagina te bekijken. Je kunt <a href="inloggen.php">hier</a> inloggen![/COLOR][COLOR= #007700];
                
            }[/COLOR]
            
            ?>
                
            </div>  
          
    </div>
    
        <div id="footer-sticky"></div>
        <div id="footer">
            <div id="footer_container">
                <font style="float: left;">&copy; .nl - Alle rechten voorbehouden</font>
                <font style="float: right;">Contact: info@.nl</font>
            </div>
        </div>
    
</body>
</html>
En als ik m zo doe, dan zegt ie wél dat ie geplaatst is, maar in de database verschijnt niks. Verder ook geen errors...
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/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/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[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>- Beursnieuws, opinies en analyses</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

    <div id="top_balk">
        <div id="top_balk_container">
            
            

        </div>
    </div>
    
    <div id="header">
        <div id="header_container">
            <div id="header_logo"></div>
            <div id="header_img"></div>
        </div>
    </div>
    
    <div id="main_container">
    
    [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]ingelogd[/COLOR][COLOR= #007700]])){[/COLOR] ?>
        
        <div id="column_2">
        <br />
            <h2>Nieuwe column toevoegen</h2>
            <div class="column_divider"></div>        
            
                <form method="post" action="">
                
                    <strong>Titel:</strong><br />
                    <input type="text" name="titel" /><br /><br />
                    <strong>Auteur:</strong><br />
                    <input type="text" name="auteur" /><br /><br />
                    <strong>Column:</strong><br />
                    <textarea name="column" cols="196" rows="15" style="font-family: Tahoma, Geneva, sans-serif; font-size: 12px;"></textarea><br /><br />
                    <input type="submit" value="&nbsp;Opslaan en publiceren&nbsp;" />
                       
                </form>
            [COLOR= #0000BB]<?php[/COLOR] 
                    
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]){[/COLOR]
                
            [COLOR= #0000BB]$p_titel[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_auteur[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_column[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]column[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_datum[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]datum[/COLOR][COLOR= #007700];[/COLOR]
                
                [COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen titel ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen auteur ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                 
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen tekst ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                 
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700])){[/COLOR]
                        
                        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO columns (titel,auteur,column,datum) VALUES("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_datum[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                                                            
                        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br />Je bericht is opgeslagen en gepubliceerd.[/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]<br />Er ging iets mis, probeer het nog een keer of neem contact op met de eigenaar van deze website.[/COLOR][COLOR= #007700];[/COLOR]
                        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700])){[/COLOR]
                        [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br /><br />De volgende fouten werden gevonden:<br /><br /><font style="color: #FF0000;">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</font><br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                        
                        [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
                        
                        }
                        
                    }    
                    
                }
                    
            }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
                
                [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br />Je bent niet gemachtigd om deze pagina te bekijken. Je kunt <a href="inloggen.php">hier</a> inloggen![/COLOR][COLOR= #007700];
                
            }[/COLOR]
            
            ?>
                
            </div>  
          
    </div>
    
        <div id="footer-sticky"></div>
        <div id="footer">
            <div id="footer_container">
                <font style="float: left;">&copy; .nl - Alle rechten voorbehouden</font>
                <font style="float: right;">Contact: info@.nl</font>
            </div>
        </div>
    
</body>
</html>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Waarom wacht je af of er nog andere validatie-errors zijn?
Ik zou eerder die statement van : if(!empty($errors)){ buiten de query-afhandeling halen.

En ik mis foutafhandeling om je query.

Komt neer op dit:

[COLOR= #0000BB]<?php
$result[/COLOR] [COLOR= #007700]=[/COLOR]  [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO columns (titel,auteur,column,datum) VALUES("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_datum[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
          [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br />Je bericht is opgeslagen en gepubliceerd.[/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]Er is een fout opgetreden aan onze kant: [/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
?>
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik krijg nu deze error:

Quote:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near column,datum) VALUES(ohgg,igiug,igiugig,datum) at line 1

Met deze code:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/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/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[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>- Beursnieuws, opinies en analyses</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

    <div id="top_balk">
        <div id="top_balk_container">
            
            

        </div>
    </div>
    
    <div id="header">
        <div id="header_container">
            <div id="header_logo"></div>
            <div id="header_img"></div>
        </div>
    </div>
    
    <div id="main_container">
    
    [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]ingelogd[/COLOR][COLOR= #007700]])){[/COLOR] ?>
        
        <div id="column_2">
        <br />
            <h2>Nieuwe column toevoegen</h2>
            <div class="column_divider"></div>        
            
                <form method="post" action="">
                
                    <strong>Titel:</strong><br />
                    <input type="text" name="titel" /><br /><br />
                    <strong>Auteur:</strong><br />
                    <input type="text" name="auteur" /><br /><br />
                    <strong>Column:</strong><br />
                    <textarea name="column" cols="196" rows="15" style="font-family: Tahoma, Geneva, sans-serif; font-size: 12px;"></textarea><br /><br />
                    <input type="submit" value="&nbsp;Opslaan en publiceren&nbsp;" />
                       
                </form>
            [COLOR= #0000BB]<?php[/COLOR] 
                    
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700]){[/COLOR]
                
            [COLOR= #0000BB]$p_titel[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]titel[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_auteur[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]auteur[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_column[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]column[/COLOR][COLOR= #007700]]);[/COLOR]
            [COLOR= #0000BB]$p_datum[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]datum[/COLOR][COLOR= #007700];[/COLOR]
                
                [COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen titel ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen auteur ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                 
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700])){[/COLOR] 
                
                    [COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].=[/COLOR] [COLOR= #DD0000]<li>Geen tekst ingevoerd</li>[/COLOR][COLOR= #007700];
                
                 }[/COLOR]
                        
                        [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR]  [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO columns(titel,auteur,column,datum) VALUES("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_titel[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_auteur[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_column[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$p_datum[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
                        
                            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]){[/COLOR]
                                
                                      [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br />Je bericht is opgeslagen en gepubliceerd.[/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]<br />Er is een fout opgetreden aan onze kant:<br /><br />[/COLOR][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/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700])){[/COLOR]
                            
                                            [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]<br /><br />De volgende fouten werden gevonden:<br /><br /><font style="color: #FF0000;">[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]</font><br /><br />[/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]<br />Je bent niet gemachtigd om deze pagina te bekijken. Je kunt <a href="inloggen.php">hier</a> inloggen![/COLOR][COLOR= #007700];
                
            }[/COLOR]
            
            ?>
                
            </div>  
          
    </div>
    
        <div id="footer-sticky"></div>
        <div id="footer">
            <div id="footer_container">
                <font style="float: left;">&copy; .nl - Alle rechten voorbehouden</font>
                <font style="float: right;">Contact: info@.nl</font>
            </div>
        </div>
    
</body>
</html>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
column is een reserved word. Hernoemen dus.

Even een verzoekje, kan je in het vervolg relevante code laten zien, en geen code weg-editten.. Alvast bedankt.
0
Josnl

Lid · Topicstarter

Berichten
3.461
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ah oke, bedankt, kijken of het nu werkt!
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