Development Wiki

Function.append sid

From phpBB Development Wiki

Revision as of 03:06, 5 January 2010 by Sam (Talk | contribs)

append_sid -- Prepare a URL before sending it to the template


  1. string append_sid( $url [, $params = false [, $is_amp = true [, $session_id = false]]])

Append sid is used whenever you send a link to a template, including the action attribute value of html forms. This function will activlty determine whether a Session ID needs to be appended to the URL in order to preserve the current session.


Parameter Usage
url (string) The physical page being linked to.
params (mixed) All the parameters added to send variables via the GET method, can be a string or an array
is_amp (mixed) Is url using & (true) or & (false)
session_id (mixed) Possibility to use a custom session id instead of the global one

Return Values

Returns the URL string with the Session ID if needed.


'U_ACTION'    => append_sid($phpbb_root_path.'viewtopic.'.$phpEx'f=69&t=1756785'),

The above creates the new template var 'U_ACTION'.

'U_ACTION'    => append_sid($phpbb_root_path.'viewtopic.'.$phpEx, array('f' => 69't' => '1756785'),

The above creates the new template var 'U_ACTION'.

See Also

reapply_sid Template_Syntax