GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Whats wrong with my php code? (https://gfy.com/showthread.php?t=895259)

teh ghey 03-22-2009 03:51 PM

Whats wrong with my php code?
 
I get this error" Parse error: parse error, unexpected '=', expecting ')' in /home/content/g/h/o/ghostingadmin/html/arktos/plugins/system/comments.php on line 34

here is the code. anyone know?

class ContactController extends JController
{
/**
* Display the view
*/
function display()
{
$document =& JFactory::getDocument();

$viewName = JRequest::getVar('view', 'category', 'default',
'cmd');
$viewType = $document->getType();

// in

teh ghey 03-22-2009 03:54 PM

this is in joomla btw

teh ghey 03-22-2009 04:10 PM

line 34 is function display()

who 03-22-2009 04:12 PM

$document =& JFactory::getDocument();

->

$document = JFactory::getDocument();

teh ghey 03-22-2009 04:16 PM

Quote:

Originally Posted by who (Post 15660346)
$document =& JFactory::getDocument();

->

$document = JFactory::getDocument();

thank you!
So I take something out and put that in?

teh ghey 03-22-2009 04:22 PM

that code didnt work. but thanks though ;/

Libertine 03-22-2009 05:06 PM

Quote:

Originally Posted by who (Post 15660346)
$document =& JFactory::getDocument();

->

$document = JFactory::getDocument();

No. =& is explicit reference assignment, it isn't a typo.

teh ghey, I won't bore you with the technical details, but you are probably using PHP 4. Time to upgrade.

As an aside: when asking for help, give the whole bloody file. Seriously.

teh ghey 03-22-2009 05:12 PM

Quote:

Originally Posted by Libertine (Post 15660508)
No. =& is explicit reference assignment, it isn't a typo.

teh ghey, I won't bore you with the technical details, but you are probably using PHP 4. Time to upgrade.

As an aside: when asking for help, give the whole bloody file. Seriously.

last time I asked for help they said to just post the code block lol.
thanks

Libertine 03-22-2009 05:45 PM

Quote:

Originally Posted by teh ghey (Post 15660529)
last time I asked for help they said to just post the code block lol.
thanks

But I'm fairly sure they meant the right code block. Which this isn't.

Your problem is this:
function onGetComments($mode, &$item, &$params=null)

Which is valid in PHP 5 but not in 4, since in 5 default values can be passed by reference, which they can't in 4.

teh ghey 03-22-2009 05:52 PM

Quote:

Originally Posted by Libertine (Post 15660624)
But I'm fairly sure they meant the right code block. Which this isn't.

Your problem is this:
function onGetComments($mode, &$item, &$params=null)

Which is valid in PHP 5 but not in 4, since in 5 default values can be passed by reference, which they can't in 4.

wow you sound good. thanks


All times are GMT -7. The time now is 05:58 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123