Jump to content

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-704984
Share on other sites

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...

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-704996
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705032
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705038
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705058
Share on other sites

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 =)

Link to comment
https://forums.phpfreaks.com/topic/135350-solved-echo-issue/#findComment-705065
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.