GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Mar-2006, 18:26
vigilantweather vigilantweather is offline
New Member
 
Join Date: Feb 2006
Posts: 28
vigilantweather is on a distinguished road
Exclamation

Errors?


Hi,

I have phpbb 2 and transferred servers today. I am working on fixing up a portal for my board on the new server.

In my file, board/login.php I get the following error:

Parse error: parse error, unexpected T_STRING in /home/vigilant/public_html/board/login.php on line 138

Here is line 138 of that file:
PHP Code:

$message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); 



And when i open board/index.php I get this error:

Parse error: parse error, unexpected T_STRING in /home/vigilant/public_html/board/includes/page_header.php on line 145

Here are lines 140-147 of that file: (145 is the { after else on 144)
PHP Code:

message_die(GENERAL_MESSAGE, $message);
}
}
}
else
{
$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&amp;', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "";
$redirect = str_replace("?", "&", $redirect); 


Any ideas?

Any quick help appreciated as this needs to be solved quickly!

Thanks.
Last edited by cable_guy_67 : 04-Mar-2006 at 03:34. Reason: Please surround php code with [php] ... [/php]
  #2  
Old 05-Mar-2006, 02:49
fallen_samurai fallen_samurai is offline
Awaiting Email Confirmation
 
Join Date: Oct 2005
Location: Wisconsin, USA
Posts: 29
fallen_samurai is on a distinguished road

Re: Errors?


I'm still examining this code, however I did notice something from the first piece of code you posted. It may have some effect on the end as well. Here is my thought:

I pulled out this particular piece of the code, everything else looked fine:

PHP Code:

"<a href=\"login.$phpEx?redirect=$redirect\">" 



The PHP will return a parse T_STRING error if a variable inside of the line itself cannot be found or recognized, in this case being $redirect and $phpEx. $redirect and $phpEx cannot be found either 1) because it isn't set right [not the case] or 2) because it is an invalid syntax for lookup [the case].

Try this:

PHP Code:

"<a href=\"login.{$phpEx}?redirect={$redirect}\">" 



Basically any variable code contained in PHP brackets needs to be contained first so it parses the data correctly. The {} brackets allow the $phpEx and $redirect variables to be interpreted before the rest of the line, kind of like brackets in mathematics. You can either use {} or \"\" like you already did for the line, but doing that might get messy. I just suggest using {} to make it much cleaner.

I hope this is anywhere close to what you were looking for, and hope that it helps. I will keep looking for more...

EDIT:
PHP Code:

append_sid("index.$phpEx") 


needs to be:
PHP Code:

append_sid("index.{$phpEx}") 



Same thing....maybe all of the errors lie in that? I don't see anything else wrong...
 
 

Recent GIDBlogDeveloping GUIs with wxPython (Part 2) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler errors vital_101 C Programming Language 4 12-Jan-2006 13:53
In Need of Some Serious Help...compiling errors [C++] needcishelp C++ Forum 25 21-Dec-2005 01:26
Help with compiler errors Krandygrl00 C++ Forum 3 01-Jun-2005 07:45
Linker errors with multiple file progam nkhambal C Programming Language 2 24-Apr-2005 02:37
Can somebody look at this and point out any errors to me soulfly C Programming Language 7 31-Mar-2004 09:45

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 18:49.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.