Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
PHP
PHP functions
PHP functions
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
mankolele
New Member
Join Date:
Sep 2006
Posts:
63
#1
PHP functions
Jan 26 '07, 07:23 AM
Is it possible to mix PHP functions with normal PHP code. Does it work?
Thanks
Motoma
Recognized Expert
Specialist
Join Date:
Jan 2007
Posts:
3236
#2
Jan 26 '07, 02:48 PM
Originally posted by
mankolele
Is it possible to mix PHP functions with normal PHP code. Does it work?
Thanks
I'm not entirely sure what you are asking. Could you give a little more detail about what you are trying to do?
Comment
Post
Cancel
cassbiz
New Member
Join Date:
Oct 2006
Posts:
202
#3
Jan 27 '07, 01:06 AM
Functions are put into the <?php ?> . Are you referring to php classes? If you are they are simply put a collection of functions already written which assist you to complete whatever task it is that you are working on.
Comment
Post
Cancel
mankolele
New Member
Join Date:
Sep 2006
Posts:
63
#4
Jan 29 '07, 06:55 AM
I mean something like
[PHP]
//normal code not in a function
if($session->logged_in)
{
echo "<h1 align =\"center\">Log ged In</h1>";
echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
."[<a href=\"userinfo .php?user=$sess ion->username\">M y Account</a>] "
."[<a href=\"useredit .php\">Edit Account</a>] ";
if($session->isAdmin())
{
echo "[<a href=\"admin.ph p\">Admin Center</a>] ";
}
echo "[<a href=\"process. php\">Logout</a>]";
{
//funtion
function login($subuser, $subpass, $subremember){
global $database, $form; //The database and form object
/* Username error checking */
$field = "user"; //Use field name for username
if(!$subuser || strlen($subuser = trim($subuser)) == 0){
$form->setError($fiel d, "* Username not entered");
}
[/PHP]
Comment
Post
Cancel
Motoma
Recognized Expert
Specialist
Join Date:
Jan 2007
Posts:
3236
#5
Jan 29 '07, 01:44 PM
Yes, it is perfectly fine to mix the two that way.
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment