Jump to content

4554551n

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Everything posted by 4554551n

  1. Live server version PHP Version 5.2.15: output_buffering no value no value session.cookie_domain no value no value session.cookie_path / / Home server version PHP Version 5.3.1: output_buffering no value no value session.cookie_domain no value no value session.cookie_path / / I'm not sure about that, I mean maybe I don't understand your question, but I'll try to explain... When is on default lang, I can navigate fine, I can go on any page without problems, but problem is when I try to change site into other language(s), let's say I'm on page www.example.com/about.php and I want to see this page on let's say FR, site will redirect me, on www.example.com/index.php?lang=fr (this is ok) and then I can see FR lang on site but only on home page, but when I try to go on www.example.com/about.php then site put back default lang, in this case EN... Strange thing is that this script works fine on localhost... and actually I have this kind of script on other sites too, and there is no problem with it... Maybe it's have something with session_start(); cause on contact.php I have two times session_start(); Any idea? Thanks.
  2. Yeap, I'm using it in contact us form... cause of captcha image... What should I do?
  3. Hello, I made a website, with 3 lang on it, and site works fine (localhost) but when I upload it, default lang is EN and whenever I change lang on the web, let's say from EN to FR, page goes on that lang in this case on FR and redirect me on home page and all text on site is on FR, that's ok, but after that, when I try to click on let's say about us, then on it's own change it back to default lang, and show me that page (about us) but on default lang... Here is sample of code how it's look... This is select.php and I include_once this file on every page... <?php session_start(); header('Cache-control: private'); // IE 6 FIX if(isSet($_GET['lang'])) { $lang = $_GET['lang']; // register the session and set the cookie $_SESSION['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($_SESSION['lang'])) { $lang = $_SESSION['lang']; } else if(isSet($_COOKIE['lang'])) { $lang = $_COOKIE['lang']; } else { $lang = 'en'; } switch ($lang) { case 'en': $lang_file = 'lang.en.php'; break; case 'fr': $lang_file = 'lang.fr.php'; break; case 'de': $lang_file = 'lang.de.php'; break; default: $lang_file = 'lang.en.php'; } include_once 'lang/'.$lang_file; This is lang.en.php... $lang = array(); // menu $lang['txt1'] = 'Home'; $lang['txt2'] = 'About Us'; $lang['txt3'] = 'Services'; $lang['txt4'] = 'Contact'; It's the same for other two languages... and I simply put in index.php this... <ul> <li><a href="index.php"><em><b><?php echo $lang['txt1'];?></b></em></a></li> <li><a href="about.php"><em><b><?php echo $lang['txt2'];?></b></em></a></li> <li><a href="services.php"><em><b><?php echo $lang['txt3'];?></b></em></a></li> <li><a href="contact.php"><em><b><?php echo $lang['txt4'];?></b></em></a></li> </ul> Let's say again, this kind of code works fine on localhost, but on web not... Any idea why? Thank you. Cheers.
  4. You are telling me to change this $name = $_REQUEST['name']; $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("email@email.com", "Subject: $subject", $message, "From: $email" ); into $name = $_REQUEST['name']; $email = $_REQUEST['email'] ; $reply-to = $_REQUEST['reply-to'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("email@email.com", "Subject: $subject", $message, "From: $email", "Reply-to: $reply-to" ); What do u mean by "put valid email box"?
  5. Hello, I have a problem with my mailform.php cause I don't receive any emails... I don't know what to do, what exactly should I change? Can someone help me? Please note that I've changed real email address into this email@email.com <?php function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else {//send email $name = $_REQUEST['name']; $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail("email@email.com", "Subject: $subject", $message, "From: $email" ); echo "Mail sent"; ?> <meta http-equiv="REFRESH" content="3;url=index.html"> <?php } } else { echo 'Error, try again.'; ?> <meta http-equiv="REFRESH" content="3;url=index_6.html"> <?php } ?> And here is my html code <form action="../mailform.php" method="post"> <p>Name: <br /></p> <p><input type="text" name="name" size="30" /></p> <p>Email:<br /></p> <p><input type="text" name="email" size="30" /></p> <p>Subject:<br /></p> <p><input type="text" name="subject" size="30" /></p> <p>Message:<br /></p> <p><textarea cols="50" rows="10" name="message"></textarea></p> <p><input type="submit" value=" Send " /></p> </form> Thank you.
  6. Check this out http://www.tizag.com/phpT/include.php this should help ya...
  7. <?php if($HTTP_GET_VARS['lang'] == 'de' || $HTTP_GET_VARS['lang'] == "") { include 'lang_de.php';} if($HTTP_GET_VARS['lang'] == 'de') { include 'lang_de.php';} if($HTTP_GET_VARS['lang'] == 'en') { include 'lang_en.php';} if($HTTP_GET_VARS['lang'] == 'hu') { include 'lang_hu.php';} global $lang1, $lang2, $lang3, $lang4, $txt4; ?> This works well, just as there is a problem when users surf the page, for example, and be part of the FAQ page and wants to change the language,this script automatically return to the home, and since the default language is de, it is not possible to surf in another language... How to change this?
  8. I don't know what is the problem, I put this into index.php <?php $lang= $lang[en]; switch($lang){ case'en': include 'lang/en.php'; break; case'de': include 'lang/de.php'; break; <html> some content </html> } ?> and I have <?php echo $lang[1];?> on proper place in index.php I have this in en.php <?php $lang[1] ="HOME"; $lang[2] ="ABOUT US"; $lang[3] ="CONTACT"; $lang[4] ="FAQ"; $lang[5] = "Here goes txt,Here goes txt,Here goes txt,Here goes txt, Here goes txt,Here goes txt,Here goes txt,Here goes txt, Here goes txt, Here goes txt,Here goes txt,Here goes txt, Here goes txt, Here goes txt,Here goes txt,Here goes txt"; ?> and there is no output, and also I don't have text anywhere... I forgot to say that I'm using Nusphere Phped 5.9, if that means anything....
  9. I'm trying to use, but so far nothing it would be better if u can show me some example. Thanks.
  10. I saw that link earlier, however It's easier to use <?php echo $var ?> than "define". I'm not satisfied with that, is there any other way to solve this?
  11. Hi all, How do I create a PHP code such that if a user clicks on a button they get transferred to the equivalent page in another language, I have index.php <?php include_once 'file.php'; ?> <html><div class="menu"> <a href="index.php?lang=en" > <img title="Eng" src="images/en.png" alt="" /> </a> <a href="index.php?lang=de"> <img title="Ger" src="images/de.png" alt="" /> </a> <a href="index.php?lang=hu" > <img title="Hun" src="images/hu.png" alt="" /> </a> </div> </html> and I have another file.php <?php ob_start(); session_start(); header('Cache-control: private'); if(isSet($HTTP_GET_VARS['lang'])) { $lang = $HTTP_GET_VARS['lang']; //* register the session and set the cookie *// $HTTP_SESSION_VARS['lang'] = $lang; setcookie("lang", $lang, time() + (3600 * 24 * 30)); } else if(isSet($HTTP_SESSION_VARS['lang'])) { $lang = $HTTP_SESSION_VARS['lang']; } else if(isSet($HTTP_COOKIE_VARS['lang'])) { $lang = $HTTP_COOKIE_VARS['lang']; } else { $lang = 'en'; } switch ($lang) { case 'en': $lang_file = 'lang.en.php'; break; case 'de': $lang_file = 'lang.de.php'; break; case 'hu': $lang_file = 'lang.hu.php'; break; default: $lang_file = 'lang.en.php'; include_once './languages/'.$lang_file; } ?> and it doesn't work, basically all I want is php script, so when user browse through page can change it in another language... Here is another way, but I found also problem here.... I have index.php <?php if($HTTP_GET_VARS['lang'] == 'de' || $HTTP_GET_VARS['lang'] == "") { include 'lang_de.php';} if($HTTP_GET_VARS['lang'] == 'de') { include 'lang_de.php';} if($HTTP_GET_VARS['lang'] == 'en') { include 'lang_en.php';} if($HTTP_GET_VARS['lang'] == 'hu') { include 'lang_hu.php';} global $lang1, $lang2, $lang3, $lang4, $txt4; ?> <html>Some content here</html> Problem is when user change language somewhere deep in the page, script automatically returns him to the home of page, so it's useless, cause u can't browse page on another language except default language. All I want is one nice script for browsing through page on whatever language user want. What's wrong with this? I mean in first case script doesn't work and I don't why.... and in the second case script works, but not properly... Thanks.
  12. Hello, im new with php.... so can someone show me how can I do registration field with php? i only know this (what to add to this or to remove) i dont know how to write registration field, so anyone help? <form action=""index.php" method=POST> Username <input type=text name=user> <br /> Password <input type=password name=pass><br/> <input type=submit value="Go"><p> </form> <?php $user=$_POST("user"); $pass=$_POST("pass"); if (($user=="user1")&&($pass="123")) echo "Access Granted"; else echo "Acess Denied"; ?> thanks
×
×
  • 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.