Desire`s Bug Topic

Gestart doorDesire70 reacties300 weergaven

71 berichten · pagina 4 van 5

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
En waarom in de input? htmlentities() hoort alleeen bij echo oftoewel de output

toevoeging op 28 september 2012, 211105:
Aha gij doet 2x mysql_query() voor 1query
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mijn volgende script, kun je ook de fout afhandelingen goed doen? Snap der geen bal van.

[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]

    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]])){[/COLOR]
        [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een url in.<br />[/COLOR][COLOR= #007700]);
    }[/COLOR]
    
    [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/nl2br"]nl2br[/URL][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]url[/COLOR][COLOR= #007700]]));[/COLOR]
    [COLOR= #0000BB]$id[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]10000[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]99999[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$shortened[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/base_convert"]base_convert[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]20[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]36[/COLOR][COLOR= #007700]);[/COLOR]

    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]aantal_fouten[COLOR= #007700]() ==[/COLOR] [COLOR= #DD0000]0[/COLOR][COLOR= #007700]) {[/COLOR]

    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Uw verkorte url is <a href="http://site/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$shortened[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #DD0000]"">http://site/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$shortened[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #DD0000]"</a>"[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO url (id, url,shortened) VALUES ("[/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]id[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]url[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]shortened[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Er is een fout opgetreden, neem contact op met de webmaster.[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
        
        [URL="http://www.php.net/Mysql_close"]Mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$con[/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]De volgende fouten zijn opgetreden:<br />[/COLOR][COLOR= #007700];[/COLOR]
                    
    [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]weergeef_fouten[COLOR= #007700]();
}
}[/COLOR]

?>
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Verwijder lijn 18
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Al geprobeerd, werkt niet..

Hij geeft trouwens 2 errors nog steeds:

Quote:
Notice: Undefined index: id in /home/owner/domains/site/public_html/shorten.php on line 17

Notice: Undefined index: shortened in /home/owner/domains/site/public_html/shorten.php on line 17
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Gebruik isset();

toevoeging op 28 september 2012, 211804:
Codes geef ik je alleen als ik op pc zit

toevoeging op 28 september 2012, 211804:
Codes geef ik je alleen als ik op pc zit
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thanks maar shortened komt nog steeds niet in mijn database.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Hmm, hoe zit de database eruit?(screen)
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Weet je 100procent zeker dat de tabel url heet-?

anders moet je ff tot.morgen wachten of op iemand anders
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Weet je 100procent zeker dat de tabel url heet-?

anders moet je ff tot.morgen wachten of op iemand anders
Ik weet het 100% zeker, ik ben (nog) niet blind dus daar ligt het niet aan.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Is er wel connectie dan?
Gebruik nou gewoon eens mysql_error()... dan ben je weer een stuk duidelijker op de hoogte van wat er mis is.
Het echoen van de query (dus niet van mysql_query() ) kan ook helpen, zo weet je wat MySQL nou precies uitvoert.

Gebruik dus voor querys zulke constructies:

[COLOR= #0000BB]<?php
$qry[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT dit,dat FROM zus WHERE zo"[/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= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #FF8000]// gelukt..[/COLOR]
[COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
  [COLOR= #FF8000]// query mislukt, toon hier iets van mysql_error [/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke hier kan ik wat mee, bedankt.

toevoeging op 29 september 2012, 08:30:59:
Oke, ik heb nu dit:
Spoiler tonen
[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]

    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]])){[/COLOR]
        [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een url in.<br />[/COLOR][COLOR= #007700]);
    }[/COLOR]
    
    [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/nl2br"]nl2br[/URL][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]url[/COLOR][COLOR= #007700]]));[/COLOR]
    [COLOR= #0000BB]$id[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]10000[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]99999[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$shortened[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/base_convert"]base_convert[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]20[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]36[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO url (id, url,shortened) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]", "[/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]url[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]shortened[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Er is een fout opgetreden, neem contact op met de webmaster.[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$con[/COLOR][COLOR= #007700]);[/COLOR]
    
    [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT url, shortened FROM url WHERE url = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]", shortened = "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]shortened[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]""[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Er is een fout opgetreden, neem contact op met de webmaster.[/COLOR][COLOR= #007700]);;[/COLOR]
    [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/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]"
            Uw verkorte url is <a href="http://site/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$shortened[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #DD0000]"">http://site/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$shortened[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #DD0000]"</a>
            "[/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]De volgende fouten zijn opgetreden:<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Error: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]() .[/COLOR] [COLOR= #DD0000]" "[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]weergeef_fouten[COLOR= #007700]();
            
        }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De volgende fouten zijn opgetreden:<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Error: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]() .[/COLOR] [COLOR= #DD0000]" "[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]weergeef_fouten[COLOR= #007700]();
}[/COLOR]

?>
Geen errors meer, alleen slaat hij nog steeds niks op. Shortened slaat hij niet op.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
[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]

    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]])){[/COLOR]
        [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een url in.<br />[/COLOR][COLOR= #007700]);
    }[/COLOR]
    
    [COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$id[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/rand"]rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]10000[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]99999[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$shortened[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/base_convert"]base_convert[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]20[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]36[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO url(id, url,shortened) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$id[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]", "[/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]shortened[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Er is een fout opgetreden, neem contact op met de webmaster.[/COLOR][COLOR= #007700]);[/COLOR]
 
    
  
    
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$query[/COLOR][COLOR= #007700]) {[/COLOR]
        
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"
            Uw verkorte url is <a href="http://site/"[/COLOR][COLOR= #007700].[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$shortened[/COLOR][COLOR= #007700]) .[/COLOR][COLOR= #DD0000]"">http://site/"[/COLOR][COLOR= #007700].[/COLOR] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$shortened[/COLOR][COLOR= #007700]) .[/COLOR][COLOR= #DD0000]"</a>
            "[/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]De volgende fouten zijn opgetreden:<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Error: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]() .[/COLOR] [COLOR= #DD0000]" "[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]weergeef_fouten[COLOR= #007700]();
            
        }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De volgende fouten zijn opgetreden:<br />[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Error: "[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]() .[/COLOR] [COLOR= #DD0000]" "[/COLOR][COLOR= #007700];[/COLOR]
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]weergeef_fouten[COLOR= #007700]();
}[/COLOR]

?>


toevoeging op 29 september 2012, 12:26:13:
Werkt het?
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nope.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Bij mij wel:
Afbeelding

toevoeging op 29 september 2012, 12:59:05:
Verander lijn 13 naar:

$query = mysql_query("INSERT INTO url(id, url,shortened) VALUES (" . mysql_real_escape_string($id) . ", " . mysql_real_escape_string($url) . ", " . mysql_real_escape_string($shortened) . ")");


Je had $_POST[shortened] gedaan maar dat moest $shortened zijn

en die tigger_error(); is niet nodig want op lijn 18 t/m 30 controleer je al of de query is gelukt.
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