Greetings board members!
I'm new to php and this message board, and do some programming in asp. In asp you can call a sub-routine during some user event. For example:
<%
Sub UserDoesSomething
response.redirect "mypage.asp"
End Sub
%>
<%
If x = 1 Then
Call UserDoesSomething
Else
End If
%>
I was wondering what the php equivalent is to writing and calling a sub like the example above?
Thanks much for the post backs!
sub routines in php
Moderator: General Moderators
functions 
Code: Select all
<?php
function UserDoesSomething ()
{
header('Location: http://www.mydomain.com/mypage.php');
}
if ($x == 1) {
UserDoesSomething();
}
?>