global variables not working

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
AdRock
Posts: 19
Joined: Sun Aug 20, 2006 11:50 pm

global variables not working

Post 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
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
AdRock
Posts: 19
Joined: Sun Aug 20, 2006 11:50 pm

Post 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?
Post Reply