Help! Small Bug on my PHP Script
Moderator: General Moderators
Help! Small Bug on my PHP Script
Last night I started to code a small order system for my website and I'm having a small problem that I can't manage to fix.
If you take a look at my orders backend all the pages seem to work fine but when you view a particular order, for some reason I get the "Home" screen at the bottom when viewing a single order; when viewing an order I don't want the "Welcome to..." bit and below that to appear. This is happening when you view all orders.
My code is looking like this:
How can I fix this?
---------------------------------------------
Issue Solved!
If you take a look at my orders backend all the pages seem to work fine but when you view a particular order, for some reason I get the "Home" screen at the bottom when viewing a single order; when viewing an order I don't want the "Welcome to..." bit and below that to appear. This is happening when you view all orders.
My code is looking like this:
How can I fix this?
---------------------------------------------
Issue Solved!
Last edited by Subfusion on Sun Dec 10, 2006 12:10 pm, edited 3 times in total.
- dibyendrah
- Forum Contributor
- Posts: 491
- Joined: Wed Oct 19, 2005 5:14 am
- Location: Nepal
- Contact:
Take a look at the orders homepage, beside the navigation there's some HTML and it lists the Pending orders. Now when you look at an individual order you get that HTML and Pending orders bit below the information of the order, that isn't supposed to go there.dibyendrah wrote:Please specify your problems in details.
What I want to know is how I can fix it?
Thanks
The pages that have $v and $a have the conditions; if $a or $v is not met or none of these conditions are requested then display that bit (The one that says "Welcome to...."). That's what I'm trying to achieveaaronhall wrote:the only if statement that I know of takes a list of conditions and runs the code inside the brackets only of those conditions have been met. Under what conditions do you want that part of the page to display? How would you translate that into a list of conditions for your if statement?
How can I do that?
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
You might check out this tutorial on conditional statements in PHP -- also, the empty function would be helpful in checking if $v or $a have been set.
I managed to sort it out with the following as well:
Thanks!
Code: Select all
if (!$a and !$v) {- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
This will throw notices if those variables wern't initialized.. you definantly should consider turning on error_reporting(E_ALL); aswell as using isset() or empty().Subfusion wrote:I managed to sort it out with the following as well:
Thanks!Code: Select all
if (!$a and !$v) {