|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
functions not working
okay I have never really used functions, so I am not sure how they work altogether, although it seemed sort of self-explainatory when I looked at another page I had with some functions. Alright so I want to do this:
PHP Code:
But when i use the page, I get: Fatal error: Call to undefined function: matchup() in c:\...editprofile.php on line 46 which, btw, is a pretty unrelated line of code: line 42-50: PHP Code:
which is when it goes to the if($isloggedin) part. So why won't this work? what do I not udnerstand? I have searched and tried lots of stuff. Any help would be great! |
|
#2
|
|||
|
|||
|
Here is a tip i've picked up from debugging many a php application. Whenever you get an error message, take a look at the line just before that one, in this case line 45. A majority of the time, this is where your error will actually be!
I think the problem here is that you have those closing brackets '}' all on the same row. I believe that in php the closing bracket cannot have anything between it and the first of the line. so get your code to look like this maybe: PHP Code:
and see if that helps any. Let me know how that works out for you! |
|
#3
|
|||
|
|||
|
new problem
okay so I decided to move the functions towards the beginning and move the switch to the end, and that solved it. I guess functions have to be declared before they are used. makes sense but i thought I saw it somewhere else done differently, maybe they were declared anyway oh well.
so now there is a new problem. I want to make an admin section where admins can edit any profile of any user. I have done this using the little article about the <<prev 1 2 3 next >> thing. But i think i dont understand the whole template thing. Well my editprofile page looks like this: it grabs the loggedin users sessionid and compares it to that of the users in the database, to retrieve that users information to be edited. this works fine for one person. But then my admin-main-edit page works like this: it grabs info from the users database not the session database, and I can not figure out how to grab from both using the template. so i decided that I would simply create a new $variable, use it to determine the user that was called on in the users database, compare that users info to the session database, so that it can simply get the right sessid and then call on the user info like it normally does. i hope tha made sense. at any rate the problem lies here: PHP Code:
but this is returning nothing in my url for $strMethod2. I tried this cause i thought it was how was suppossed to be written: PHP Code:
which returned: index.php?page=editprofile&strMethod='' it seems to be giving me an empty string for the variable. i hopes this makes sense. anyone with help would be awesome. thanx. |
|
#4
|
|||
|
|||
|
i will move this to a new thread
i will make this a new thread
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > functions not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|