JURI/setPass
From Joomla! Documentation
< JURI
Sets the password part of the URI represented by the JURI object.
Syntax
void setPass( $pass )
where:
| Argument | Data type | Description | Default |
|---|---|---|---|
| $pass | string | Password to be added to the URI. This will replace any existing password. |
Example
In this example, a URI object is created and the password is then changed.
$uri = 'http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthis'; $u =& JURI::getInstance( $uri ); echo 'Before: ' . $u->toString() . "\n"; $u->setPass( 'JamesBond' ); echo 'After : ' . $u->toString();
would output
Before: http://fredbloggs:itsasecret@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthat After : http://fredbloggs:JamesBond@www.example.com:8080/path/to/Joomla/index.php?task=view&id=32#anchorthat