i m learning php and i had this chuck of code
what i wanted to know why are the values empty and swaped in if and else if cases?
| SitePoint Sponsor |
i m learning php and i had this chuck of code
what i wanted to know why are the values empty and swaped in if and else if cases?

Can you elaborate on what you're trying to do?
I noticed you have a variable $pages and a variable $page. Is there a typo?
I would suggest initializing all your variables before the if-statements, rather than on the last else or within each if-statement. Then you would just set values to the ones you needed later. That's so you don't lose track of what variables were created where and what default value they were assigned.
Visit The Blog | Follow On Twitter
301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
Can be hosted on and utilize your own domain
Bookmarks