Help - Search - Members - Calendar
Full Version: PHP
xFX JumpStart Public Forums > Web Site > Boiling Room
stpin
Dear everyone:

I have been developing webpages for a couple years now, but really have not gotten much into dynamic website through such devices as PHP and ASP, so I decided to expand my abilities and learn PHP. Here is what I am having trouble with:

Lets say I have a form on my website and I have a text filed call "name" and my forms action is to post to lets say form.php.

In my form.php file, I have code as follows:
        echo $name. " this is your name";
?>
well for some reason my name is not showing up on form.php on MY SERVER. I am running windows 2000 with IIS 5.0 and PHP version 4.2.1

I know my code works for 2 reasons:
  1.) I got it out of a book that I am using to teach myself php
  2.) Because when I upload my files to one of my clients servers, the code works fine.

So I am thinking something must be wrong with my configuration, but I can not figure out what for the life of me. I know some parts of the PHP on MY SERVER are working right, because it can handle code that I put in a page that is not linked to another page no problem.

For Instance:
   echo "hello";
?>

I have searched the internet and can't seem to come up with a solution to my problem. And I figured this would be one of the best places to ask for help. All web designers, and all with probably a lot more experience with this type of thing than me!

I would appriciate any help that anyone can offer me! biggrin.gif

Thanks so much for your time,
stpin
xfx
The way variables are created from form elements will actually depend on your server's PHP configuration.

For example, this server is setup so form elements are transfered to a PHP script as global variables, so this form element:

< input type=text name=myname >

when sent to a PHP file I can access the $myname variable globaly.

Check http://www.php.net/ for more information.

But... I know that you can configure PHP so this doesn't happen and the only way to access the $myname variable is through the $HTTP_POST_VARS array.
stpin
Thanks so much for your help. I edited my php.ini to turn my global variables on and now it is working. Could not have done it without your assistance.

Thanks,
stpin
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.