Page 1 of 1

How to call function

Posted: Mon Mar 20, 2006 10:31 am
by bogel
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm newbie in php...

Code: Select all

<?php
    function get_querycheck($string) {
    	global $QUERY_STRING;
    	if ($QUERY_STRING=='') {//assume no query string...
    		$newstring='?'.$string;
    		return $newstring;
    	} else {//assume there is a query string...
    		$newstring='?'.$QUERY_STRING.'&'.$string;
    		return $newstring;
    	}
    }
?>
I copy the function on PSC.
How to call the function to running on PHP?


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Mon Mar 20, 2006 10:32 am
by John Cartwright

Code: Select all

$result = get_querycheck($someVar);

echo $result;

Thanks

Posted: Mon Mar 20, 2006 11:00 am
by bogel
Works!!

Thanks