Jump to content


Photo

Why doesn't it work


  • Please log in to reply
5 replies to this topic

#1 mkklepper

mkklepper
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 29 October 2006 - 12:19 AM

I use two computers. My main studio PC is not hooked up to the internet. The other one is for the internet. I'm running the same software on both(Windows XP, WAMP, Dreamweaver). I copied the files from my studio PC to the internet PC and all of a sudden none of the variables work.

echo " My name is $var1. My favorite color is  $var2.";
It prints
My name is $var1. My favorite color is  $var2.

I've checked all the configuration files and the are the same. I know it's some mundane detail but I',m just not  seeing it. Any suggestions?

#2 pendelton

pendelton
  • Members
  • PipPip
  • Member
  • 20 posts
  • LocationUK

Posted 29 October 2006 - 12:38 AM

Can you add the following lines to you code:

print "var1 = ".$var1.", var2 = ".$var2."<BR>\n";

(make sure that the $var1 and $var2 are not in quotes).

What's the output on the 2 machines?

#3 mkklepper

mkklepper
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 29 October 2006 - 12:55 AM

No, It preint the quotes and dots.

#4 pendelton

pendelton
  • Members
  • PipPip
  • Member
  • 20 posts
  • LocationUK

Posted 29 October 2006 - 01:22 AM

Can you provide the code for the complete file or at least several lines before and after the echo " My name is $var1. My favorite color is  $var2.";?

#5 pendelton

pendelton
  • Members
  • PipPip
  • Member
  • 20 posts
  • LocationUK

Posted 29 October 2006 - 01:29 AM

I have just had an idea. I don't think that your second server is interpreting the file as PHP, it's just displaying the code as HTML. I assume that you aren't missing the <? ?> around your code and you are using a sensible file name extension like ".php"? If so, you need to check your server setup to ensure that it is including PHP correctly and that the PHP file extensions are defined in the config files correctly.

#6 mkklepper

mkklepper
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 29 October 2006 - 01:56 AM

NEVER MIND I GOT IT




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users