Nuke Toolbar

          
Quick Links 
 [Home Page ][ Category Listings ][ Forum Listings][ Forum FAQs]
[ HomeDNS - Domains ]  [ Nuke Resources ]  [ Nuke Skins and Themes ]  [ Nuke Sites Link Directory ]
[ LearningLinux.com ]  [ Nuke Fixes ]
[ NukeZone Hosting ]  [ Domain Name Database ]
Nuke Forums Forum Index

Nuke Sites Link Directory


syntax error, security images removed

 
Post new topic   Reply to topic    Nuke Forums Forum Index -> PHP Nuke New Users
View previous topic :: View next topic  
Author Message
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Sun Nov 02, 2003 10:13 pm    Post subject: syntax error, security images removed Reply with quote

OK, before I am told "Search for topics on this in the forums" I will just say I have. I found a post with a solution to this problem. Before I go into details I will give you info on the post.

First I found a post dealing with this issue.. this is the link to it http://www.nukeforums.com/forums/viewtopic.php?t=17589&highlight=

The post was solved with this anser
See Security code graphic not showing up for some suggestions. Search nukeforums for "security code" and you will find some useful threads too.

Now the "Security code graphics not showing up" is a link. I clicked it and this where it sent me. http://www.karakas-online.de/forum/viewtopic.php?t=22

Now to save you al the trouble of clicking it, this is the answer given.

Posted: Fri Jun 06, 2003 8:54 pm Post subject:

--------------------------------------------------------------------------------

This is also a frequent error, but it seems that the reasons (and cures) may be multiple:




You changed something in the language files and put comments - remove the comments

You (or your ISP) don't have the GD library loaded. Read http://forums.devshed.com/archive/5/2002/08/3/41595 on how to install GD on a Win2K box.

The gfx function in admin.php is not always working fine. You could try to put it in a separate file and change the call from admin.php to the new file. See Humpa's posting in http://www.nukeforums.com/forums/viewtopic.php?topic=14550&forum=40&start=0 for an example.

Activate (or reactivate) the 'Your Acount' module.



Another approach could be to bypass the security code altogether.
Here is how you do it:

Find the 7 occurances of:

extension_loaded("gd")

For the Admin login, there is one in the admin.php, and one in the auth.php.
For Users, there will be five in the modules/Your_Account/index.php (and there might be one in the block-Login.php, and/or one in the block-User_Info.php, if they are modified)
Replace all of the occurances with this:

$user=="whatever"

Follow the above instruction *exactly*.

For more thoughts on this, read

http://www.humpa.com/HelpMeHumpa/index.php?humpa_id=3#h3

I hope this helps.
_________________




Now I did what this solution told me to. I edit the files and replaced what I was told to replace.. Now my page is pretty much screwed.. in the LOG IN area it says "There isn't content right now for this block." and I have this "Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/blocks/block-Login.php on line 31" on the right side of my page above the Login area.

Now I was following the instructions to bypass the security image, so you know which instructions I was following. Thank god I backed up these files before I made any changes.. So, can somoene help me? I would LOVE to have the security images off my page.

Thank you in advance,
Rick[/b]


Last edited by RickRick on Thu Nov 06, 2003 8:08 am; edited 1 time in total
Back to top
View user's profile Send private message
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Mon Nov 03, 2003 3:40 am    Post subject: Reply with quote

RickRick wrote:

Now I did what this solution told me to. I edit the files and replaced what I was told to replace.. Now my page is pretty much screwed.. in the LOG IN area it says "There isn't content right now for this block." and I have this "Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/blocks/block-Login.php on line 31" on the right side of my page above the Login area.


So, what do you think? That the solution was wrong, or that you screwed something yourself in your editing efforts?

Could you please post the code in your html/blocks/block-Login.php that is around line 31? Not just line 31, but also a few lines around it. Maybe there is a semicolon missing in the previous line, for example. We have to find out what this error is, before we start implying that the solution is wrong (which it may very well be, depending on your PHP-Nuke version: you always have to take into account the time those posts were sent and the versions the author had in mind, or the versions that were at all available at that time).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Mon Nov 03, 2003 4:02 am    Post subject: Reply with quote

BTW, did you search all the other posts on this topic?

http://www.alltheweb.com/search?avkw=fogg&cat=web&cs=iso-8859-1&q=%22security+code%22+site%3Anukeforums.com&_sb_lang=any
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Tue Nov 04, 2003 1:37 am    Post subject: Reply with quote

Ok here is what you asked for.. Since I am newer to NUKE then most the kids today are to atari, I will just post the file since it's a small one you asked for.. here it is..

if (eregi("block-Login.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $admin, $user, $sitekey, $gfx_chk;

mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);

$content = "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
$content .= "<center><font class=\"content\">"._NICKNAME."<br>";
$content .= "<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>";
$content .= ""._PASSWORD."<br>";
$content .= "<input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>";
if ($user=="whatever") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
$content .= ""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'><br>\n";
$content .= ""._TYPESECCODE."<br><input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\">\n";
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><br>\n";
} else {
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
$content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">";
}
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\"></font></center></form>";
$content .= "<center><font class=\"content\">"._ASREGISTERED."</font></center>";

if (is_admin($admin) AND is_user($user)) {
$content = "<center>"._ADMIN."<br>[ <a href=\"admin.php?op=logout\">"._LOGOUT."</a> ]</center>";
}

?>


Now as far as what I think is wrong... I did it just as the instructions said.. I even put 3 differen't objects near me and moved one everytime I found it in the first file that I changed, since there was 5 and I didn't want to loss track. As I have said in other post (not sure if you read them or not) but I am using Nuke 6.9.. not sure if that helps at all... So you know, I uploaded all the back up files to my server so I'm back at square 1. I still have the changed files and it would take seconds to change it back, in case you need to see it or anything.. If you do, just say so..

Rick


PS. So you know.. There was a bit more to that file, but it was just text for who ever is editing it to read, not lines of code... but if you need the whole thing, I will be more then happy to post it
Back to top
View user's profile Send private message
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Tue Nov 04, 2003 3:17 am    Post subject: Reply with quote

Which line is line 31 in the above code?

I guess you didn't post the initial <?php line, so even counting lines will give me the wrong line for number 31.

Anyway, I cannot see any error there, but I did a diff to a standard block-Login.php I had, and it said that there was a newline at the end of file. Maybe I introduced that while copying from the forums to my computer, but, to avoid this pitfall, could you please check with a decent text editor, that there are no new lines after the ending ?> and that there are no other invisible characters? For this reason, you should not use Notepad or Wordpad for editing PHP files.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Tue Nov 04, 2003 6:43 am    Post subject: Reply with quote

OK here is the whole file using the text editor you suggested

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (eregi("block-Login.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $admin, $user, $sitekey, $gfx_chk;

mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);

$content = "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
$content .= "<center><font class=\"content\">"._NICKNAME."<br>";
$content .= "<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>";
$content .= ""._PASSWORD."<br>";
$content .= "<input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>";
if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
$content .= ""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'><br>\n";
$content .= ""._TYPESECCODE."<br><input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\">\n";
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><br>\n";
} else {
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
$content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">";
}
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\"></font></center></form>";
$content .= "<center><font class=\"content\">"._ASREGISTERED."</font></center>";

if (is_admin($admin) AND is_user($user)) {
$content = "<center>"._ADMIN."<br>[ <a href=\"admin.php?op=logout\">"._LOGOUT."</a> ]</center>";
}

?>



Thats all of it...

I have seemed to come across another problem. I will post it here, but will also see if I can search the forum to find the answer myself. After my last post I went to my site. Now as I said I uploaded the original files back to my site to start fresh. Well when I went there before it had log me in on it's own (thats not a problem). But I didn't have access to my admin area. I also wanted to try your suggestion about C&P the URL in the property's area of the security image. When I did the image showed up fine, then all of a sudden it started working again everytime I refreshed the page, But I still had no access to my admin area. Being the smart one that I am (thats sarcatic), I thought if I logged out, then back in (seeing as the image was showing up) It might reboot my site and give me my admin access again. Well the final outcome is that I am logged out of my site with no way back in, from what I can see....

Rick
Back to top
View user's profile Send private message
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Tue Nov 04, 2003 7:59 pm    Post subject: Reply with quote

OK here is an update.. I managed to get into my admin section by using the direct URL to my admin.php. So thats fixed.. Just wanted to let you know..
Back to top
View user's profile Send private message
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Wed Nov 05, 2003 9:01 am    Post subject: Reply with quote

You gave me the original, correct file. I want the one that was supposed to be flawed, the one you changed and brought up that "error at line 31". I have to find out what that error was, because you were suggesting it was due to my solution, but I think it was a syntax error on your part.

Give it another try please.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Wed Nov 05, 2003 9:13 am    Post subject: Reply with quote

From what I see (and count... ), the error on line 31 seems to refer to line

Code:

if ($user=="whatever") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {


You should put blanks around "==". Probably PHP interprets the whole "user==" as a variable name it has to evaluate.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Wed Nov 05, 2003 9:29 pm    Post subject: Reply with quote

OK here is the file after I had edited it. I also changed the "==" with spaces before and after as you can see.

<?php

/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/

if (eregi("block-Login.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

global $admin, $user, $sitekey, $gfx_chk;

mt_srand ((double)microtime()*1000000);
$maxran = 1000000;
$random_num = mt_rand(0, $maxran);

$content = "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
$content .= "<center><font class=\"content\">"._NICKNAME."<br>";
$content .= "<input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>";
$content .= ""._PASSWORD."<br>";
$content .= "<input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>";
if ($user == "whatever") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {
$content .= ""._SECURITYCODE.": <img src='modules.php?name=Your_Account&op=gfx&random_num=$random_num' border='1' alt='"._SECURITYCODE."' title='"._SECURITYCODE."'><br>\n";
$content .= ""._TYPESECCODE."<br><input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\">\n";
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><br>\n";
} else {
$content .= "<input type=\"hidden\" name=\"random_num\" value=\"$random_num\">";
$content .= "<input type=\"hidden\" name=\"gfx_check\" value=\"$code\">";
}
$content .= "<input type=\"hidden\" name=\"op\" value=\"login\">";
$content .= "<input type=\"submit\" value=\""._LOGIN."\"></font></center></form>";
$content .= "<center><font class=\"content\">"._ASREGISTERED."</font></center>";

if (is_admin($admin) AND is_user($user)) {
$content = "<center>"._ADMIN."<br>[ <a href=\"admin.php?op=logout\">"._LOGOUT."</a> ]</center>";
}

?>


I then Uploaded it with all the files I had edited last time, Just the was it said to. Then I refresed my page and this is what it says

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/blocks/block-Login.php on line 31

As you can see it's still the same error.

On a side note, I was wondering if there was a way of adding an HTML code that draws a picture from another site on the web into a block, Or maybe a module.. The site I'm doing is for a gaming clan, and We will be getting a server soon. I would like to make it so people can see what map is playing and who's on. the HTML is a simple code that draws the picture from the other website. This will be an example of the code.

<a href="http://www.slickcode.com" target="_blank"><img border="0" src="http://www.slickcode.com/slickquery?host=66.208.103.106&port=27015" alt="this image generated by slickcode.com"/></a>

When I add this to a block it comes up as a red X, kinda like my security image (Which now shows up when it wants to, and when it doesn't, I get the red X). Same thing if I try to add it to the content.

I also want to thank you for all the help you have been so far and forsee you being in the future.

Rick
Back to top
View user's profile Send private message
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Wed Nov 05, 2003 11:43 pm    Post subject: Reply with quote

I took the file you posted and put it in my local webserver. There is no PHP-Nuke on that box, but I just wanted to test. I got a more informative error than you:

Code:

Parse error: parse error, unexpected T_LOGICAL_AND in /xx/xxx/xxxxxxxx/html/blocks/block-Login.php on line 31


But of course! You are missing a "(" , that's all! Immediately after the "if ", you must put another "(" to enclose the whole expression, like this:

Code:

if (($user == "whatever") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7)) {


So it was a syntax error on your part after all...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Wed Nov 05, 2003 11:49 pm    Post subject: Reply with quote

RickRick wrote:
This will be an example of the code.

<a href="http://www.slickcode.com" target="_blank"><img border="0" src="http://www.slickcode.com/slickquery?host=66.208.103.106&port=27015" alt="this image generated by slickcode.com"/></a>


To add this in a block, you must write something like

Code:

<?php

if (eregi("block-My_Block.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}

$content  .=  "<a href=\"http://www.slickcode.com\" target=\"_blank\"><img border=\"0\" src=\"http://www.slickcode.com/slickquery?host=66.208.103.106&port=27015\" alt=\"this image generated by slickcode.com\"/></a>";

?>


Did you do it like this?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Thu Nov 06, 2003 7:11 am    Post subject: Reply with quote

OK.. I did what you told me, and it let me get 1 step further... then I got these errors

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/modules/Your_Account/index.php on line 65

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/modules/Your_Account/index.php on line 126

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/modules/Your_Account/index.php on line 463

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/modules/Your_Account/index.php on line 519

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/modules/Your_Account/index.php on line 728

Parse error: parse error in /data/members/free/tripod/uk/c/s/c/csclancdx/htdocs/PHP-Nuke/html/auth.php on line 26

After looking at the first one, I realized that it was the same problem all over again, missing the "(", So I went ahead and corrected them as I came across them. Now it works like a dream.. Thank you once again.

Now, About the image I was talking about. I did what you said and copy and pasted what you told me to into a new block. I came across the same problem, the big red X from hell, But this time it was different.. it now has this after the X...

"; ?>

Not sure what this is or what it means. I also tryed to paste that into a new content page, and the same thing happened... Now I have a question, and if this can be done I want to forget about making this into a block, and rather do it in a content page. If/when we fix this problem and we get this image to show. Is there a way to make like 2 to 4 of these images show in 1 content page? Like having 2 to 4 of these pictures one under another?

Well thank you again.
Back to top
View user's profile Send private message
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Thu Nov 06, 2003 7:53 am    Post subject: Reply with quote

RickRick wrote:

After looking at the first one, I realized that it was the same problem all over again, missing the "(", So I went ahead and corrected them as I came across them. Now it works like a dream..


That's nice to hear. Could you now please change your first post in this thread to reflect the fact that it was a syntax error on your part, and not the solution, that caused the problem? A short hint would be enough for me to put things straight (I hope you understand my insistence, since that link to the solution points to my homepage and your first post implies that the solution I present "screwed" your site).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chris
President
President


Joined: 06 Nov 2002
Posts: 1047
Location: Outer Space

PostPosted: Thu Nov 06, 2003 8:03 am    Post subject: Reply with quote

Now, about your other problem with the "X" in the image:

Take the code I gave you above and put it in a file. Only that code, nothing else. Name the file "block-My_Block.php" - exactly that, without the ", of course.

Then go to the administration panel, click on "Blocks". Select "My Block" from the dropdown menu, select the position (left, middle, right) for the block. Leave everything else untouched. Click O.K. This will create the block "My Block" for you. In that block you should see the image.

If you still don't, click on the "X" with the right mouse button and select to "View image". You should then get an error: either the path to the image is wrong, or the other site cannot serve the image to yours, or something worse has happened...

That's all. No magic.

I can't help you with the Content module, but I guess that it is possible to put 4 images there, one after the other, if you put the right HTML code for them there...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RickRick
Corporal
Corporal


Joined: 26 Oct 2003
Posts: 13


PostPosted: Thu Nov 06, 2003 9:26 am    Post subject: Reply with quote

Well I did the image thing you suggested and nothing.. I'm not really sure whats wrong.. the code works on a normal HTML page, but not in Nuke. If anyone else has a suggestion.. feel free to post them
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Nuke Forums Forum Index -> PHP Nuke New Users All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group




Forum Options
Main Menu
index.phpForums Index
    - Collaped View
    + Expanded View
FAQFAQ
SearchSearch
MemberlistMemberlist
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesLog in to check your private messages
Log inLog in

Visitor Options
 
Subscribe
Unsubscribe


Keep informed of updates, bug fixes, software releases, news and more!
Installation or Upgrade Services for phpNuke or PostNuke? Require site maintenance, addons, modules or custom themes? Send private message or e-mail for rates and availablity.

Quick Links
  Domain Names
  Firewall Forums
  Joke Crazy
  Learning Linux
  Find your IP Fast!
  Purchase WinRAR

Trusted Nuke Sites
  NukeZone Hosting
  CMS Focus
  NukeFixes.com
  NukeResources.com
  NukeSkins.com
  NukeSites.com
  PHPNuke.org

Sponsor Links


NukeZone Hosting