Page 1 of 1

global variables not working

Posted: Fri Jul 25, 2008 10:04 pm
by AdRock
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

I have downloaded the new version of guestbook becuase i am using XHTML strict in my website and the <img> and <br> didn't have the trailing backslash / in the 1.5 version

Since upgrading to the new version, i can't echo out any global variables. In the footer i want to use some php like connecting to the database and this worked fine in the 1.5 version but not this version

In the gbook.php i created a global variable called $test and i gave it a value. In the function that prints out the start of the html, i made the same variable global in there too (that's what i did when it worked with the old version) but when i echo out the variable in the footer.txt, i get nothing being echoed.

Is there a way to change the footer.txt to footer.php or is that not needed? or why isn't my test variable being echoed?

Without it being able to use global variables, i can't do database connections in my footer

Posted: Sat Jul 26, 2008 9:40 am
by Klemen
If it worked in 1.4x I don't see a reason for it not to work in 1.5. You can try deleting

Code: Select all

ini_set('display_errors', 0);
ini_set('log_errors', 1);
in settings file to see if your footer gives any errors.

Posted: Sat Jul 26, 2008 6:55 pm
by AdRock
I have now got it working. I was putting the global variables in the wrong function but it works now anyway.

Another minor issue is when i validate my code, i get a warning about an empty <p> tag on this bit (outputed code)

Code: Select all

</td>
</tr>
</table>
<p></p><!--
Changing the "Powered by" credit sentence without purchasing a licence is illegal!
Please visit http://www.phpjunkyard.com/copyright-removal.php for more information.
-->
How can i get rid of this empty paragraph?