Saturday, 9 August 2008
Monday, 21 April 2008
http://centricle.com/tools/html-entities/
The previous post used: http://centricle.com/tools/html-entities/ to search and replace the open tag brackets
How to use Google Translate to offer your website in different languages
Here is the form details to submit to Google translate, you need to replace the image source in the text below:
<form action="http://www.google.com/translate" >
<script language="JavaScript">
<!--
document.write ("<input name=u value="+location.href+" type=hidden>")
// -->
</script>
<input name="hl" value="en" type="hidden">
<input name="ie" value="UTF8" type="hidden">
<input name="langpair" value="" type="hidden">
<input name="langpair" value="en|fr" title="French" src= "images/flags/fr.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|de" title="German" src= "images/flags/de.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|it" title="Italian" src= "images/flags/it.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|pt" title="Portuguese" src= "images/flags/pt.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|es" title="Spanish" src= "images/flags/es.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|ja" title="Japanese" src= "images/flags/jp.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|ko" title="Korean" src= "images/flags/kr.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|zh-CN" title="Chinese Simplified" src= "images/flags/cn.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair2" value="en|ar" title="Arabic" src= "images/flags/sa.png" onclick="this.form.langpair.value=this.value" type="image" />
</form>
<form action="http://www.google.com/translate" >
<script language="JavaScript">
<!--
document.write ("<input name=u value="+location.href+" type=hidden>")
// -->
</script>
<input name="hl" value="en" type="hidden">
<input name="ie" value="UTF8" type="hidden">
<input name="langpair" value="" type="hidden">
<input name="langpair" value="en|fr" title="French" src= "images/flags/fr.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|de" title="German" src= "images/flags/de.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|it" title="Italian" src= "images/flags/it.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|pt" title="Portuguese" src= "images/flags/pt.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|es" title="Spanish" src= "images/flags/es.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|ja" title="Japanese" src= "images/flags/jp.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|ko" title="Korean" src= "images/flags/kr.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair" value="en|zh-CN" title="Chinese Simplified" src= "images/flags/cn.png" onclick="this.form.langpair.value=this.value" type="image">
<input name="langpair2" value="en|ar" title="Arabic" src= "images/flags/sa.png" onclick="this.form.langpair.value=this.value" type="image" />
</form>
Friday, 18 April 2008
Foreign Keys in Mysql
Here is a MYSQL statement to insert Foreign Keys:
create table table1(lid int(11) not null, tid mediumint(9), tag text, FOREIGN KEY(lid) REFERENCES table2(lid) ON DELETE CASCADE, FOREIGN KEY(tid) REFERENCES table3(tid) ON DELETE CASCADE, PRIMARY KEY(lid,tid));
create table table1(lid int(11) not null, tid mediumint(9), tag text, FOREIGN KEY(lid) REFERENCES table2(lid) ON DELETE CASCADE, FOREIGN KEY(tid) REFERENCES table3(tid) ON DELETE CASCADE, PRIMARY KEY(lid,tid));
mysql privileges to only one database rather than global
Here is the Mysql command for database specific user privileges rather than global:
grant all on database.* to 'user'@'localhost' identified by 'password';
grant all on database.* to 'user'@'localhost' identified by 'password';
Friday, 11 April 2008
print HTML block inside code
Here is an old classic for printing HTML block inside PHP:
$html = <<< EOH
EOH;
echo($html);
$html = <<< EOH
EOH;
echo($html);
Tuesday, 8 April 2008
Subscribe to:
Posts (Atom)