Desire`s Bug Topic

Gestart doorDesire70 reacties300 weergaven

71 berichten · pagina 3 van 5

Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Eerdere citaten tonen
Lennard schreef:
Dan ga je uitzoeken waarom hij niets in je database stopt... dus ga je de ingevulde query echoën en kijken of die klopt.
En kijk eens naar [func]mysql_error[/func].

En uiteraard ook goede foutafhandeling toevoegen..
En die undefined variabelen. Ze zijn nog niet aangemaakt. Lijkt erop dat ze niet eens meegestuurd worden met je POST.
Kun je een voorbeeld geven? Heb al gegoogled en al.
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Eerdere citaten tonen
Lennard schreef:
Dan ga je uitzoeken waarom hij niets in je database stopt... dus ga je de ingevulde query echoën en kijken of die klopt.
En kijk eens naar [func]mysql_error[/func].

En uiteraard ook goede foutafhandeling toevoegen..
Dat natuurlijk sowieso, maar dat is altijd een heel gedoe als je losse mysql_query functies gebruikt, dan kun je beter een database class maken.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
De ene keer zie ik dat er dit gebruikt wordt:
$mysql->real_escape($_POST[id])

En de andere keer gewoon de oude mysql_*() functies.
Niet echt efficiënt.
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is dit beter dan? Betere uitlijning enzo?

En wat moet ik toevoegen / bewerken om die erros weg te halen?

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

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP url shortener</title>
<style type="text/css">

#form1 p {
text-align:center;
}
</style>
</head>

<body background="images/backgroud.gif">

<div class="header"> Php URL shortener<hr /></div>
<div class="content">

[COLOR= #0000BB]<?php

$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]$_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]$code[/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][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]url[/COLOR][COLOR= #007700]]))){[/COLOR]

    [COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"insert into url 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]
    [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/echo"]echo[/URL] [COLOR= #DD0000]"Uw verkorte url is <a href="http://site/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$code[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #DD0000]"">http://site/"[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$code[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #DD0000]"</a>"[/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]"Uw url is niet verkort"[/COLOR][COLOR= #007700];
}[/COLOR]
?>




</div>

</body>
</html>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
- Wat doet die isset hier?

$url=mysql_real_escape_string(isset($_POST[url]));


- Wat wil je hier mee bereiken? Weet je wel wat mysq_real_escape_string() teruggeeft?

if(mysql_real_escape_string(isset($_POST[url]))){


- Waarom typ je de MySQL functies in je query niet met een hoofdletter?

- Waar is nou je foutafhandeling op je query?

- Waar controleer je of je formulier verstuurd is?

- Waarom gebruik je het bakground-attrbuut in je body, terwijl je dit in CSS af kan handelen?

- Gebruik a.u.b. tags voor je Php URL shortener (

dus..)

- Je schotelt de gebruiker bij een fout wel dit voor "Uw url is niet verkort". Waarom is het niet verkort? Bij wie ligt de oorzaak? Wees hier wat duidelijker in.

Als ik dit script zo zie, lijkt een rewrite een stuk beter.

0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
@ desire: zoek gewoon eens van elke functie op wat hij precies doet.
Het lijkt erop dat je at random wat functies en ifjes en elsjes plakt en dat net zo lang doet totdat het goed is.
Je moet in je hoofd hebben zitten wat je wil, en dat moet je bijna foutloos kunnen programmeren zonder te testen (je moet natuurlijk wel testen, maar het idee van het script moet dan al duidelijk zijn).

Dus wat Aar zegt: bedenk wat je script moet doen, bedenk wat je daar voor nodig hebt (je hebt $_POST[url] en $_POST[id] nodig), bedenk wat het allemaal moet zijn ($_POST[url] moet een url zijn, $_POST[id] moet een getal zijn, enz.), en ga bedenken hoe je dat in PHP kunt maken.

Succes.
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt allebij, ik zal kijken wat ik kan doen.

toevoeging op 27 september 2012, 07:56:25:
Ik heb nu dit:

[COLOR= #0000BB]<?php

$url[/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= #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]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]]==[/COLOR][COLOR= #DD0000]"POST"[/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]
    [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/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/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]"Uw url is niet verkort, dit kan komen door het volgende:<br>
            * Er zit een fout in ons systeem.<br>
            * U heeft geen geldige URL ingevult.<br>
            * Of een onbekende fout, raadpleeg hiervoor de website beheerder."[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Verder kom ik er echt niet uit.
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
BUMP

toevoeging op 28 september 2012, 081821:
Heb nu dit:

[COLOR= #0000BB]<?php

$url[/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= #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]$_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/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]])){[/COLOR]
        [COLOR= #0000BB]$id[/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]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO url (id) 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/if"]if[/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= #0000BB]$id[/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]
        [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO 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]shortened[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/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 (url) 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]url[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]")"[/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/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/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]"Uw url is niet verkort, dit kan komen door het volgende:<br>
            * Er zit een fout in ons systeem.<br>
            * U heeft geen geldige URL ingevult.<br>
            * Of een onbekende fout, raadpleeg hiervoor de website beheerder."[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Alleen slaat hij shortened nu niet op in de database.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Gebruik alleen mysql_real_escape_string in een query aub

toevoeging op 28 september 2012, 08:28:58:
Controleer ook of het een url is je kan nu ook een getal invoeren
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
En voeg goede foutafhandeling toe aan je mysql_query. En waarom losse queries?
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zal er naar kijken, maar weet iemand verder ook hoe ik die shortened werkend krijg?
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Komen ze al in de database of niet?
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nope nog steeds niet, ik post nu mijn script, ik ben nu aan het zoeken hoe ik die nl2br/htmlentities op de input doe..

toevoeging op 28 september 2012, 19:50:02:

[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]$url[/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= #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/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]"Uw url is niet verkort, dit kan komen door het volgende:<br>
            * Er zit een fout in ons systeem.<br>
            * U heeft geen geldige URL ingevult.<br>
            * Of een onbekende fout, raadpleeg hiervoor de website beheerder."[/COLOR][COLOR= #007700];
            
}[/COLOR]
?>
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Ben je wel verbonden met de MySQL server?
7
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja..
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