Im not sure if this is even the correct way of doing this but hey I'm learning.
Ok I want to pass info from one function to another.
Heres the first function:
function server_location($server){
switch ($server){
case "com": echo ("www.geektools.com");
break;
case "org": echo ("www.geektools.com");
break;
case "net": echo ("www.geektools.com");
break;
}
}
Here is how I call it:
When the form is submitted the variable "$domain" contains : whatever.com
This ($server = explode (".", $domain);
) gives me the "com" to send to the function server_location
<?
$server = explode (".", $domain);
$server= (server_location("$server[1]"));
?>
When the function returns the results it "prints" the domain www.geektools.com.
What I want this to do is:
1.check to see if when the form is submitted what domain ext it has.
If it has net, org whatever; assign the correct domain to the variable $server and pass it to the second function. But all I can figure out at this moment is how to print it.
Could anyone help?
Thanks