Jump to content

New to php... Installation problems???


MajorMo

Recommended Posts

Hi,

 

I am fairly new to php and am following an ebook and trying to teach myself php. I am up to the array chapter and the book gives me this code for a part of a dice program (below):

 

 

<html>

<head>

<title>

persistence demo

</title>

</head>

 

<body>

 

<h1>Persistence Demo</h1>

<form>

<?

//increment the counters

$txtBoxCounter++;

$hdnCounter++;

 

print <<<HERE

 

<input type = "text"

      name = "txtBoxCounter"

      value = "$txtBoxCounter">

 

<input type = "hidden"

      name = "hdnCounter"

      value = "$hdnCounter">

<h3>The hidden value is $hdnCounter</h3>

<input type = "submit"

      value = "click to increment counters">

HERE;

 

?>

 

</form>

</body>

</html>

 

 

 

The example in the book has the program incrementing by one every time the submit button is pushed but on my computer nothing happens when I hit submit even when I have copy/pasted the code straight out of the e-book.

 

I think it may be a problem with my installation but I don't know where to start (i am running the latest version of apache-windows with mysql and php5), any help would be greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/115247-new-to-php-installation-problems/
Share on other sites

maybe the author has his php set up differently.

 

It could be set up to automatically set GET values to variables, just like ActionScript does.

 

AKA Register_globals On. This is not recommended, as has been off by default for some time. Come PHP 6 the option will no longer even exist.

Archived

This topic is now archived and is closed to further replies.

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