Hoi,
Ik heb nu een script: http://shortsnel.nl/shortsnelv2/index.php
Je ziet als je een url intypt, dat die dan bijvoorbeeld dit post:
Uw nieuwe url:
Http://www.shortsnel.nl/s/FHPKF
Nu wil ik dat hij in dezelfde textbox post, dus dat de text in de textbox word vervangen door bijvoorbeeld:
Http://www.shortsnel.nl/s/FHPKF
Alle fouten moeten ook in die textbox worden weergegeven, bij een fout moet dan een button met de tekst± terug worden weergegeven.
En het lieft ook dat de button word vervangen door een button met Kopieer erop
Script: (er hoort nog een hele database connect boven maar die geef ik nu even niet zomaar vrij
Beloning: 0,7 ptn.
Mvg,
Saliox
Ik heb nu een script: http://shortsnel.nl/shortsnelv2/index.php
Je ziet als je een url intypt, dat die dan bijvoorbeeld dit post:
Uw nieuwe url:
Http://www.shortsnel.nl/s/FHPKF
Nu wil ik dat hij in dezelfde textbox post, dus dat de text in de textbox word vervangen door bijvoorbeeld:
Http://www.shortsnel.nl/s/FHPKF
Alle fouten moeten ook in die textbox worden weergegeven, bij een fout moet dan een button met de tekst± terug worden weergegeven.
En het lieft ook dat de button word vervangen door een button met Kopieer erop

Script: (er hoort nog een hele database connect boven maar die geef ik nu even niet zomaar vrij

<div class="content_binnen">
<form action="" method="post">
<input type="text" name="long" value="Uw url hier (incl http://)" />
[COLOR= #0000BB]<?php
$chars[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$length[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]5[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$max_i[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$chars[/COLOR][COLOR= #007700])-[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$value[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/for"]for[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]<[/COLOR][COLOR= #0000BB]$length[/COLOR][COLOR= #007700];[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]++)
{[/COLOR]
[COLOR= #0000BB]$value[/COLOR] [COLOR= #007700].=[/COLOR] [COLOR= #0000BB]$chars[/COLOR][COLOR= #007700]{[/COLOR][URL="http://www.php.net/mt_rand"]mt_rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$max_i[/COLOR][COLOR= #007700])};
}[/COLOR]
?>
<input type="hidden" name="gen" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$value[/COLOR][COLOR= #007700];[/COLOR] ?>" /> <input type="submit" value="Verkort!">
</div>
</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]
[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]long[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />U moet een url opgeven![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]short[/COLOR][COLOR= #007700]])){[/COLOR]
[COLOR= #0000BB]$short[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gen[/COLOR][COLOR= #007700]];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$short[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]short[/COLOR][COLOR= #007700]];
}
}[/COLOR]
[COLOR= #0000BB]$long[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]long[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/stristr"]stristr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$long[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]http://[/COLOR][COLOR= #007700]) ===[/COLOR] FALSE[COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Er is een fout opgetreden, u bent de "http://" vergeten![/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$qry[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO shorter (langeurl, datum, korteurl, ip) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$long[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]", NOW(), "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$short[/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]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REMOTE_ADDR[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$qry[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$created_fullurl[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Http://www.shortsnel.nl/s/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$short[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// De link die word gemaakt // [/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br />Uw nieuwe url: <br/>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a href="[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$created_fullurl[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]">[/COLOR][COLOR= #007700].[/COLOR]htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$created_fullurl[/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]<br />Er is een fout in de database opgetreden, meld het de website beheerder! <a href="contact">Klik hier</a>.<br />[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$webm_email[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]website error[/COLOR][COLOR= #007700],[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
}
}
}[/COLOR]
?> Beloning: 0,7 ptn.
Mvg,
Saliox