[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 04-07-2004, 09:29 AM   #1 (permalink)
NamePros Regular
 
drmaximus's Avatar
 
Join Date: Sep 2003
Location: .CA
Posts: 925
384.36 NP$ (Donate)

drmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to behold


Sad PHP parse error! Help please?

What are parse errors? This is a section in which an error has been detected... can anybody figure out what it is please? Thanks!


//--------------------------------
// Set up our vars
//--------------------------------

if ( $ibforums->input = $std->parse_incoming();
__________________
English-French-Italian Translation Offered
Free & Paid Premium Image Hosting Service
drmaximus is offline  
Old 04-07-2004, 11:39 AM   #2 (permalink)
Senior Member
 
Join Date: May 2003
Posts: 2,211
6,170.25 NP$ (Donate)

adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough

Breast Cancer
try this

if ( $ibforums->input = $std->parse_incoming);

there was a ( in the way

a parse error is an error that occurs when php tries to program the code (its called parsing) it found that there was a error in your code so gave a parse error

adam_uk is offline  
Old 04-07-2004, 11:47 AM   #3 (permalink)
NamePros Regular
 
drmaximus's Avatar
 
Join Date: Sep 2003
Location: .CA
Posts: 925
384.36 NP$ (Donate)

drmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to behold


Quote:
Originally posted by adam_uk
try this

if ( $ibforums->input = $std->parse_incoming);

there was a ( in the way

a parse error is an error that occurs when php tries to program the code (its called parsing) it found that there was a error in your code so gave a parse error

Cool, thanks Adam! The bad thing is... another error popped up and this one is strange. There shouldn't be any problem with this last line of code?



//+-------------------------------------------------
// GLOBAL ROUTINES
//+-------------------------------------------------

function fatal_error($message="", $help="") {
echo("$message<br><br>$help");
exit;
}
?>



parce error at the last line ie. what's wrong with ?>?

Solved that one, related to line 1 which erroneously had <?php instead of <? php

now another one popped up, this is bad!

//-----------------------------------------------
// USER CONFIGURABLE ELEMENTS
//-----------------------------------------------

// Root path

define ( 'ROOT_PATH', "./" );

// Enable module usage?
// (Vital for some mods and IPB enhancements)

define ( 'USE_MODULES', 1 );

Something wrong with the define root path line...?
__________________
English-French-Italian Translation Offered
Free & Paid Premium Image Hosting Service

Last edited by drmaximus; 04-07-2004 at 11:51 AM.
drmaximus is offline  
Old 04-07-2004, 01:08 PM   #4 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
If the parse error goes to the line of the closing ?> php tag, that often means there is an open } bracket somewhere earlier in the code. Are you able to post the whole file?
RJ is offline  
Old 04-07-2004, 01:23 PM   #5 (permalink)
NamePros Regular
 
drmaximus's Avatar
 
Join Date: Sep 2003
Location: .CA
Posts: 925
384.36 NP$ (Donate)

drmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to behold


Quote:
Originally posted by -RJ-
If the parse error goes to the line of the closing ?> php tag, that often means there is an open } bracket somewhere earlier in the code. Are you able to post the whole file?
I managed to solve that one, as previously edited above. There was an error related to line 1 which erroneously had <?php instead of <? php

But why do I keep getting new parce errors popping up one after another? I have been fighting fires the whole night till dawn right up to now! Latest one:


//-----------------------------------------------
// USER CONFIGURABLE ELEMENTS
//-----------------------------------------------

// Root path

define ( 'ROOT_PATH', "./" );

// Enable module usage?
// (Vital for some mods and IPB enhancements)

define ( 'USE_MODULES', 1 );



Something wrong with the define root path line (bolded)...?
__________________
English-French-Italian Translation Offered
Free & Paid Premium Image Hosting Service
drmaximus is offline  
Old 04-07-2004, 01:39 PM   #6 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
>> Something wrong with the define root path line (bolded)...?

Nope, nothing wrong there. I added it to one of my php files and it ran fine. Check for a missing "" quotation mark, apostrophe' or semicolon ; on previous lines.
RJ is offline  
Old 04-07-2004, 01:54 PM   #7 (permalink)
NamePros Regular
 
drmaximus's Avatar
 
Join Date: Sep 2003
Location: .CA
Posts: 925
384.36 NP$ (Donate)

drmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to behold


Whole file posted here, sorry for the mess. I have never done this ever before and hardly can tell apart php from pip. Thanks, the error is at the last line with the ?>

Quote:
<?php

/*
+--------------------------------------------------------------------------
| Invision Power Board v1.3 Final
| ========================================
| by Matthew Mecham
| (c) 2001 - 2003 Invision Power Services
| http://www.invisionpower.com
| ========================================
| Web: http://www.invisionboard.com
| Time: Sat, 20 Dec 2003 02:26:12 GMT
| Release: 77bf705428c5da8abef971836fc6606c
| Email: matt@invisionpower.com
| Licence Info: http://www.invisionboard.com/?license
+---------------------------------------------------------------------------
|
| > Wrapper script
| > Script written by Matt Mecham
| > Date started: 14th February 2002
|
+--------------------------------------------------------------------------
*/

//-----------------------------------------------
// USER CONFIGURABLE ELEMENTS
//-----------------------------------------------

// Root path

define ( 'ROOT_PATH', "./" );

// Enable module usage?
// (Vital for some mods and IPB enhancements)

define ( 'USE_MODULES', 1 );

//-----------------------------------------------
// NO USER EDITABLE SECTIONS BELOW
//-----------------------------------------------

define ( 'IN_IPB', 1 );

error_reporting (E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);

class Debug {
function startTimer() {
global $starttime;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
}
function endTimer() {
global $starttime;
$mtime = microtime ();
$mtime = explode (' ', $mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = round (($endtime - $starttime), 5);
return $totaltime;
}
}

class info {

var $member = array();
var $input = array();
var $session_id = "";
var $base_url = "";
var $vars = "";
var $skin_id = "0"; // Skin Dir name
var $skin_rid = ""; // Real skin id (numerical only)
var $lang_id = "en";
var $skin = "";
var $lang = "";
var $server_load = 0;
var $version = "v1.3 Final";
var $lastclick = "";
var $location = "";
var $debug_html = "";
var $perm_id = "";
var $forum_read = array();
var $topic_cache = "";
var $session_type = "";

function info() {
global $sess, $std, $DB, $INFO;

$this->vars = &$INFO;

$this->vars['TEAM_ICON_URL'] = $INFO['html_url'] . '/team_icons';
$this->vars['AVATARS_URL'] = $INFO['html_url'] . '/avatars';
$this->vars['EMOTICONS_URL'] = $INFO['html_url'] . '/emoticons';
$this->vars['mime_img'] = $INFO['html_url'] . '/mime_types';
$this->vars['FLAGS_URL'] = $INFO['html_url'] . '/flags';

}
}

//--------------------------------
// Import $INFO, now!
//--------------------------------

require ROOT_PATH."conf_global.php";

//--------------------------------
// The clocks a' tickin'
//--------------------------------

$Debug = new Debug;
$Debug->startTimer();

//--------------------------------
// Require our global functions
//--------------------------------

require ROOT_PATH."sources/functions.php";

$std = new FUNC;
$print = new display();
$sess = new session();

//--------------------------------
// Load the DB driver and such
//--------------------------------

$INFO['sql_driver'] = !$INFO['sql_driver'] ? 'mySQL' : $INFO['sql_driver'];

$to_require = ROOT_PATH."sources/Drivers/".$INFO['sql_driver'].".php";
require ($to_require);

$DB = new db_driver;

$DB->obj['sql_database'] = $INFO['sql_database'];
$DB->obj['sql_user'] = $INFO['sql_user'];
$DB->obj['sql_pass'] = $INFO['sql_pass'];
$DB->obj['sql_host'] = $INFO['sql_host'];
$DB->obj['sql_tbl_prefix'] = $INFO['sql_tbl_prefix'];

$DB->obj['debug'] = ($INFO['sql_debug'] == 1) ? $_GET['debug'] : 0;

// Get a DB connection

$DB->connect();

//--------------------------------
// Wrap it all up in a nice easy to
// transport super class
//--------------------------------

$ibforums = new info();

//--------------------------------
// Set up our vars
//--------------------------------

if ( $ibforums->input = $std->parse_incoming);
{

//--------------------------------
// Short tags...
//--------------------------------

if ( $ibforums->input['showforum'] != "" )
{
$ibforums->input['act'] = "SF";
$ibforums->input['f'] = intval($ibforums->input['showforum']);
}
else if ( $ibforums->input['showtopic'] != "")
{
$ibforums->input['act'] = "ST";
$ibforums->input['t'] = intval($ibforums->input['showtopic']);

// Grab and cache the topic now as we need the 'f' attr for
// the skins...

$DB->query("SELECT t.*, f.topic_mm_id, f.name as forum_name, f.quick_reply, f.id as forum_id, f.read_perms, f.reply_perms, f.parent_id, f.use_html,
f.start_perms, f.allow_poll, f.password, f.posts as forum_posts, f.topics as forum_topics, f.upload_perms,
f.show_rules, f.rules_text, f.rules_title,
c.name as cat_name, c.id as cat_id
FROM ibf_topics t, ibf_forums f , ibf_categories c
WHERE t.tid=".$ibforums->input['t']." and f.id = t.forum_id and f.category=c.id");

$ibforums->topic_cache = $DB->fetch_row();
$ibforums->input['f'] = $ibforums->topic_cache['forum_id'];
}
else if ( $ibforums->input['showuser'] != "")
{
$ibforums->input['act'] = "Profile";
$ibforums->input['MID'] = intval($ibforums->input['showuser']);
}
else
{
$ibforums->input['act'] = $ibforums->input['act'] == '' ? "idx" : $ibforums->input['act'];
}

//--------------------------------
// The rest
//--------------------------------

$ibforums->member = $sess->authorise();
$ibforums->skin = $std->load_skin();
$ibforums->lastclick = $sess->last_click;
$ibforums->location = $sess->location;
$ibforums->session_id = $sess->session_id;

list($ppu,$tpu) = explode( "&", $ibforums->member['view_prefs'] );

$ibforums->vars['display_max_topics'] = ($tpu > 0) ? $tpu : $ibforums->vars['display_max_topics'];
$ibforums->vars['display_max_posts'] = ($ppu > 0) ? $ppu : $ibforums->vars['display_max_posts'];

//--------------------------------
// Set up the session ID stuff
//--------------------------------

if ( $ibforums->session_type == 'cookie' )
{
$ibforums->session_id = "";
$ibforums->base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?';
}
else
{
$ibforums->base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?s='.$ibforums->session_id.'&amp;';
}

$ibforums->js_base_url = $ibforums->vars['board_url'].'/index.'.$ibforums->vars['php_ext'].'?s='.$ibforums->session_id.'&';

//--------------------------------
// Set up the forum_read cookie
//--------------------------------

$std->hdl_forum_read_cookie();

//--------------------------------
// Set up the skin stuff
//--------------------------------

$ibforums->skin_rid = $ibforums->skin['set_id'];
$ibforums->skin_id = 's'.$ibforums->skin['set_id'];

$ibforums->vars['img_url'] = 'style_images/' . $ibforums->skin['img_dir'];

//--------------------------------
// Set up our language choice
//--------------------------------

if ($ibforums->vars['default_language'] == "")
{
$ibforums->vars['default_language'] = 'en';
}

$ibforums->lang_id = $ibforums->member['language'] ? $ibforums->member['language'] : $ibforums->vars['default_language'];

if ( ($ibforums->lang_id != $ibforums->vars['default_language']) and (! is_dir( ROOT_PATH."lang/".$ibforums->lang_id ) ) )
{
$ibforums->lang_id = $ibforums->vars['default_language'];
}

$ibforums->lang = $std->load_words($ibforums->lang, 'lang_global', $ibforums->lang_id);

//--------------------------------

$skin_universal = $std->load_template('skin_global');

//--------------------------------
// Referral Mod
//--------------------------------
if($ibforums->input['act'] == Reg || isset($ibforums->input['refer'])){
require ROOT_PATH."sources/lib/referral.php";
$refer = new referral;

if(isset($ibforums->input['refer'])){
$refer->newrefer($ibforums->input['refer']);
}
}

//--------------------------------
// Expire subscription?
//--------------------------------

if ( $ibforums->member['sub_end'] != 0 AND ( $ibforums->member['sub_end'] < time() ) )
{
$std->expire_subscription();
}

//--------------------------------

if ($ibforums->input['act'] != 'Login' and $ibforums->input['act'] != 'Reg' and $ibforums->input['act'] != 'Attach' and $ibforums->input['module'] != 'subscription')
{

//--------------------------------
// Do we have permission to view
// the board?
//--------------------------------

if ($ibforums->member['g_view_board'] != 1)
{
$std->Error( array( 'LEVEL' => 1, 'MSG' => 'no_view_board') );
}

//--------------------------------
// Is the board offline?
//--------------------------------

if ($ibforums->vars['board_offline'] == 1)
{
if ($ibforums->member['g_access_offline'] != 1)
{
$std->board_offline();
}

}

//--------------------------------
// Is log in enforced?
//--------------------------------

if ( (! $ibforums->member['id']) and ($ibforums->vars['force_login'] == 1) )
{
require ROOT_PATH."sources/Login.php";

}

}

//--------------------------------
// Decide what to do
//--------------------------------

$choice = array(
"idx" => "Boards",
"SC" => "Boards",
"SF" => "Forums",
"SR" => "Forums",
"ST" => "Topics",
"Login" => "Login",
"Post" => "Post",
"Poll" => "lib/add_poll",
"Reg" => "Register",
"Online" => "Online",
"Members" => "Memberlist",
"Help" => "Help",
"Search" => "Search",
"Mod" => "Moderate",
"Print" => "misc/print_page",
"Forward" => "misc/forward_page",
"Mail" => "misc/contact_member",
"Invite" => "misc/contact_member",
"ICQ" => "misc/contact_member",
"AOL" => "misc/contact_member",
"YAHOO" => "misc/contact_member",
"MSN" => "misc/contact_member",
"report" => "misc/contact_member",
"chat" => "misc/contact_member",
"integ" => "misc/contact_member",
"Msg" => "Messenger",
"UserCP" => "Usercp",
"Profile" => "Profile",
"Track" => "misc/tracker",
"Stats" => "misc/stats",
"Attach" => "misc/attach",
'legends' => 'misc/legends',
'modcp' => 'mod_cp',
'calendar' => "calendar",
'buddy' => "browsebuddy",
'boardrules' => "misc/contact_member",
'mmod' => "misc/multi_moderate",
'warn' => "misc/warn",
'home' => 'dynamiclite/csite',
'module' => 'modules',
'referral' => 'Referral',
);


/************************************************** */
//

// Check to make sure the array key exits..

if (! isset($choice[ $ibforums->input['act'] ]) )
{
$ibforums->input['act'] = 'idx';
}

if ( $ibforums->input['act'] == 'home' )
{
if ( $ibforums->vars['csite_on'] )
{
require ROOT_PATH."sources/dynamiclite/csite.php";
$csite = new click_site();
}
else
{
require ROOT_PATH."sources/Boards.php";
}
}
else if ( $ibforums->input['act'] == 'module' )
{
if ( USE_MODULES == 1 )
{
require ROOT_PATH."modules/module_loader.php";
$loader = new module_loader();
}
else
{
require ROOT_PATH."sources/Boards.php";
}
}
else
{
// Require and run
require ROOT_PATH."sources/".$choice[ $ibforums->input['act'] ].".php";
}

//+-------------------------------------------------
// GLOBAL ROUTINES
//+-------------------------------------------------

function fatal_error($message="", $help="") {
echo("$message<br><br>$help");
exit;

}
?>
__________________
English-French-Italian Translation Offered
Free & Paid Premium Image Hosting Service
drmaximus is offline  
Old 04-07-2004, 02:37 PM   #8 (permalink)
Senior Member
 
Join Date: May 2003
Posts: 2,211
6,170.25 NP$ (Donate)

adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough

Breast Cancer
can you post the error

the code seems ok at a quick look
adam_uk is offline  
Old 04-07-2004, 03:36 PM   #9 (permalink)
NamePros Regular
 
drmaximus's Avatar
 
Join Date: Sep 2003
Location: .CA
Posts: 925
384.36 NP$ (Donate)

drmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to beholddrmaximus is a splendid one to behold


This is the error

Parse error: parse error in /home/domainabc/public_html/domaindef/forum/index.php on line 426

Line 426 is the last line, ?>
Thanks for the assistance.

UPDATE
OK, so I found out the error and added an } to resolve the above problem in index.php. These PHP codes are so fussy I am not ever going to MOD my IVBoard again!

NEW Problem now in functions.php! Arghhhhhh I am getting so embarrassed

Fatal error: Call to undefined function: clean_value() in /home/geppetto/public_html/glbtalk/forum/sources/functions.php on line 2444 (the bolded line)

Quote:
//--------------------------------------------
// no new headers if we're simply viewing an attachment..
//--------------------------------------------

if ( $ibforums->input['act'] == 'Attach' )
{
return $this->member;
}

$HTTP_SERVER_VARS['HTTP_USER_AGENT'] = $std->clean_value($HTTP_SERVER_VARS['HTTP_USER_AGENT']);

$this->ip_address = $ibforums->input['IP_ADDRESS'];
$this->user_agent = substr($HTTP_SERVER_VARS['HTTP_USER_AGENT'],0,50);
$this->time_now = time();
__________________
English-French-Italian Translation Offered
Free & Paid Premium Image Hosting Service

Last edited by drmaximus; 04-07-2004 at 03:51 PM.
drmaximus is offline  
Old 04-07-2004, 05:00 PM   #10 (permalink)
RJ
NamePros Founder

Administrator

 
Join Date: Feb 2003
Location: Bay Area, CA
Posts: 13,173
104,201.68 NP$ (Donate)

RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness

Find Marrow Donors! Cystic Fibrosis
It's looking for a function named clean_value() that isn't there?

Try commenting out that line. It doesn't seem to be doing anything important anyway.
RJ is offline  
Old 04-07-2004, 06:36 PM   #11 (permalink)
Senior Member
 
Join Date: Aug 2002
Posts: 1,300
2.85 NP$ (Donate)

deadserious has a spectacular aura aboutdeadserious has a spectacular aura about


Quote:
Originally posted by drmaximus
parce error at the last line ie. what's wrong with ?>?

Solved that one, related to line 1 which erroneously had <?php instead of <? php
Actually it should have <?php without the space and not <? php.


Also the line that adam_uk said to change to:

if ( $ibforums->input = $std->parse_incoming);

I think it should actually be:

$ibforums->input = $std->parse_incoming();

without any if statement in there, but other than that it's hard to say really what exactly the problem is.
deadserious is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 09:25 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85