JellyFishBoy Posted January 17, 2011 Author Share Posted January 17, 2011 Ah yes that was for an old if argument, forgot to edit that out Thanks..... ......and it WORKS! Seems like Dreamweaver is not a PHP friendly program. Thanks for the help guys. Much appreciated Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160816 Share on other sites More sharing options...
JellyFishBoy Posted January 17, 2011 Author Share Posted January 17, 2011 That being said what PHP editor would you recommend? Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160820 Share on other sites More sharing options...
Pikachu2000 Posted January 17, 2011 Share Posted January 17, 2011 I use Zend Studio on Mac, but only because it's what I'm used to. A lot of people seem to like NetBeans and Notepad++. Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160826 Share on other sites More sharing options...
beegro Posted January 17, 2011 Share Posted January 17, 2011 I'm surprised that Dreamweaver gave you problems. I used it for years without issue. Guess I'll have to look more closely at the link Pikachu2000 sent regarding UTF encoding. That being said, I have moved on to NetBeans as my editor of choice because of its ability to expose and navigate through OO code as well as snap into source control tools like CVS, SVN and Git. Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160831 Share on other sites More sharing options...
JellyFishBoy Posted January 17, 2011 Author Share Posted January 17, 2011 Although..... my logout.php is flagging up the same error again. Saved with notepad++ and dont see any outputs before it.... <?php if(isset($_COOKIE['firstname'])) //if no cookie present redirect the user (able to use this if else function for all pages which need login verification) { setcookie('firstname', '', time()-300, '/', '', 0); setcookie('lastname', '', time()-300, '/', '', 0); } else { //if the user isnt logged in (no cookies found) the client be redirected to the home page echo "<b>You are already logged out.</b><br>"; echo "<p>If you are not redirected in 15 seconds click <A HREF='./index.php'>here</A>."; print "<meta HTTP-EQUIV='REFRESH' content='5 url=./index.php'></p>"; } echo "<p>You are now logged out <b>{$_COOKIE['firstname']}</b>.</p>"; echo "<p>If you are not redirected in 15 seconds click <A HREF='./index.php'>here</A>."; print "<meta HTTP-EQUIV='REFRESH' content='5 url=./index.php'></p>"; ?> <html lang="en"> <head> <title>JFB Systems - Online Store - Home</title> <style type="text/css"> <!-- body {margin: 0px; padding: 0px;} a:link {color: #000000;} a:visited {color: #000000;} a:hover {color: #ffffff;} a:active {color: #000000;} a:link {text-decoration:none;} .Body-P { margin:0.0px 0.0px 0.0px 0.0px; text-align:left; font-weight:400; } .Body-Text-P { margin:0.0px 0.0px 0.0px 0.0px; text-align:center; font-weight:400; } .Body-C { font-family:"Arial", sans-serif; font-size:21.0px; line-height:1.19em; } .Body-C0 { font-family:"Times New Roman", serif; font-size:21.0px; line-height:1.14em; } .Body-Text-C { font-family:"Arial", sans-serif; font-size:11.0px; line-height:1.27em; } .Body-Navlist { font-family:"Arial", sans-serif; font-size:13.0px; color:black; line-height:1.19em; } #navlist li { display: inline; list-style-type: none; padding-right: 20px; } --> </style> <script type="text/javascript" src="wpscripts/jspngfix.js"></script> <script type="text/javascript"><!-- var blankSrc = "wpscripts/blank.gif"; --></script> <div id="menu" style="position:absolute; left:728px; top:44px; width:530px; height:51px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box; overflow:hidden; z-index:1;"><span class="Body-Navlist"> <ul id="navlist"> <li id="active"> <a href="./index.php">Home</a></li> <?php if (isset($_COOKIE['firstname']) AND (substr($_SERVER['PHP_SELF'], -10) != './logout.php')) { echo '<li><a href="./logout.php">Logout</a></li> <li><a href="./cpass.php">Change Password</a></li> '; } else { echo '<li><a href="./register.php">Register</a></li> <li><a href="./login.php">Login</a></li> <li><a href="./f_pass.php">Forgot Password</a></li> '; } ?> <li><a href="./buy.php">Buy</a></li> <li><a href="./sell.php">Sell</a></li> <li><a href='./help.php'>Help</a></li> </ul> </span> </div> </head> <body text="#000000" style="background-color:#ffffff; text-align:center; height:800px;"> <div style="background-color:transparent;text-align:left;margin-left:auto;margin-right:auto;position:relative;width:900px;height:800px;"> <div style="position:absolute; left:31px; top:83px; width:841px; height:694px;"> <img src="wpimages/wp6f2c4b55.png" width="841" height="694" border="0" id="qs_16" name="qs_16" title="" alt="" onload="OnLoadPngFix()"></div> <div style="position:absolute; left:32px; top:79px; width:840px; height:4px;"> <img src="wpimages/wp011a815e.png" width="840" height="4" border="0" id="qs_15" name="qs_15" title="" alt="" onload="OnLoadPngFix()"></div> <div style="position:absolute; left:51px; top:76px; width:359px; height:704px;"> <img src="wpimages/wp8ad5650a.png" width="359" height="704" border="0" id="qs_10" name="qs_10" title="" alt="" onload="OnLoadPngFix()"></div> <div id="txt_99" style="position:absolute; left:88px; top:109px; width:284px; height:238px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box; overflow:hidden;"> <p class="Body-P"><span class="Body-C">Logged Out</span></p> <p class="Body-P"><span class="Body-C0"> </span></p> <p class="Body-P"><span class="Body-C0"> </span></p> </div> <div id="txt_16" style="position:absolute; left:122px; top:777px; width:656px; height:23px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box; overflow:hidden;"> <p class="Body-Text-P"><span class="Body-Text-C">Copyright © All rights reserved. JFB Systems.</span></p> </div> <div style="position:absolute; left:35px; top:1px; width:831px; height:95px;"> <img src="wpimages/wp618f8c40.png" width="831" height="95" border="0" id="txt_98" name="txt_98" title="" alt="Online store " onload="OnLoadPngFix()"></div> </div> </body> </html> Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160852 Share on other sites More sharing options...
Pikachu2000 Posted January 17, 2011 Share Posted January 17, 2011 Go ahead and paste the error message in here. Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160854 Share on other sites More sharing options...
JellyFishBoy Posted January 17, 2011 Author Share Posted January 17, 2011 Same as before... Warning: Cannot modify header information - headers already sent by (output started at /home/e-smith/files/ibays/Primary/html/secure/logout.php:1) in /home/e-smith/files/ibays/Primary/html/secure/logout.php on line 3 Warning: Cannot modify header information - headers already sent by (output started at /home/e-smith/files/ibays/Primary/html/secure/logout.php:1) in /home/e-smith/files/ibays/Primary/html/secure/logout.php on line 4 Line 3: { Line 4: setcookie('firstname', '', time()-300, '/', '', 0); Line 5: setcookie('lastname', '', time()-300, '/', '', 0); Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160856 Share on other sites More sharing options...
Pikachu2000 Posted January 17, 2011 Share Posted January 17, 2011 There almost has to be another BOM or non-displaying character, or bare linefeed before the <?php tag. Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160859 Share on other sites More sharing options...
JellyFishBoy Posted January 17, 2011 Author Share Posted January 17, 2011 Aha solved. Went into notepad++ settings and changed the 'Encoding' to ANSI. There is also an option for 'UTF-8 without BOM'. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160864 Share on other sites More sharing options...
Pikachu2000 Posted January 17, 2011 Share Posted January 17, 2011 You'll want to use UTF-8 without BOM . . . Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160866 Share on other sites More sharing options...
JellyFishBoy Posted January 17, 2011 Author Share Posted January 17, 2011 Ok. Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1160870 Share on other sites More sharing options...
pedromsouza Posted February 8, 2011 Share Posted February 8, 2011 Anyone got this hidden character issue on TEXTWRANGLER? MAC OSX App Quote Link to comment https://forums.phpfreaks.com/topic/224714-cookie-problem/page/2/#findComment-1171399 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.