In Google cloud, Language texts not displayed in proper way - php

I have a piece of code in html and php for my index.php. This page is used for users to register. The users inserts its details and the registration process works successfully. The user can insert its details written in every language, and all characters are recognized and displayed in the right format. That works fine in localhost in my laptop using xampp. When I uploading my code to google cloud, however a problem occurs. If the user register himself with text lets say in Russian language, then in my database text stored in a strange format like & upsilon ; etc Probably the problem here is that when I upload my code to google cloud, not all language formats are read in the proper way. Any ideas on how to fix this?
This is my code:
<?php
include 'init.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="css/main.css" type="text/css">
<title> My page </title>
</head>
<body>
----------here is the form where the user register
</body>
</html>
my problem is that when a user

Related

Mail template encoding suddenly wrong. Only rewrite manually works it seems. Some tips, knowledge?

I have a problem with our E-Mail templates.
They worked fine until 2-3 days ago i have no idea what happened.
They should be utf8 encoded and get shown correctly in PHP Storm they look something like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
....
}
</style
</head>
<body>
<center>Content with unique characters like ěäüß</center>
</body>
</html>
But in the Email the output is completely rubbish:
Vaše zakázka etc.
I use the output buffer to get the template content and send it with PHPMailer.
There is no encoding anywhere but shouldn't be needed.
I tried utf8-encode/decode etc. It makes everything only worse.
The only thing that worked is to use tools like this http://www.percederberg.net/tools/text_converter.html
to convert the plain text into utf-8 and then the code looks like rubbish like in the mail output, but then you can manually correct every character.. that worked for some templates like in german with some äüß.... but in the Czech template you have to rewrite every single character.
Is there something that i missed? Something that i could try?
I used htmlentities() on the text parts of the templates and worked quite decent!
Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
....
}
</style
</head>
<body>
<center><?php echo htmlentities("Content with unique characters like ěäüß"); ?></center>
</body>
Hope this helps someone!

I want a facebook share button that share specific data on user's timeline?

I am new to working with facebook APIs, but i want a facebook share button on my website which share that specific data on user's timeline after log in to facebook. I have already read some documents on that and make a page for testing purpose on my localhost. But there is a problem
the page is,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<script>
function fbs_click(){
u=location.href;
t=document.title;
d='param kumar';
window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'t='+encodeURIComponent(t)+'&d'+encodeURIComponent(d),'sharer','toolbar=0,status=0,width=626,height=436');
return false;
}
</script>
<body>
<div>
<h2>Some content of my website pages..</h2>
</div>
<div id="fb">
If a tag can have multiple values, just put multiple versions of the same tag on your page. The first tag (from top to bottom) is given preference during conflicts.
Share on FB
</div>
</body>
</html>
But when I click on the share on Fb button, after log in to Facebook it shows a blank page.
Can any one help me out. thanks
Your url //localhost/paramRND/FbShare.php it will not work for it.add url which is live.
OR
You can make your local machine accessible by using localtunnel . You'll need to (temporarily) change some URLs used in your app code / html so links point to the temporary domain, but at least facebook can reach your machine.

Can I make the preview pane of Expression Web 4 honor <?php include ... ?> directives?

I have a website that uses a global header.inc file, containing the header I want on top of every HTML page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="de-at" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="standard.css.php" />
...etc...
Hence, the pages themselves look like this:
<?php include "header.inc"; ?>
<title>Page Title</title>
<style type="text/css">
/* additional style sheets for only this page */
</style>
</head>
<body>
...
Obviously, Expression Web complains about the unopened </head> tag and ignores the stuff present in the header file (e.g., the stylesheet), which makes the preview pane rather useless.
Since EW4 is supposed to "work nicely" with PHP, is there some way to make the preview pane honor includes? I've told EW where it can find the php-cgi.exe, so in the browser preview everything works nicely.

Changing the default dreamweaver templates

I'm not sure if this is programming-related enough for stack overflow, but anyways...
I want to change the code that is created in dreamweaver when you create a new HTML file or PHP file.
For example, I want to replace the default doctype and HTML tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
with this:
<!DOCTYPE html>
<html>
How can I do this?
On Mac OS X, you'll find Dreamweaver's Document Type Declaration configurations at:
/Applications/Adobe Dreamweaver/Configuration/DocumentTypes
To add a new template for HTML5 documents, open the file MMDocumentTypeDeclarations.xml and add a new element:
<documenttypedeclaration id="mm_html_5">
<title>
<MMString:loadString id="mmdocumenttypedeclarations/mm_html_5" />
</title>
<doctypedecl>
<![CDATA[<!DOCTYPE HTML>]]>
</doctypedecl>
<rootelement>
<![CDATA[<html></html>]]>
</rootelement>
<dtdcontext>html</dtdcontext>
<dtdcontext>html5</dtdcontext>
<dtdcontext>frameset_frame</dtdcontext>
<dtdcontext>xslt</dtdcontext>
</documenttypedeclaration>
When creating new documents, Dreamweaver references MMDocumentTypeDeclarations.xml and matches the <dtdcontext> against the Page Type you selected in the New Document dialog box.
By modifying this XML file, you don't have to edit any of the templates in:
/Applications/Adobe Dreamweaver/Configuration/DocumentTypes/NewDocuments
If you're running Dreamweaver CS5+ (version 11), Adobe already includes updated DTDs for HTML5:
Which creates the following blank document:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
You can change which DOCTYPE is used by default when creating new documents by going into Dreamweaver's preferences:
In Windows, the file is at
C:\Program Files\Adobe\Adobe Dreamweaver CS3\configuration\DocumentTypes\NewDocuments\Default.html
Replace "CS3" with your Adobe CS version.
Still works in 2019 (using the subscription) in Win10:
C:\Program Files\Adobe\Adobe Dreamweaver CC 2019\configuration\DocumentTypes\NewDocuments

php include not working on IE?

This include is not working in IE:
<?php
include_once 'localization.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Global Colleague</title>
<link href="css/style.css" rel="stylesheet" type="text/css"/><!--Start Kampyle Exit-Popup Code-->
<script type="text/javascript">
Calling an array inside localization.php
<?php echo l('content_p3'); ?>
EDIT: I tried the same file in another folder and it worked
"Not working" is very generic. What is it that you expect and what is actually happening? You may want to turn error reporting on and see if any error is reported. In (X)HTML, nothing should be printed before the doctype. Are you trying to add something to the HTTP response? Typically, the browser shouldn't effect how PHP outputs your code unless you've added some code to respond to the user agent which is not always wise.
Perhaps, when you tried your code in another directory it wasn't able to find the offending script as it is included by a relative path. Try removing the include in the original file and see if it "works".
The following way 100% work for you:
1) Install (Open Source) Notepad++ On your PC
2) Open the file in it
3) Go to encoding and select (Encode in UTF-8 Without BOM)
4) Then click save
5) Now it can work on (Chrome) and (IE)
:)

Categories