respecttheplayer Posted December 3, 2008 Share Posted December 3, 2008 Nothing like getting back to the basics.....this is so wierd all of a sudden some of my scripts STOPPED (EDITIED) working when I used this: <?php $statecity = "state=ID&city=Boise&station=KBCI"; $station = "KBCI"; ?> <!-- Begin Omniture Code --> <script language="JavaScript" src="http://www.thegreatestsave.org/omniture/s_code.js"></script> <script language="JavaScript"><!-- s.pageName="<?php echo $station; ?> TGS Page" s.channel="TGS Campaign Page" s.pageType="" s.prop2="<?php echo $station; ?>" var s_code=s.t();if(s_code)document.write(s_code)//--></script> Basically it is just echo/printing out the STATION into the JS code, I have then tested in the body of my HTML/PHP page just a simple <body><?php echo $station; ?> </body> and i get nothing! Ok so thats fine and all but the rest of the variables are echoing just fine. So i rename station to "place" <?php echo $place; ?> and it works..... Now I am confused...so i check the list of reserved words and it says I am good. I guess I am very confused.... I did not even upload anything new and this just started happening...any ideas? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/ Share on other sites More sharing options...
keiran420 Posted December 3, 2008 Share Posted December 3, 2008 Very odd... may i ask if.. "So i rename station to "place" <?php echo $place; ?> and it works..... " works... why not just use that? Or are you just worried, and want a reason to the why.... try adding in some error reports, thats what i would do... Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-704979 Share on other sites More sharing options...
PFMaBiSmAd Posted December 3, 2008 Share Posted December 3, 2008 Use a phpinfo(); statement and tell us what the register_globals setting is? Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-704981 Share on other sites More sharing options...
respecttheplayer Posted December 3, 2008 Author Share Posted December 3, 2008 Thanks for the quick replies! register_globals Off Off when using the phpinfo() I do want to know so in the future i do not make the same mistake but also I have some includes tied into the STATION variable and do not want it to hit a more critical variable next because of something i either did or did not do. Also if you think i need to do an error report is there an easy way to put it in my php code on this page to find out what it is. Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-704984 Share on other sites More sharing options...
premiso Posted December 3, 2008 Share Posted December 3, 2008 For the error report, put this at the top: error_reporting(E_ALL); ini_set('display_errors', 1); It will tell of any errors. As for why it is not writing it, I would make sure that $station is not over-written anywhere else before it is suppose to be printed... Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-704996 Share on other sites More sharing options...
respecttheplayer Posted December 3, 2008 Author Share Posted December 3, 2008 Well...I think I did over write it in an include file. When i did the error report it was saying that the 4 GET Variable files from the include file were erroring out, so I erased the "like" one "STATION" and it now outputs correctly. I did this in the include page just as an extra precaution a long time ago. Why in earth would this stop working two days ago, surely there has to be a more technical reason. I am running php 4.4.6 on a dedicated server in which i control all updates and i have not updated purposefully for this reason. If no one knows that is fine, i just thank you for helping me hone down my problem, just need to figure out the why it happened now and not then. Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705032 Share on other sites More sharing options...
premiso Posted December 3, 2008 Share Posted December 3, 2008 Well...I think I did over write it in an include file. When i did the error report it was saying that the 4 GET Variable files from the include file were erroring out, so I erased the "like" one "STATION" and it now outputs correctly. I did this in the include page just as an extra precaution a long time ago. Why in earth would this stop working two days ago, surely there has to be a more technical reason. I am running php 4.4.6 on a dedicated server in which i control all updates and i have not updated purposefully for this reason. If no one knows that is fine, i just thank you for helping me hone down my problem, just need to figure out the why it happened now and not then. Could be many reasons, the most likely one was you were viewing a cached version of the page instead of the new page. When I am testing, especially in IE, I always use ctrl+f5 to refresh to page to make sure I got the latest copy. In firefox, you generally do not have to do that, but I still do it because it is annoying refreshing a page, then changing code etc and then find out it was never getting changed. Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705038 Share on other sites More sharing options...
respecttheplayer Posted December 3, 2008 Author Share Posted December 3, 2008 Good thinking, i thought the same as well, as a web designer I naturally thought of this almost right away and emptied my cache in Safari with no avail (this usually only helps me with new uploads of FLASH files but was worth a go with a .php file). Should i be concerned that I am using PHP 4.4.6 and not PHP 5, will I have bigger issues on my hands in lets say 5 years? Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705058 Share on other sites More sharing options...
premiso Posted December 3, 2008 Share Posted December 3, 2008 Good thinking, i thought the same as well, as a web designer I naturally thought of this almost right away and emptied my cache in Safari with no avail (this usually only helps me with new uploads of FLASH files but was worth a go with a .php file). Should i be concerned that I am using PHP 4.4.6 and not PHP 5, will I have bigger issues on my hands in lets say 5 years? PHP 5 just allows alot more functionality. If you are starting to design a new site, I would recommend upgrading. But if you have many sites that run off the PHP 4, it may break them from working. So yea. The rough part with multiple sites is you have to code them all for php 5 before upgrading or you can break them all. As for me, I have been working on coding my sites for PHP 5, since I use OOP alot and PHP 5 is much better at that, and yea it is a pain. I just want PHP 5 for the more functionality and security it provides. Chances are in 5 years, PHP 4 will be like PHP 3, null and void and everyone will be using PHP 5.x while converting over to PHP6. The life cycle of PHP =) Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705065 Share on other sites More sharing options...
respecttheplayer Posted December 3, 2008 Author Share Posted December 3, 2008 hehe thanks for the advice and what you do it is very helpful. I will go ahead and close topic to avoid too much "gabbing". Thanks again for your time, very helpful! Quote Link to comment https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705071 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.