Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 10:19 am EDT

Geeklog Forums

Undefined variable


elephant

Anonymous
Hi, I have installed Geeklog (v1.12.5-1) on a Win2K machine with IIS as the webserver. I have sucessfully installed MySQL (v3.23 Win32) and PHP (v4.0.6 windows installer package) and have loaded the Geeklog WEB into the IIS directory. All this appears to have worked fine. I am not using security as I am inside a firewall and this is just for demonstration purposes, to test the technology. However I have a problem with the installlation because when I access the WEB site using Microsoft's Internet Explorer, IIS can find the page and tries to serve it but the PHP scripts are failing.I get the following string of error messages when accessing the Index.php page: Warning: Undefined variable: topic in C:\Inetpub\Geektrap\english.php on line 250 Warning: Undefined variable: from in C:\Inetpub\Geektrap\english.php on line 300 Warning: Undefined variable: fromemail in C:\Inetpub\Geektrap\english.php on line 300 Warning: Undefined variable: from in C:\Inetpub\Geektrap\english.php on line 305 Warning: Undefined variable: shortmsg in C:\Inetpub\Geektrap\english.php on line 305 Warning: Undefined variable: type in C:\Inetpub\Geektrap\english.php on line 378 Warning: Undefined variable: type in C:\Inetpub\Geektrap\english.php on line 402 Warning: Undefined variable: qid in C:\Inetpub\Geektrap\english.php on line 560 Warning: Undefined variable: qid in C:\Inetpub\Geektrap\english.php on line 567 Warning: Undefined variable: qid in C:\Inetpub\Geektrap\english.php on line 568 Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\Geektrap\english.php:250) in C:\Inetpub\Geektrap\public_html\common.php on line 66 Warning: Undefined index: LastVisit in C:\Inetpub\Geektrap\public_html\common.php on line 71 Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\Geektrap\english.php:250) in C:\Inetpub\Geektrap\public_html\common.php on line 78 I can't find a file where these variables are defined. Are they meant to come from a file, or are the defined elsewhere? Any help would be appreciated! Regards Stephen Burns
 Quote

andrake

Anonymous
sometimes i have this problem when i upload files in the wrong file format (i.e. in binary instead of ascii) could it be the same under W2K ?
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
There is something wrong with your language file. Are you using english.php or a translation? Also, what version of Geeklog are you running?
The reason people blame things on previous generations is that there's only one other choice.
 Quote

Anonymous

Anonymous
Geeklog (v1.12.5-1). I'm using the english.php file that came with the Geeklog download. Also the problem in not confined just to the English.php file. It also appears in the common.php file (Undefined index: LastVisit).
 Quote

Status: offline

Tony

Site Admin
Admin
Registered: 12/17/01
Posts: 405
Location:Urbandale, Iowa
a problem with your language file. You are probably missing an end quote or a comma or something on line 250 in english.php.
The reason people blame things on previous generations is that there's only one other choice.
 Quote

elephant

Anonymous
I haven't modified the english.php file in any way. The section of code in question is thus. I've tried to keep changes to a minimum, just changing the directory names where appropriate. The code below creates the first error: Warning: Undefined variable: topic in c:program files/apache group/apache/htdocs/geeklog-1.25/public_html/english.php on line 250, etc. ############################################################################### # index.php $LANG05 = array( 1 => "No News to Display", 2 => "There are no news stories to display. There may be no news for this topic or your user preferences may be too restrictive.", 3 => "for topic $topic", 4 => "Today's Featured Article", 5 => "Next", 6 => "Previous" ); line 250 is row 3 of the array above. There are also a number of other fields that can't be found including: Warning: Undefined variable: from Warning: Undefined variable: fromemail Warning: Undefined variable: shortmsg Warning: Undefined variable: type Warning: Undefined variable: qid In the Common.php file, the lines: // update LastVisit cookie. This cookie is updated each time auth.php runs setcookie("LastVisit", time(), $expiredate1, $CONF["cookiepath"], $CONF["cookiedomain"], $CONF["cookiesecure"]); generate the following: Warning: Undefined index: cookiedomain the lines: if (!isset($HTTP_COOKIE_VARS["LastVisitTemp"])) { $temptime = $HTTP_COOKIE_VARS["LastVisit"]; } else { $temptime = $HTTP_COOKIE_VARS["LastVisitTemp"]; } // set cookie. setcookie("LastVisitTemp", $temptime ,$expiredate2, $CONF["cookiepath"], $CONF["base"], $CONF["cookiesecure"]); generate the following: Warning: Undefined index: cookiesecure Warning: Undefined index: LastVisit I am a bit at a loss. These fields must be fairly common. Could the problem be related to the MySQL Database connection? I'm not sure I have the database connected properly. Regards Stephen Burns.
 Quote

Anonymous

Anonymous
from what i understand it is simply the way that php works. variables can be used before they are defined but the error reporting status in the php.ini file or whatever you're using is likely set to E_ALL or something which will always report these warnings, though they don't actually effect the function of the script. i suggest you turn down error reporting under "error handling and logging" in the php.ini file to something where it only reports errors which would effect the running of the script. iirc there's such an example in the php.ini file itself. this worked for me at least.
 Quote

All times are EDT. The time is now 10:19 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content