<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>Hello Mr. Sumariva, i already did wht u said, but there's new error: <b>error</b>: Call to undefined function: on_get_contens() in <b>I:\ms4w\apps\appweb\htdocs\index_cobacham.phtml</b> on line <b>2<br><br>here i put the cobachanphtml.phtml: <br></b><span style="font-family: bookman old style,new york,times,serif;"><?php</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;">$html=on_get_contens();</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;">ob_end_clean();</span><br style="font-family: bookman old style,new york,times,serif;"><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman
old style,new york,times,serif;">include("./chameleon.php");</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $szTemplate="./template_werror.html";</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $szMapFile="../map/kelur_cobacham.map";</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> class SampleApp extends Chameleon //SampleApp merupakan turunan dari Chameleon</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> {</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new
york,times,serif;"> function SampleApp() //Nama fungsi</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> {</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> parent::Chameleon(); //Menjalankan konstruktor class Chameleon</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $this->moMapSession=new MapSession_RW; //Mbwt instance obj map session</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;">
$this->moMapSession->setTempDir </span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> (getSessionSavePath()); //Mendefinisikan dir temporer yg akn digunk olh obj map session</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> }</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new
york,times,serif;"> }</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> </span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $oApp= new SampleApp(); //Membut instance obj SampleApp</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $oApp->registerSkin('skins/sample'); //mendefinisikan skin utk obj SampleApp</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $oApp->CWCInitialize($szTemplate, $szMapFile); //MEnginisialisasi obj Lat01 dg
file template dan file .map</span><br style="font-family: bookman old style,new york,times,serif;"><span style="font-family: bookman old style,new york,times,serif;"> $oApp->CWCExecute(); //Menjalankan app dg memangil fs CWCExecute</span><br style="font-family: bookman old style,new york,times,serif;"><b><br>?><br><br>So, what should i do?<br> Thanks a lot for the attention, sorry reply not direct.<br></b></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Cristiano Sumariva <sumariva@gmail.com><br><b><span style="font-weight: bold;">To:</span></b>
elisabeth theresia <dbee_kawai@yahoo.com><br><b><span style="font-weight: bold;">Sent:</span></b> Tue, August 17, 2010 12:34:39 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [mapserver-users] how to disappear Warning: session_start() in the page?<br></font><br>
Well, you can turn the things by other way.<br>Put at top of HTML file in the ob_start() function to tell PHP to buffer all output.<br>Change your your index_cobachan by adding<br>$html = ob_get_contens();<br>ob_end_clean();<br>
<br>Now all the content that would be sent to browser is available at $html string variable.<br>After the includes in your index_cobachan print the contents of $html var.<br>Now do your application logic.<br>THen append the rest of HTML file.<br>
<br><br>Another option is to turn your HTML file into a template and add a special mark to signal template engine to replace some content but this would be another aproach.<br><br><div class="gmail_quote">2010/8/13 elisabeth theresia <span dir="ltr"><<a rel="nofollow" ymailto="mailto:dbee_kawai@yahoo.com" target="_blank" href="mailto:dbee_kawai@yahoo.com">dbee_kawai@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="font-family: garamond,new york,times,serif; font-size: 12pt;"><div>Thanks Mr.Sumariva for the advice but, session_start() in the page already embed in Chameleon framework at its folder in \htdocs\common\session<br>
<br>the coding at line 509 (that shown error in the page):<br><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">//start the session</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> session_start();</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> register_shutdown_function( "session_write_close" );</span><br style="font-family: arial,helvetica,sans-serif;">
<br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> </span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> // set IP if a new session</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> if ( $bNewSession ) $_SESSION["gszRemoteAdd"] = $_SERVER["REMOTE_ADDR"];</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">/* ============================================================================</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> * Check IP to see if it is the same</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> *
========================================================================= */</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> // check if the IP has been set and validate</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> if ( isset( $_SESSION["gszRemoteAdd"] ) &&</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> strlen(trim($_SESSION["gszRemoteAdd"])) > 0 )</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> {</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> // check if IP matches current client</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> if ( trim( $_SESSION["gszRemoteAdd"] ) !=</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> trim( $_SERVER["REMOTE_ADDR"] ) )</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> {</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> // possible security breach void session</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> /* if the session address is the loopback interface then it is</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> * likely that the application was configured to use an external</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> * address but someone is trying to test locally using localhost</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> */</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> if ($_SESSION['gszRemoteAdd'] != '127.0.0.1')</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> {</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> $bSessionOK = false;</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> }</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> }</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> }</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> else</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> {</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> // possible security breach void session</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> $bSessionOK = false;</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> }</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> </span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> // return success or failure and set global so we</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> // know session has been inited.</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> if ($bSessionOK)</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> {</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> $GLOBALS['session_started'] = true;</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> }</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> </span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> </span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> return $bSessionOK;</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">// end intializeSession() function</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">}</span><br style="font-family: arial,helvetica,sans-serif;"><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;">function getSessionSavePath()</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">{</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> $szReturn = ini_get("session.save_path")."/sess_".session_id()."/";</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"> $szReturn = str_replace( "\\", "/", $szReturn );</span><br style="font-family: arial,helvetica,sans-serif;"><span style="font-family: arial,helvetica,sans-serif;"> return $szReturn;</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;">}</span><br><br></div><div style="font-family: garamond,new york,times,serif; font-size: 12pt;">Really need advice again Mr. <br>Thanks<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div class="hm"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Cristiano Sumariva <<a rel="nofollow" ymailto="mailto:sumariva@gmail.com" target="_blank" href="mailto:sumariva@gmail.com">sumariva@gmail.com</a>><br><b><span style="font-weight: bold;">To:</span></b> elisabeth theresia <<a rel="nofollow" ymailto="mailto:dbee_kawai@yahoo.com" target="_blank" href="mailto:dbee_kawai@yahoo.com">dbee_kawai@yahoo.com</a>><br>
<b><span style="font-weight: bold;">Sent:</span></b> Sat, August 14, 2010 8:57:29
AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [mapserver-users] how to disappear Warning: session_start() in the page?<br></font></div><div><div></div><div class="h5"><br>
You should break your file in 2 files.<br>Put the session_start function at first and add it to the top of your .phtml file.<br><br>The second file will contain all remaining code.<br><br>When using session in pages they have to be sent before any other thing.<br>
This is a requirement in HTTP protocol.<br><br><div class="gmail_quote">2010/8/13 elisabeth theresia <span dir="ltr"><<a rel="nofollow" ymailto="mailto:dbee_kawai@yahoo.com" target="_blank" href="mailto:dbee_kawai@yahoo.com">dbee_kawai@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div style="font-family: garamond,new york,times,serif; font-size: 12pt;"><div style="font-family: garamond,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div style="font-family: garamond,new york,times,serif; font-size: 12pt;"><div style="font-family: garamond,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<font size="3">Hi all, i got message </font><font size="3">(for preview- i attached the page in attachment-sessionerror2.jpg) </font>: <br><div style="font-family: arial,helvetica,sans-serif; font-size: 14pt;"><div><font size="2"><b>Warning</b>: session_start() [<a rel="nofollow" target="_blank" href="http://localhost/appweb/function.session-start">function.session-start</a>]:
Cannot send session cache limiter - headers already sent (output
started at I:\ms4w\apps\appweb\htdocs\index_spatialphtml.phtml:6) in <b>I:\ms4w\apps\appweb\htdocs\common\session\session.php</b><b>509</b></font> on line <br><br><span style="font-family: garamond,new york,times,serif;">i have mapfile and template that already could show in the initialize page named </span><span style="font-style: italic; font-family: garamond,new york,times,serif;">index_cobacham.phtml<br>
<br></span><span style="font-family: garamond,new york,times,serif;">Then my html + php = index_spatialphtml.phtml</span><span style="font-style: italic; font-family: garamond,new york,times,serif;"><span style="font-style: italic;"><br>
</span></span><span style="font-family: garamond,new york,times,serif;">i put <?php include ("index_cobacham.phtml")?> above the syntax html.</span><span style="font-style: italic; font-family: garamond,new york,times,serif;"><span style="font-style: italic;"> <br>
<br></span></span><span style="font-family: garamond,new york,times,serif;">So, what should i do?<br><br>Thanks :)<br></span><span style="font-style: italic; font-family: garamond,new york,times,serif;"><span style="font-style: italic;"><br>
<br></span></span><span style="font-family: garamond,new york,times,serif;">here the index_spatialphtml.phtml</span><span style="font-style: italic; font-family: garamond,new york,times,serif;"><span style="font-style: italic;"><br>
<br></span></span><span style="font-family: garamond,new york,times,serif;"><span><span><span><span><span><a target="_blank" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>"></span></span></span></span></span><br>
<span></span><br><head><br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br><title>index</title><br><style type="text/css"><br><!--<br>
body {<br> font: 100% Verdana, Arial, Helvetica,
sans-serif;<br>
background: #666666;<br> margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */<br> padding: 0;<br> text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */<br>
color: #000000;<br> background-image: url(./images/Background.gif);<br>}<br>.oneColElsCtr #container {<br> width: 46em;<br> background: #FFFFFF;<br> margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */<br>
border: 1px solid #000000;<br> text-align: left; /* this overrides the text-align: center on the body element. */<br>}<br>.oneColElsCtr #mainContent {<br> padding: 0 20px; /* remember that padding is the
space inside the div box and margin is the space outside the div box */<br>}<br>.style1 {color: #FFFFFF}<br>a:link {<br> color: #96711D;<br> text-decoration: none;<br>}<br>a:visited {<br> color: #A99559;<br> text-decoration: none;<br>
}<br>a:hover {<br> color: #990000;<br> text-decoration: underline;<br>}<br>a:active {<br> color: #000000;<br> text-decoration: none;<br>}<br>.style2 {color: #000000}<br>--><br></style></head><br>
<br><body class="oneColElsCtr"><br><br><div id="container"><br> <div id="mainContent"><br> <table width="713" border="1"><br> <tr background="./images/Background.gif"><br>
<th width="709" scope="col" align="center"><p class="style1">PETA
SPASIAL PENYEBARAN PENYAKIT DBD</p><br> <p class="style1"> KOTA SURAKARTA</p></th><br> </tr><br> </table><br> <table width="717" border="1" cellpadding="0" cellspacing="0"><br>
<tr><br> <th width="138" scope="col"><div align="center"><a href="index.html">Beranda</a></div></th><br> <th width="171" scope="col"><div align="center"><a href="peta.html">Peta Surakarta</a></div></th><br>
<th width="127" scope="col"><div align="center"><a href="berita.html">Berita</a></div></th><br> <th width="147"
scope="col"><div align="center"><a href="tentang.html">Buku Tamu</a></div></th><br> <th width="122" scope="col"><div align="center"><a href="tentang.html" target="_blank" class="style2">Tentang</a></div></th><br>
</tr><br> </table><br><br><span style="font-weight: bold;"><?php </span><br style="font-weight: bold;"><span style="font-weight: bold;"> include ("./index_cobacham.phtml"); ?></span><br style="font-weight: bold;">
<br><br></body><br></html><br></span><span style="font-style: italic; font-family: garamond,new york,times,serif;"><span style="font-style: italic;"><br></span></span></div>
</div><br>
</div></div>
</div><br>
</div></div>
</div><br>
</div><br>_______________________________________________<br>
mapserver-users mailing list<br>
<a rel="nofollow" ymailto="mailto:mapserver-users@lists.osgeo.org" target="_blank" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><span><span>
<a target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a></span></span><br>
<br></blockquote></div><br>
</div></div></div></div>
</div><br>
</div><br>_______________________________________________<br>
mapserver-users mailing list<br>
<a rel="nofollow" ymailto="mailto:mapserver-users@lists.osgeo.org" target="_blank" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br></blockquote></div><br>
</div></div>
</div><br>
</body></html>