hi... i am working in a php,sql , html Website.. Arabic site is the mirror site of the english site.. in my index.php there is a line of code <a href="/ar/"index.php"><img src="arabic.gif" border="0" alt="" /></a> HTML: the above line of code links to the index.php of the arabic site.. all the html and php pages of arabic site is included in a folder 'ar'. wat i want to do is.... if i am in the test.php of english site it should link to the test.php of arabic site. likewise if i am in a page of english site, it should link to the corresponding page of arabic site... Hope u understood the problem.. kindly someone pls give me a solution... thank u...
If you create a varable in PHP that represents the language, then you just need to plug that into the HTML. <?php $lang = en; ?> <a href="/<?php print $lang ?>/test.php"> When someone selects a language, that is carried by the variable... which should be plugged into your menu selection. If someone clicks on the language of that page, you need to worry that the langauge link is incorprated to the corresponding page with the variable in the address. Hope this helps.
First, delete the quotation mark after ar". So this code line is for the english page linking to arabic page: <a href="/ar/test.php"><img src="arabic.gif" border="0" alt="" /></a> Now for the arabic page linking to english page: <a href="/en/test.php"><img src="english.gif" border="0" alt="" /></a> Suposing the english page is in a directory named: en Each .gif image must be accordingly placed on same directory as its calling test.php file. Check this: /ar/english.gif /en/arabic.gif This works beetween files placed in different directories on a same site. But if it is about working beetween different sites (hence the mirroring) then it should be like this: http:// www. my-arabic-site .com / english.gif http:// www. my-english-site .com / arabic.gif (delete spaces)
domvertex Thank u for ur help... i tried , but didnt work... i didnt get u on the last line of ur reply..can u pls explain me tat once again?? thanks a lot
Hi rrn, sorry I did lost this thread for many days, it didn't appeared on my panel. Well, my last line (delete spaces) is about I cannot write a full URL as I am new on this forum, so I wrote it with spaces beetween to make it just plain text and not a link. Now I see there is a problem on my previous answer, so you should use full URLs in these links. Maybe you already solved the problem. If not, tell me what you get right and what you get wrong.