Wrox Programmer Forums
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 15th, 2004, 08:53 AM
WIx WIx is offline
Registered User
Join Date: Jul 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Variable Problems

Hey, I am having a real bad time with variables on one page of a site I am working on. What is happening is variables aren't being transfered through the code in differen't php tags

example: I define a variable in one tag <? php $whatever = '0'; ?>

and I go to use it somewhere else on the page, not in the same php tag as it is defined. And I get an undefined variable error. The weird thing is, I have another page with pretty mush the exact same script just with less stuff added and it work fine.

Old July 15th, 2004, 10:45 AM
Authorized User
Join Date: Jun 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts

Try removing the space so it reads <?php ?> not <? php ?>, as I think it probably isn't seeing the code as valid php code because of the space.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Variable Problems Gobbles Classic ASP Basics 2 September 5th, 2007 09:17 PM
C variable in WHERE clause problems turnbui MySQL 1 December 7th, 2006 12:55 PM
Session variable problems fogofogo PHP How-To 3 December 28th, 2005 09:42 AM
xslt variable problems lincsimp XSLT 2 August 17th, 2005 02:49 AM
Problems displaying images via a variable nancy Classic ASP Basics 2 June 2nd, 2004 02:17 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.