Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Need Help with A Switch
Old 12-07-2009, 08:56 PM Need Help with A Switch
Junior Talker

Posts: 2
Name: Jenne
Trades: 0
Hi Guys and girls,
I'm new here but not to webmastering. I'm in the middle of redesigning my website and have run into a problem with my php [ I will admit I'm not brilliant at php but I try ]

So far I have been using the switch format like this:
<?php switch($_GET['page']) {
case "love":
$title = 'Top Ten Reasons To Fall In Love ';
$keywords = 'romance, love, flowers, diamonds, reviews,';
$description = ' 'Top Ten Reasons To Fall In Love ';
$inc_file = 'romance/love.php';
break;

Of course I also have a default page. This has worked until I reached the point where I have more than one sub folder within the main folder. I can't figure out how I go from one index in the main folder to another index in another directory in the same folder and I can't for the life of me figure out what I'm doing wrong!

If anyone wants to take a look or give me a clue I would be really grateful as writing is what I do best and what I really want to do again LOL

Hope this makes sense and if not please let me know and I will try to clarify further.

regards,
Jenne
jenne64 is offline
Reply With Quote
View Public Profile Visit jenne64's homepage!
 
 
Register now for full access!
Old 12-08-2009, 03:56 AM Re: Need Help with A Switch
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
do you declare the same variables in the script, because if you declare it a second time it will change into the second value.

For the default page you could make an if(!empty($_GET['page']))
So the variables for the default will onley work if the $get is empty, if the page still wont word your $get is not comming thru
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 12-08-2009, 10:37 AM Re: Need Help with A Switch
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
I don't really understand the problem, but I'm *quessing* it has to do with your paths being wrong when you are in a subfolder, wanting to go to another? Then use absolute paths or relative paths starting from the root, as in

/subfolder/file

instead of, i.e.

../subfolder/file
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 12-08-2009, 12:11 PM Re: Need Help with A Switch
Junior Talker

Posts: 2
Name: Jenne
Trades: 0
Thanks guys,
It was my paths that were wrong. Finally got this working thanks. I'm not the most logical person in the world but I try LOL

Thanks again for the help.

Jenne
jenne64 is offline
Reply With Quote
View Public Profile Visit jenne64's homepage!
 
Reply     « Reply to Need Help with A Switch
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13489 seconds with 12 queries