Correct Site Header

Started on the old forum in May 2010 · view the original in the archive · old links redirect here

6 replies · 944 views · started 16 years ago · 1 min read

6 participants
l0rdrayven Developer · 83 posts #1

Guys what is the correct site header using UTF-8 encoding so that when i click the back key of my browser previous pages i entered will automatically loaded without waiting several seconds to load it again,.I saw certain sites that when i click back previous pages automatically reloaded without any page revalidation.I think it was because of cache save by the browser.. Anyway heres my site header..

header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; echo "<html xmlns="http://www.w3.org/1999/xhtml">";

It implies no-cache and must revalidated, maybe thats why when i browse my site at click back to the previous page the page will revalidate again and i must have to wait few seconds before its done,took a little hastle thats why i want to change it. My site is a session base.Please anyone helps me to fix this out,thanks a lot in advance... Heres my site http://pinoygsm.net

Not i rip persons off i will also do your arse !

cpg12 Junior · 32 posts #2

LoL!

Its very simple!!! -your site is almost finish! but simple Wap Mobile header you do not how to set! What the hell!?...

Heres a c0de...

 <?php
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/vnd.wap.xhtml+xml; charset=utf-8" />
<title>www.WapShared.com :: Unlimited Free Downloads
</title>
</head>
<body>

ü lol!Hehe

l0rdrayven Developer · 83 posts #3

l0l, do u really think that i dont know how to create a correct header for my site? just think about this one, do my site work well in any mobile browsers if my headers are incorrect? dont act so stupid man, try to understand and analize what im trying to imply regarding this topic. Its regarding cache headers and not the really type of header, lol.!

Not i rip persons off i will also do your arse !

metulj Super moderator Principal · 1,726 posts #4

i use this for WML

<?php
header("Content-type: text/vnd.wap.wml; charset=utf-8");
header("Pragma: no-cache");
header("Cache-Control: no-store; no-cache; must-revalidate");
echo("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>

and this for XHTML

<?
header("Content-type: text/html; charset=utf-8");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">";
        echo "<head>";
            echo "<link rel=\"Shortcut Icon\" href=\"img/favicon.ico\" type=\"image/x-icon\"/>";
                echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\"/>";
                    echo "<title>whatever</title>";
                echo "<meta name=\"description\" content=\" whatever\"/>";
                echo "<meta name=\"keywords\" content=\"bla, bla\"/>";
            echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/style.css\"/>";
        echo "</head>
?>

and haven't had any problems so far 😌

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

DiL Developer · 142 posts #5

i use this for my UnDiL.com and its works fine with me....

<?php
header("Cache-Control: no-cache, must-revalidate");
header('Content-type: text/html; charset=ISO-8859-1');
echo '<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>:: UnDiL.COM :: - Music,videos,wallpapers,games,chat,search,coding-forum,live cricket score... and much more..</title>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="no-cache" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<link rel="stylesheet" type="text/css" href="/css.css"/>
<meta name="description" content="undil.com meta description is goes here " />
<meta name="keywords" content="undil.com meta keywords is goes here " />
</head>';
?>
arnage Lead · 811 posts #6

Or:

echo '<?xml version="1.0" encoding="utf-8"?>';
echo '
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml"/>
<meta http-equiv="Cache-Control" content="max-age=0"/>
<title>...</title>
<link rel="stylesheet" type="text/css" href="wapforum.css"/>
<link rel="shortcut icon" href="favicon.ico"/>
<meta name="keywords" content="..."/>
</head>
<body>';
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
andyjay33 Developer · 75 posts #7

you can try this

[PHP]
header('Content-type: text/html; charset=utf-8');
[/PHP]

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close