![]() |
|
#1
|
|||
|
|||
Manipulating URLHi guys,
Lets say i've passed a URL of www.wateva.com/test.php?user=$user from a php page that contained the variable $user with these codes. Code:
for example. Now...I wanna keep passing the variable of user and when I need it I want to be able to use that variable. 1st question: How do i pass the variable around in the URL from page to page? 2nd question: How do i use it later on, as in how do i assign it to a variable? Thank you. Last edited by JdS : 05-Apr-2004 at 08:22.
Reason: Use "example.com" when posting EXAMPLE urls
|
|||
|
#2
|
||||
|
||||
|
Quote:
PHP Code:
Quote:
You retrieve the super global array $_GET['user']. Be careful, always validate (clean) user supplied data... by using strip_tags() and urlencode() and other similar functions. __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#3
|
|||
|
|||
|
thanx, but how exactly do i encode the url?
|
|
#4
|
|||
|
|||
|
Quote:
and also, how do i use it as part of my html links? (the encoded version) |
|
#5
|
||||
|
||||
|
You could try something like this...
PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Manipulating text Files | k209310 | C++ Forum | 0 | 17-Nov-2003 11:23 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The