Jump to content

gasma1975

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gasma1975's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I tried it and its not working ! ??? I need to be able to build my message. Because I POST values from my form to email them after. So I get all data inline, its very hard to read and its really not sexy ! So this is why I use the append .
  2. Here is an example of what I'm using on my website I keep a track if the user is French or English, so I have a language Session variable session_start(); $lang= $_SESSION['lang']; The user is using a drop down for english or French <select name="lang"> <option value= "1" <?php if($_SESSION['lang']==1){echo 'selected="selected"';} ?>> English</option> <option value= "2" <?php if($_SESSION['lang']==2){echo 'selected="selected"';} ?> >Francais</option> </select>
  3. Hi, (I'm using PHP mail on a APPACHE windows server) How do you create a message with multiple lines. I tried: $msg = "this text is on the first line" . "\n\n" . "This text is on the second line" ; But the problem is that I get both inline...so how to ? thx
  4. Hi, On page1.php I have a form with a Total value that I POST to page2.php In page2.php I would like to call a javascript function wich will increase the value of TOTAL and display it in HTML But the javascript function is enclosed in a PHP structure. What I tried is (but its not working) <?php echo "VALUE INCREASED = " . '<script type="text/javascript">javafunction($_POST['TOTAL']) </script>' ; ?> thank you for helping,
  5. Hi, I'm trying to implement a Country/State dropdown (found this one http://javascript.internet.com/forms/country-state-drop-down.html) Works fine...but I'm trying to retrieve the value of the STATE or Country with POST and its not working. All the javascript is in a .js file On my page1.php I have a form with those two Dropdown <select id='countrySelect' name='country' onchange='populateState()'></select> <select id='stateSelect' name='state'></select><script type="text/javascript">initCountry('CA'); </script> After I click my SUBMIT button I'm posting the values to page2.php But in my page2.php how do I read the state value ? thank you,
  6. Hi, I would like to know how to perform a query and output it as a table in my page. But I would like to have a delete or update option wich is associated to the query. Similar to the table in phpadmin. You have a pencil for the edit or red cross to delete it. Any idea where I can find some info about it ? thank you, gasma1975,
  7. Hi, I'm designing a multi language Website french/english. I have a dropdown with a button that will SET a global variable. Value 1 = English and 2 = French, the default language is value 1 (english) But when the person switch the language I will also Set the corresponding value in the dropdown and I will translate the website content. On my index.php page everything is fine. But if the person has selected the french language, when he's redirected to another page, the page is in english not french. I have to select the drop down language on each page ! very annoying. How can make it constant ? This is the code that will handle the drop down selection lnaguage if(isset($_POST['ChangeLanguage'])) { unset($_SESSION['lang']); $lang= $_POST['lang']; if ($lang == 1) { //English picked, load English page $_SESSION['lang']=1; } elseif ($lang == 2) { //French picked, load French page $_SESSION['lang']=2; } } This is the button and dropdown <form method="post" class="searchform" action="#"> <div align="right"> <select name="lang"> <option value= "1" <?php if($_SESSION['lang']==1){echo 'selected="selected"';} ?>> English</option> <option value= "2" <?php if($_SESSION['lang']==2){echo 'selected="selected"';} ?> >Francais</option> </select> <input type="submit" name="ChangeLanguage" value="Go" /> </div> </form> thank you, gasma1975
  8. Hi, I'm doing a Multi-Language website, on my page I have a drop down list with English or French. When you select English the $_SESSION['lang'] = 1 and French $_SESSION['lang']=2 All of my translated sentences are stored in a database. The table name is 'lang' 'lang' has 4 fields field 1 - ID -­> INT -­> Primary Key field 2 - ValueID -­> VARCHAR(100) -­> This is my identifier, corresponding to sentence that need to be translated field 3 - L1 -­> TEXT -> english corresponding sentence field 4 - L2 -­> TEXT -> French corresponding sentence I would like to create a function, where I passe the ValueID and the value of $_SESSION['lang'] then it will go get the sentence in the specified language for the ValueID I tried this: function GetSentence($ValueID) { $query="SELECT L$_SESSION['lang'] as Lsentence FROM lang WHERE id='$ValueID'"; $result=mysql_query($query); $line=mysql_fetch_object($result); $Lsentence=$line->Lsentence; return $Lsentence; } not working.... any suggestion ? gasma1975
  9. This code works fine...(sometimes not sure why I have to submit twice for the language to take effect) But still, I would like to fix the value in the dropdown list to the selected value. This code is in my page.php <?php session_start (); ?> <form name="Langform" method="post"> <select name="lang"> <option value = 1 >English <option value = 2 >French </select> <input type="submit" name="ChangeLanguage" value="Go"> </form> <?php $_SESSION['lang']=$_POST['lang']; if ($_SESSION['lang'] == 1) { //English picked, load English page echo 'ENGLISH !'; } elseif ($_SESSION['lang'] == 2) { //French picked, load French page echo 'FRENCH !'; } ?>
  10. Good it works ! One more thing, how do you fix the value in the Drop down list to the value that you have selected ? I mean, if I click the option 2 french, after I submit the value french is loaded, but in the drop down box I see english, I would like to fix it to french... thank you for helping gasma1975
  11. Revraz, Do I need a sbmit button with your code ? how does it work upon a change in the drop down list ? $_SESSION['language']=$_POST['language']; if ($_SESSION['language']==1) { //English picked, load English page } elseif ($_SESSION['language']==2) { //French picked, load French page } else { //Neither picked }
×
×
  • 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.