Page 4 of 5

Posted: Sat Feb 19, 2005 3:15 pm
by theda
That would give the same information as before?

Posted: Sat Feb 19, 2005 3:16 pm
by feyd
it doesn't replace everything in the script, if that's what you are asking.

Posted: Sat Feb 19, 2005 3:22 pm
by theda
Oh no. Also, when I use what you suggested, It will only place the "news" info... (If that made no sense, go to: http://dumbass.ionichost.com and click all the links below (not rooster or jara).

Edit: This is what it looks like now (index.php)

Code: Select all

<?php

include("ver.php");

// Style settings
include($ver."/style.php");

// Page identification
if (isset($id)) &#123;
	$id = $id;
&#125; else &#123;
	$id = $ver."/news";
&#125;

switch($ver)
&#123;
  case 'de':
    switch($id)
    &#123;
      case 'link':
      case 'cont':
        $sec_i = 'Wenn Sie diese Netplatz magen, dann hier ist, alles das Sie möchten.';
        break;
      case 'gallery':
        $sec_i = 'Schauen Sie durch meinen Galerien und bemängeln Sie mir, dass Sie möchten.';
        break;
      case 'news':
      default:
        $sec_i = 'Lesen Sie über meinem Leben und machen Sie eiligen Urteile.';
        break;
    &#125;
    break;

  case 'en':
  default:
    switch($id)
    &#123;
      case 'link':
      case 'cont':
        $sec_i = 'If you actually like what is on this site, all the information you need is here.';
        break;
      case 'gallery':
        $sec_i = 'Look through snapshots of my life and criticize them as you feel.';
        break;
      case 'news':
      default:
        $sec_i = 'Read about my eventful life here and make your judgements swiftly.';
        break;
    &#125;
    break;
&#125;






// Begin output of page...
include($ver."/content.php");

?>
<noscript>

feyd | :roll: edit: bah, I was close... XD - theda

Posted: Sat Feb 19, 2005 3:38 pm
by feyd
all your links refer to $ver/script_name

the code is built to use 'script_name' (minus quotes)

it is dangerous to blindly include a file :: e.g. http://dumbass.ioinchost.com/?id=not_here
viewtopic.php?t=25394

Posted: Sat Feb 19, 2005 3:40 pm
by theda
I read that page, but it didn't make much sense.

Edit: I figured out what you meant, and fixed the minor glitch. Back to what we WERE talking about earlier.

Posted: Sat Feb 19, 2005 4:11 pm
by theda
Now how do I get the cookie to be read and put the info into the script.

Posted: Sat Feb 19, 2005 4:13 pm
by feyd
refer to my last post.

Posted: Sat Feb 19, 2005 4:21 pm
by theda
So I shouldn't use ?blah=page ?

Posted: Sat Feb 19, 2005 4:25 pm
by feyd
?id=page not ?id=en/page :roll:

Posted: Sat Feb 19, 2005 4:27 pm
by theda
But I need to if I am going to have two different websites (well same website, different languages)

Posted: Sat Feb 19, 2005 4:31 pm
by feyd
no, you don't. $ver is already known through the cookie.

Posted: Sat Feb 19, 2005 4:48 pm
by theda
Mmk, I removed that part (did some shuffling around to get it working)

Posted: Sat Feb 19, 2005 4:49 pm
by theda
Now onto what I originally needed help with. Now how do I integrate cookies, and make them replace $ver with either en or de?

Posted: Sat Feb 19, 2005 5:01 pm
by feyd
it's already being done.

Posted: Sat Feb 19, 2005 5:04 pm
by theda
No. I currently set $ver to "en". ($ver = "en")

Edit: That's because I could never get a cookie saved ^_^

All I need now, (Which is what I started out with)

1. setcookie() function page ("set.php") that I can do "set.php?set=en/de" and it will save a cookie with either en or de.
2. open that same cookie when I load index.php (which currently, to get $ver, it opens a second page ver.php) and detect what $ver should turn into.