Welcome Guest, Not a member yet? Register   Sign In
Accessing a function directly
#2

[eluser]Randy Casburn[/eluser]
Such a well written question...such a little thought put the problem...

Open your most basic PHP reference and find the section on User Defined functions. It will explain that when you demand that PHP expect a parameter as input...it will do exactly what you tell it too.

Simply change your method declaration from
Code:
function post($id)
{

}

to...

Code:
function post( $id=NULL )
{

}

you can either capture $id=NULL and redirect on that or change $id do a different default value and show a predefined default post.

Randy


Messages In This Thread
Accessing a function directly - by El Forum - 10-22-2008, 10:55 PM
Accessing a function directly - by El Forum - 10-22-2008, 11:10 PM
Accessing a function directly - by El Forum - 10-22-2008, 11:17 PM
Accessing a function directly - by El Forum - 10-22-2008, 11:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB