Skip to content

Commit 514fa9e

Browse files
author
NerdOfCode
committed
Added a simple urlencode example
1 parent eb2ae09 commit 514fa9e

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

PHP/url_encode.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Quick example of urlencode function in php -->
2+
3+
<form action="" method="post">
4+
5+
Search: <input type="text" name="input" class="input"></input>
6+
7+
</form>
8+
9+
10+
11+
<?php
12+
13+
$search = $_POST['input'];
14+
15+
$search = urlencode($search);
16+
17+
echo $search;
18+
19+
header("Location: " . $search);
20+
21+
?>

0 commit comments

Comments
 (0)