<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><b><span style="font-weight: bold;">From:</span></b> elisabeth theresia <dbee_kawai@yahoo.com><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font size="2" face="Tahoma"><b><span style="font-weight: bold;">To:</span></b> mapserv forumlist <mapserver-users@lists.osgeo.org><br><b><span style="font-weight: bold;">Sent:</span></b> Thu, August 19, 2010 9:04:43 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>
<div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div>Thanks Mr. Carlos,<br><br>But, the session_start() already embedded by Chameleon Framework and also no HTML or PHP code before that.<br><br>so how to fix it?<br><br>Thanks<br><br>-Elisabeth cheers from Indonesia :D too<br></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> Carlos Ruiz <boolean10001@yahoo.com><br><b><span style="font-weight: bold;">To:</span></b> elisabeth theresia <dbee_kawai@yahoo.com>; mapserver-users@lists.osgeo.org<br><b><span style="font-weight: bold;">Sent:</span></b> Thu, August 19, 2010 3:51:43 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>
<div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">Elisabeth,<br><br>It's quite as simple as the session handling. You can split your code into many files or keep it in one single file, <br>the only thing you have to know is that PHP's session_start() function call must be the first thing wrote, no <br>HTML or PHP code before that.<br><br>Cheers from México<br><br><span style="font-weight: bold; color: rgb(0, 96, 191);">IC Carlos Ruiz</span><br style="font-weight: bold; color: rgb(0, 96, 191);"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br style="font-weight: bold; color: rgb(0, 96, 191);"><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> elisabeth theresia <dbee_kawai@yahoo.com><br><b><span style="font-weight: bold;">To:</span></b> mapserver-users@lists.osgeo.org<br><b><span
style="font-weight: bold;">Sent:</span></b> Wed, August 18, 2010 2:48:58 PM<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>
<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;"> <span style="font-weight:
bold;">......bla bla coding</span></span><b><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><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></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>}bla..bla coding</span><br>
</div></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></div></div></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>
</div></div>
</div><br>
</div></div>
</div><br>
</div></div>
</div><br>
</body></html>