Language link (bug?) Language link (bug?)
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Language link (bug?)

Started by mikeall, January 29, 2005, 01:30:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mikeall

Great piece of software!

I have recently enabled the langauges for CPG v1.3 and the flags can seen at the bottom of this page:
http://craftcards.82au.com/cards/index.php

To see the link problem, hover over the flags and see the link location (which if clicked will cause a 404).

An example of the link is http://craftcards.82au.com/var/subdomain/craftcards/html/cards/index.php?lang=dutch

I have bolded the problem section. I had a look in the functions but couldn't find a solution.
Is the problem with here?:


//get the url and all vars except $lang
//$cpgChangeUrl = $_SERVER["SCRIPT_NAME"]."?";
$cpgChangeUrl = $_SERVER["SCRIPT_NAME"]."?";
foreach ($_GET as $key => $value) {
    if ($key!="lang"){$cpgChangeUrl.= $key . "=" . $value . "&";}
}
$cpgChangeUrl.= 'lang=';


donnoman

It worked fine for me.

Dump the cache of your browser and retest.

mikeall

I changed the line (1589 of functions.inc.php) of code to:

$cpgChangeUrl = $_SERVER["PHPSELF"]["SCRIPT_NAME"]."?";

and the problem is fixed.

The develpers might want to adjust this if it isn't fixed already.

mikeall

Quote from: donnoman on January 29, 2005, 01:53:16 AM
It worked fine for me.

Dump the cache of your browser and retest.

That was because I just fixed it and you posted just before I could post.
:)

kegobeer

There is no $_SERVER["PHPSELF"].  If you upload this:

<?php
echo $_SERVER["PHPSELF"];
?>

you should get absolutely no output.

You can list all server variables available like this:

<?php
phpinfo();
?>

You'll see all _SERVER varaibles you can access.  Your server may not have SCRIPT_NAME available, but you may have another variable you can get the script name from.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots