[PHP] is it possible to manipulate vars here..

2006-08-02 Thread Jochen Kaechelin
.. to build a url like http://devil.server.com/vitims_page.php??


// a,b,c,d are coming from a form
// and are defined in a dropdown of the form
// there are no form fields which can be filled by the user

// a maybe Germany, England 
// b maybe Support, Training 


// register_globals = on


function build_url(a,b,c,d) {

$urlpart[a] = parta;
// $urlpart[Germany] = Stuttgart;

$urlpart[b] = partb;
$urlpart[c] = partc;
$urlpart[d] = partd;

$url = ;

if($a!=) $url.= $url+$urlpart[a];
if($b!=) $url.= $url+$urlpart[b];
if($c!=) $url.= $url+$urlpart[c];
if($d!=) $url.= $url+$urlpart[d];

return $url;
}

$link = build_url($a,$b,$c,$d);

echo $link;


-- 
Jochen Kaechelin

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is it possible to manipulate vars here..

2006-08-02 Thread Dave Goodchild

On 02/08/06, Jochen Kaechelin [EMAIL PROTECTED] wrote:


.. to build a url like http://devil.server.com/vitims_page.php??


Not sure what you're trying to do, but switch register_globals OFF. Also,
if you are trying to concatenate strings inside the function, use ., not +.





--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk