-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquerystring.php
More file actions
26 lines (23 loc) · 927 Bytes
/
querystring.php
File metadata and controls
26 lines (23 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of querystring
*
* @author thienbinh
*/
$firstName = "John";
$homePage = "http://www.example.com/";
$favoriteSport = "Ice Hockey";
$queryString = "firstName=" . urlencode( $firstName ) . "&homePage=" . urlencode( $homePage ) . "&favoriteSport=" . urlencode( $favoriteSport );
echo '<p><a href="moreinfo.php?' . $queryString . '">Find out more info on this person</a></p>';
$fields = array (
"firstName" => "John",
"homePage" => "http://www.example.com/",
"favoriteSport" => "Ice Hockey"
);
var_dump(htmlspecialchars(http_build_query($fields)));exit();
echo '<p><a href="moreinfo.php?' . htmlspecialchars( http_build_query ( $fields ) ) . '">Find out more info on this person</a></p>';