Desire`s Bug Topic

Gestart doorDesire70 reacties300 weergaven

71 berichten · pagina 5 van 5

Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hij werkt inderdaad (; Thank man.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
graag gedaan, en btw ergens in dit topic stond een script en daar stond je URL in...
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
graag gedaan, en btw ergens in dit topic stond een script en daar stond je URL in...
Klopt, zal ik verwijderen, maar weet je ook hoe ik het volgende doe?

Als ik niks invul dat er staat je hebt niks ingevult..

En dat je alleen een link mag toevoegen?
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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen URL ingevoerd, je mag alleen URL`s invoeren![/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
}[/COLOR]
?>


bedoel je?
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan is het altijd nog if(empty($_POST[url] ofso, maar waar moet ik die toevoegen..
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Desire schreef:
Dan is het altijd nog if(empty($_POST[url] ofso, maar waar moet ik die toevoegen..
Dat kan ook...

ff script voor je kopieren sec.

toevoeging op 29 september 2012, 131039:

[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][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/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen URL ingevoerd, je mag alleen URL`s invoeren![/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/exit"]exit[/URL][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= #FF8000]// VERVANG DEZE LIJN HE! [/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]

?>
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thanks, en als ik nu invoer dan doet hij het ook.
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Ik zou even iets testen voor je. Als het werkt post ik het wel ff
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oke.. smile
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] isValidURL[COLOR= #007700]([/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700])
{[/COLOR]
    [URL="http://www.php.net/return"]return[/URL] [URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/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][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/echo"]echo[/URL] [COLOR= #DD0000]Je hebt geen URL ingevoerd, je mag alleen URL`s invoeren![/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();
        }[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]isValidURL[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]url[/COLOR][COLOR= #007700]])) {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Geen geldige URL[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/exit"]exit[/URL][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]$shortened[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]")"[/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, 13:29:03:
had je trouwens ook op google kunnen vinden.
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik wist niet waar ik naar moest zoeken, maar bedankt smile
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