Conflicting... beyond me

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 4, 2010   (RSS)

By Toledoh - May 28, 2010

Hi Guys,

Wondering if anyone can help. I've got a php form to email thing attched, and the php is conflicing with the php that I need with the page viewers.

refer: http://www.fractionfacts.com.au/viridianNoosa.php and that file is attached.
Cheers,

Tim (toledoh.com.au)
Attachments:

viridiannoosa.php 7K

Re: [Toledoh] Conflicting... beyond me

By Jason - May 31, 2010

Hi Tim,

There are a couple of things here. The first thing that's happening is that your starting a session at the very top of your page. But further down the page you're including the "viewer_functions.php" file, which calls another file, which starts a session. This is what's causing the conflict.
What I would suggest doing is move your line that adds "viewer_functions.php" up to the very top of the file. You can then remove the code that starts a session since one will already have been created.

The other errors your seeing are due to undefined variables. These variables (like $css and $_SESSION['post']['name']) are only being set under certain conditions. Therefore, with every execution of the page, you cannot guarantee that these variables have been defined. We can get around this by add an "@" symbol in front of your variables like this:

<?=@$css?>

or

<td width="70%"><input type="text" class="validate[required]" name="name" id="name" value="<?=@$_SESSION['post']['name']?>" /></td>

This will suppress the errors in case those variable haven't been created.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/