Jump to content

jackw899

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jackw899's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ignore, i had my browser zoomed in lol !sorry
  2. Hi, I made a navigation bar with flash, i used a simple embed in html and it embed's fine, but in firefox it doesn't look right, but in IE its fine. www.webbcreative.co.uk/mr/ Thanks
  3. Yes this is probably the best way to do it.
  4. Select Return to this topic button by default.
  5. Try: <?php if(!isset($_COOKIE['language'])) { if(!isset($_POST['submit'])) { ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><? include("title.php"); ?></title> <style type="text/css"> <!-- body { background-image: url(images/background.jpg); } --> </style></head> <body> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p><br /> <br /> </p> <div align="center"> <h1>Language Selection</h1> <table width="200" border="0"> <tr> <form action="language.php" method="post"> <td width="114"><div align="left"><input type="image" src="images/swe.jpg" border="0" name="submitswedish" alt="Swedish"></div></td> <td width="1"> </td> <td><div align="left"></div></td> <td><input type="image" src="images/usa.jpg" border="0" name="submitusa" alt="Usa"></td> </form> </tr> <tr> <td><div align="center"><strong>SWE</strong></div></td> <td> </td> <td width="0"><div align="center"></div></td> <td width="110"><div align="center"><strong>USA</strong></div></td> </tr> </table> </div> <p align="center"> </p> </body> </html> <?php if(!isset($_COOKIE['language'])) { if(!isset($_POST['submit'])) { ?> <?php } else { $language = $_POST['language']; setcookie("language", $language, time()+3600);;//set to expire in 1 hour, 3600=seconds switch($language) { case usa: $redirect = "index.php"; break; case swedish: $redirect = "sv/index.php"; break; default: $redirect = "index.php"; } header("Location: $redirect"); } } else { $language = $_COOKIE['language']; switch($language) { case usa: $redirect = "index.php"; break; case swedish: $redirect = "sv/index.php"; break; default: $redirect = "index.php"; } header("Location: $redirect"); } } } ?>
  6. You could have more than 1 submit/image button with different names and have each one have an image of a flag on it, something like this: <form action="language.php" method="post"> <input type="image" src="images/flags/english.png" width="16px" height="11px" border="0" name="submitenglish" alt="English"> <input type="image" src="images/flags/german.png" width="16px" height="11px" border="0" name="submitgerman" alt="German"> <input type="image" src="images/flags/swedish.png" width="16px" height="11px" border="0" name="submitswedish" alt="Swedish"> </form>
  7. Hi, Try changing $usass = $mem['userid']; if (isset($_POST['rem'])) { $year = 3600*24*365; setcookie ("id" , "$usass", time()+$year); } to $usass = $mem['userid']; if (isset($_POST['rem'])) { $year = 3600*24*365; setcookie ("id" , $usass, time()+$year); }
  8. Does your website already have all the language files setup? And different code to make it display a different page per language: language.php <?php if(!isset($_COOKIE['language'])) { if(!isset($_POST['submit'])) { ?> <html> <head> <title>Site Name - Language Selection</title> </head> <body> <h1>Language Selection</h1> <form action="language.php" method="post"> <select name="language" id="language"> <option value="english" selected="selected">English</option> <option value="german">German</option> <option value="french">French</option> <option value="spanish">Spanish</option> <option value="andmore">And more...</option> </select> <input type="submit" name="submit" value="Submit"> </form> </body> </html> <?php } else { $language = $_POST['language']; setcookie("language", $language, time()+3600);;//set to expire in 1 hour, 3600=seconds switch($language) { case english: $redirect = "index.php"; break; case german: $redirect = "german/index.php"; break; case french: $redirect = "french/index.php"; break; case spanish: $redirect = "spanish/index.php"; break; default: $redirect = "index.php"; } header("Location: $redirect"); } } else { $language = $_COOKIE['language']; switch($language) { case english: $redirect = "index.php"; break; case german: $redirect = "german/index.php"; break; case french: $redirect = "french/index.php"; break; case spanish: $redirect = "spanish/index.php"; break; default: $redirect = "index.php"; } header("Location: $redirect"); } ?>
  9. You could have it so on the index page it checks if the cookie exists and if not it goes to language.php Something like this: index.php <?php if(!isset($_COOKIE['language'])) { header("Location: language.php"); } else { $language = $_COOKIE['language']; ?> <html> <head> <title>Main Page</title> </head> <body> <h1>Main Page</h1> <?php echo 'Selected language: '.$language; ?> </body> </html> <?php } ?> language.php <?php if(!isset($_COOKIE['language'])) { if(!isset($_POST['submit'])) { ?> <html> <head> <title>Site Name - Language Selection</title> </head> <body> <h1>Language Selection</h1> <form action="language.php" method="post"> <select name="language" id="language"> <option value="english" selected="selected">English</option> <option value="german">German</option> <option value="french">French</option> <option value="spanish">Spanish</option> <option value="andmore">And more...</option> </select> <input type="submit" name="submit" value="Submit"> </form> </body> </html> <?php } else { $language = $_POST['language']; setcookie("language", $language, time()+3600);;//set to expire in 1 hour, 3600=seconds header("Location: index.php"); } } else { header("Location: index.php"); } ?> You would need to change this code to make the index page do something with the language to display that language.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.