icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.

» Surpass Web Hosting Forums » Choosing Surpass » Signed Up? » PHP Problem

Signed Up? If you're new with a question, ask here!

Reply
 
LinkBack Thread Tools Search this Thread
Old October 12th, 2005, 6:35 PM   #10 (permalink)
Registered User
Fresh Surpasser
 
Joined in Oct 2005
7 posts
Gave thanks: 0
Thanked 0 times
I get this error:

Parse error: parse error, unexpected T_CASE in /home/vesutij/public_html/index2.php on line 362

I'm a bit confused. It is okay for me to have news.php a PHP page while my regular ones are HTML documents, right?

Also, I installed the PHP program Cutenews.
If you know what I'm talking about, when you click 'Comments', the page content shows perfectly. Its the only thing on my website that is showing right now....

Last edited by Uchiha-Kun; October 12th, 2005 at 6:37 PM..
Uchiha-Kun is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 12th, 2005, 11:31 PM   #11 (permalink)
rocks your socks.
Resident.
 
David's Avatar
 
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,155 posts
Gave thanks: 8
Thanked 35 times
There is no default set. You need to set a default when you use case I believe. I could be wrong. I've just been using Haugland's code as examples for my own work.
__________________
Quote:
Originally Posted by removed View Post
Internet Explorer rules.
David is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 13th, 2005, 12:21 AM   #12 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,087 posts
Gave thanks: 48
Thanked 131 times
I have no idea what's on that line, so could you maybe paste that here? I just put both code examples into a file, it appears that you might have missed the "switch ($_GET[page) {" line...

You're not required to have a default value in there, but it sure beats the hell out of random errors when there's an incorrect or no value.

I've never used Cutenews before, so unfortunately I can only picture what you're refering too.
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 13th, 2005, 1:00 AM   #13 (permalink)
rocks your socks.
Resident.
 
David's Avatar
 
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,155 posts
Gave thanks: 8
Thanked 35 times
Ah, I always thought it was supposed to be there. Eh, I'll be keeping one though, just in case.
__________________
Quote:
Originally Posted by removed View Post
Internet Explorer rules.
David is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 13th, 2005, 7:08 PM   #14 (permalink)
Registered User
Fresh Surpasser
 
Joined in Oct 2005
7 posts
Gave thanks: 0
Thanked 0 times
errr...default? Do you mean the layout I want to load or the content on the first page?

Well, what exactly is around that area is:
PHP Code:
<p><br>
<div style="position: absolute; left: 150px; top: 325px; z-index: 2; overflow: visible; width: 620px;">
<!---------------START CONTENTS------------------>
<?php 

case "news"
include(
"news.php"); 
break; 

?> 
<!----------------END CONTENTS------------------->
</div>
Uchiha-Kun is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 13th, 2005, 8:44 PM   #15 (permalink)
H
after g, before i
Resident.
 
H's Avatar
 
Joined in Jul 2004
Lives in N,BC,CA
8,087 posts
Gave thanks: 48
Thanked 131 times
Yeah, you're missing exactly what I thought you were. You need to have the switch stuff in there too.

For some background information on how switch statements work; http://ca.php.net/switch
H is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 13th, 2005, 11:39 PM   #16 (permalink)
Registered User
Fresh Surpasser
 
Joined in Oct 2005
Lives in Canada
Hosted on Pass24
8 posts
Gave thanks: 0
Thanked 0 times
PHP Code:
<p><br>
<div style="position: absolute; left: 150px; top: 325px; z-index: 2; overflow: visible; width: 620px;">
<!---------------START CONTENTS------------------>
<?php 
switch ($_GET['page']) {
   case 
"news"
      include(
"news.php"); 
   break; 

   case 
"somethingelse"
      include(
"somethingelse.php"); 
   break; 

   default:
      include(
"news.php");
   break;
}

?> 
<!----------------END CONTENTS------------------->
</div>
That should work. The "default:" is used when the switch doesn't match any of the other cases.
Lucas is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 14th, 2005, 4:07 PM   #17 (permalink)
Registered User
Fresh Surpasser
 
Joined in Oct 2005
7 posts
Gave thanks: 0
Thanked 0 times
There is no parse error now but my problem goes back to the beginning; other pages are working [when I click on something else 'index2.php?page=faq' for example it shows the same thing as the news.php page]
Uchiha-Kun is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old October 14th, 2005, 4:25 PM   #18 (permalink)
Surpass Fan
Super #1
 
Joined in Aug 2004
Hosted on SH58
1,688 posts
Gave thanks: 6
Thanked 7 times
You have to modify the case logic to suit your own needs. Use the example as just that; an example or template. Do not just copy and paste.
__________________
- Evan Charlton | [site] | Server - SH58
Kickersny.com is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
Pingbacks are On
Refbacks are On