miligraf Posted February 19, 2007 Share Posted February 19, 2007 Hey there, the problem ive encountered is: I made a control panel but i run a two language site, so instead of having two different files for each language, ived used this in every file (add, edit, delete) so they have a language selector with an URL like this www.domain.com/?page=add&connection=english: $connection=$_GET['connection']; include('databaseconnection-selector.php'); In the databaseconnection-selector.php file i have this: $connection=$_GET['connection']; if ($connection==english) include('english-databaseconnection.php'); else include('theotherlanguage-databaseconnection.php'); Oh and the problem is that i can only Add and Edit for the language that is in the else condition (default) so i have to put the other language in the else condition so i can Add and Edit for that language. I hope you get the idea of what i have done lol Quote Link to comment Share on other sites More sharing options...
Psycho Posted February 19, 2007 Share Posted February 19, 2007 Two things: 1. You do not need to have "$connection=$_GET['connection'];" in both files. You are just resetting the variable to the same value 2. I believe the problem is due to the fact that you are not enclosing "english" within quotes of your if statement. This if ($connection==english) Should be this if ($connection=="english") Quote Link to comment Share on other sites More sharing options...
Ninjakreborn Posted February 19, 2007 Share Posted February 19, 2007 <?php $connection=$_GET['connection']; echo "<br />"; echo "Connection: " $_GET['connection']; echo "<br />"; if ($connection==english) { require_once('english-databaseconnection.php'); }else { require_once('theotherlanguage-databaseconnection.php'); } ?> Try that and paste the output here. Quote Link to comment Share on other sites More sharing options...
miligraf Posted February 19, 2007 Author Share Posted February 19, 2007 None is working. This is what happens when i try to edit the "english" database (theotherlangua database is in the else so its the default), i get the fields with the info that i can edit and submit changes but when i want to see the changes, i dont see any...it doesnt change the info in the database. Like if i could Add info but not Edit it. Quote Link to comment Share on other sites More sharing options...
miligraf Posted February 20, 2007 Author Share Posted February 20, 2007 Sorry for double post but i cant modify my last post. businessman332211: When i hit the "Update" button i see that it connects to the other language database and thats why it doesnt change anything... Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 20, 2007 Share Posted February 20, 2007 Uhm, when you do the edit, does it still have the variable in the url? Quote Link to comment Share on other sites More sharing options...
miligraf Posted February 20, 2007 Author Share Posted February 20, 2007 Ok, its fixed...the form was all in a file so when i hitted "Update" it ran the second part of it but now it runs another file that does the updating BUT i still wonder why this doesnt work (have all in one file)? why do you need another file that does the update part? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.