Jump to content

Beppis

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by Beppis

  1. I want the cookie to deside where the visitor is heading. If the user choose swe then it should always be directed to /sv/index.php even if you type www.clickbuxer.com again... Go in and see my error message :'( http://www.clickbuxer.com
  2. When you select language I just got an error message Got an error message that says: This problem can sometimes occur if you are disabled or refused to take accept cookies. I have accepted cookies. My code is: language.php <?php if(!isset($_COOKIE['language'])) { if(!isset($_GET['lang'])) { ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>123</title> <style type="text/css"> <!-- body { background-image: url(images/background.jpg); } .style1 { color: #FFFFFF; font-weight: bold; } --> </style></head> <body> <p><br> <br> <br> <br> <br> </p> <div align="center" style="margin-top:400px;"> <table width="200" border="0"> <tr> <td width="114"><div align="left"><a href="language.php?lang=swe"><img src="http://www.clickbuxer.com/images/swe.jpg" border="0" alt="swedish" /></a></div></td> <td width="1" rowspan="2"> </td> <td rowspan="2"><div align="left"></div></td> <td><a href="language.php?lang=usa"><img src="http://www.clickbuxer.com/images/usa.jpg" border="0" alt="usa" /></a></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><div align="center" class="style1">SWE</div></td> <td> </td> <td width="0"><div align="center"></div></td> <td width="110"><div align="center" class="style1">USA</div></td> </tr> </table> </div> <p align="center"> </p> </body> </html> <?php } else { //Add cookie code $language = $_GET['lang']; setcookie("language", $language, time()+3600);//set to expire in 1 hour, 3600=seconds switch($language) { case usa: $redirect = "http://www.clickbuxer.com"; break; case swe: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } } else { //If cookie is already set $language = $_COOKIE['language']; switch($language) { case usa: $redirect = "http://www.clickbuxer.com"; break; case swe: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } ?> index.php <?php if(!isset($_COOKIE['language'])) { header("Location: http://www.clickbuxer.com/language.php"); } else { $language = $_COOKIE['language']; switch($language) { case usa: $redirect = "http://www.clickbuxer.com"; break; case swe: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } ?>
  3. Hi! How can I get this one right? echo "<iframe src="$row['url'].$rowe['id'];" border="0" framspacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe>";
  4. Nothing happens I want it to redirect you to another page <?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> <br /> <br /> </p> <div align="center"> <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="swedish" 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="usa" alt="ssa"></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($_GET['language'])) { // return lang (convert it to entities // to prevent any XSS attacks) $lang = htmlspecialchars($_GET['language']); // store for next time setcookie('language', htmlspecialchars($_GET['language'])); } elseif (isset($_COOKIE['language'])) { // set lang var $lang = $_COOKIE['language']; } if (!isset($lang)) { // if no $lang var set, use default $lang = 'en'; } 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 = "http://www.clickbuxer.com"; break; case swedish: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } } else { $language = $_COOKIE['language']; switch($language) { case usa: $redirect = "http://www.clickbuxer.com"; break; case swedish: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } } } ?>
  5. What could be the problem here?
  6. Thanks again But nothing happens when I click on the images It's not directing me to a page... Here's the code: <? 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> <br /> <br /> </p> <div align="center"> <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="swedish" 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="usa" alt="ssa"></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($_GET['language'])) { // return lang (convert it to entities // to prevent any XSS attacks) $lang = htmlspecialchars($_GET['language']); // store for next time setcookie('language', htmlspecialchars($_GET['language'])); } elseif (isset($_COOKIE['language'])) { // set lang var $lang = $_COOKIE['language']; } if (!isset($lang)) { // if no $lang var set, use default $lang = 'en'; } 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 = "http://www.clickbuxer.com"; break; case swedish: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } } else { $language = $_COOKIE['language']; switch($language) { case usa: $redirect = "http://www.clickbuxer.com"; break; case swedish: $redirect = "http://www.clickbuxer.com/sv/index.php"; break; default: $redirect = "http://www.clickbuxer.com"; } header("Location: $redirect"); } } } ?>
  7. Parse error: syntax error, unexpected $end in Line 106 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"); } LINE 106!!
  8. Thanks again! But what if I want the visitor to click on the images to choose language and not use that form that you showed me. How do I code an image to send that "submit" information? Thanks!
  9. Nice But what if I want to send them to two different pages? if the language is swedish, locate = sv/index.php if the language is english, locate = index.php The website looks like this http://www.clickbuxer.com/language.php Thanks
  10. Hi! I want to have a first page on my website where you as visitor can choose the preferred language. No login at all. I want to save this choice in a cookie or something. The easiest way So next time he/she visits, the language choice is already made for he/she. Any good suggestions for a php code that works?
  11. I know that I have $row and $rowe Got an error message now. Parse error: syntax error, unexpected ';' in line 97 $sql = "SELECT * FROM tb_ads2 WHERE id='$adse'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"])) { $user=uc2($_COOKIE["usNick"]); $sql2 = "SELECT * FROM tb_users WHERE username='$user'"; $result2 = mysql_query($sql2); $rowe = mysql_fetch_array($result2); echo $row['url'].'?epi='.$rowe['username'].; LINE 97 }
  12. I'm not so good at this echo "{$row['url']}&epi={$rowe['username']}"; Please help!
  13. I have an url in the database. I want to add an specific ending for each and single user. like: index.php?user=USERNAME. I need to get the url from a table in the database like Can anyone help me? $sql = "SELECT * FROM tb_ads2 WHERE id='$adse'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $urln = $row["url"]; I want to add an ending
  14. Hi! I want to add the users nickname to the urlcode. I don't have any clue how to And maybe add more text after the url www.url.comTEXTusername echo $row["url"];$row["username"]; Please help
  15. Hi! What should the code be if I get an IP address to a postback url and I want to find that member in my database who has that IP-address? The postback comes like this http://yoursite.com/postback.php?ip=xxx Please help
  16. Fatal error: Cannot redeclare limitatexto() (previously declared in funciones.php:4) in funciones.php on line 12 <?php function limitatexto( $texto, $limite ) - Line 4 { if( strlen($texto)>$limite ) { $texto = substr( $texto,0,$limite ); } return $texto; } Line 12
  17. Got an unexpected T_STRING on line 65: <? // Si estan definidas las variables de las cookies se procede a mostrar el menu pero no sin antes comprobar que los // datos de las cookies verdaderamete son del usuario en cuestion. if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"])) { // Se incluyen los archivos necesarios require('config.php'); require('funciones.php'); // Se sanitizan los datos de las cokies $user=uc($_COOKIE["usNick"]); // Se selecciona la tabla tb_users donde el usuario es el que se provee en la cookie $sql = "SELECT * FROM tb_users WHERE username='$user'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); // Se sanitiza de nuevo la cookie $wask = uc($_COOKIE["usNick"]); // Se define $wesk como el nombre de usuario de la tabla tb_users $wesk = $row['username']; // Se comprueba que el dato de la cookie sea el mismo que el de la tabla, de lo contrario se muestra error, se termina // el script y se borra la cookie. if("$wesk" != "$wask") { echo "Login incorrect."; ?> <input type="button" value="Reload Page" onClick="window.location.reload()"> <? exit(); } // Se sanitiza la cookie usPass $wazk = uc($_COOKIE["usPass"]); // Se define $wezk como el nombre de usuario de la tabla tb_users $wezk = $row['password']; // Se comprueba que el dato de la cookie sea el mismo que el de la tabla, de lo contrario se muestra error, se termina // el script y se borra la cookie. if("$wezk" != "$wazk") { echo "Login incorrect."; ?> <input type="button" value="Reload Page" onClick="window.location.reload()"> <? exit(); } echo" <ul> <li class="m1"><a href="../home.html" class="active">Home</a></li> HERE!!!!!!!!! <li class="m2"><a href="../about-us.html">About</a></li> <li class="m3"><a href="../services.html">Services</a></li> <li class="m4"><a href="../support.html">Support</a></li> <li class="m5"><a href="../contact-us.html">contacts</a></li> <li class="m6"><a href="../sitemap.html">Sitemap</a></li> </ul> "; } else { // funcion para sanitizar variables function limpiare($mensaje) { $mensaje = htmlentities(stripslashes(trim($mensaje))); $mensaje = str_replace("'"," ",$mensaje); $mensaje = str_replace(";"," ",$mensaje); $mensaje = str_replace("$"," ",$mensaje); return $mensaje; } $elref=limpiare($_GET["r"]); echo " <ul> <li class="m1"><a href="../home.html" class="active">Home</a></li> <li class="m2"><a href="../about-us.html">About</a></li> <li class="m3"><a href="../services.html">Services</a></li> <li class="m4"><a href="../support.html">Support</a></li> <li class="m5"><a href="../contact-us.html">contacts</a></li> <li class="m6"><a href="../sitemap.html">Sitemap</a></li> </ul> "; } ?>
  18. yes I got this error message now. Warning: include(/menu.php) [function.include]: failed to open stream: No such file or directory in /home/web28563/domains/pokersiten.se/public_html/bux/index.php on line 67 menu.php is in the same folder
×
×
  • 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.