Jump to content

Question: CMS tutorial error


TheHacker

Recommended Posts

Hello,

I've got a question again about the CMS tutorial

I always get this error: Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION in / var/www/web407/html/tests/cms/models/m_template.php on line 11

 

And now the code:

 

 

class template
{
private $ data;



/ / Construtor

function_construct () {}



/ / Function


function load ($ url)
{
include ($ url);
}


/ / Get / Set Data



function setData ($ name, $ value)
{
$ this-> date [$ name] = htmlentities ($ value, ENT_QUOTES);
}

function getData ($ name)
{
if (1sset ($ this-> date [$ name]))
{
return $ this-> data [$ name];
}
else
{
return'';
}
}
}

Link to comment
Share on other sites

I believe adding a space between the function name and the opening and closing parenthesis will cause that. For example, this:

 

function_construct () {}

 

should be

 

function_construct() {}

 

otherwise PHP doesn't realize that it is a function. Why all of the extra spaces in front of variable names too? I don't have the time to double check that at the moment, but I would think that separating the variable name from the "$" will cause issues. My videos definitely don't include those extra spaces.

Link to comment
Share on other sites

Yes:D

 

hmm.. its didnt get all cms tutorial videos for free at youtube?

Unfortunately no, they aren't all available on YouTube. A couple of the videos are available as a preview, and you can either purchase the stand-alone course here ($40): http://killervideostore.com/video-courses/build-a-cms.php or it is part of the KillerSites Video Tutorial Library's premium package (subscription based - $100 per year): http://killersites.com/university/

Link to comment
Share on other sites

Sorry about that. There's probably 80+ hours of time that went into that course (there are nearly 50 videos in all) so asking viewers to pay something towards that time seems fair. I hope what you watched was useful, and perhaps you will be able to continue the course at some point in the future.

No Problem :D its yourtime :D an its fair but i dont have it nice day :D

 

and i buy it realy fast :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...