Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKirran Iveson
2,191 PointsError message I can't seem to fix
I keep getting: Fatal error: Function name must be a string in C:\xampp\htdocs\contact.php on line 34
Line 34 is this:
<?php if (isset($_GET["status"]) AND $_GET("status") == "thanks") { ?>
Any thoughts?
2 Answers
Robert Richey
Courses Plus Student 16,352 PointsHi Kirran,
AND $_GET("status")
is treating $_GET like a function because of the parentheses.
<?php if (isset($_GET["status"]) AND $_GET["status"] == "thanks") { ?>
Edit: the second call to _GET was using parentheses instead of square brackets. Line corrected above.
shezazr
8,275 PointsAND is not valid syntax.. use &&
Kirran Iveson
2,191 PointsI tried switching it and nothing changes. If it is invalid they probably shouldn't put it in the video, although I've seen a few others just say that they are interchangeable (perhaps with subtle differences that new coders don't know about yet!).
Robert Richey
Courses Plus Student 16,352 PointsAND is valid, it's just a lower precedence operator than &&.
Robert Richey
Courses Plus Student 16,352 PointsRobert Richey
Courses Plus Student 16,352 PointsFixed markdown for the posted code. If you're curious about how to add markdown like this on your own, checkout this thread on posting code to the forum . Also, there is a link at the bottom called Markdown Cheatsheet that gives a brief overview of how to add markdown to your posts.
While you had the 3 backticks for a code block, there needs to be a blank line preceding these backticks.