Rigsby Posted May 6, 2017 Share Posted May 6, 2017 I am so frustrated. I am a php novice and have been stuck inside this lovely little world all day; it's like my first day of school Can someone please explain to me why some of the php scripts that I copy & paste from websites work, but then don't work if I change one single and lonesome word. For example, the below script worked fine... <?php #adding Menu Item to primaryNavbar use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $primaryNavbar->addChild('Menu Name') ->setUri('https://www.example.com/') ->setOrder(70); }); ...but when I changed 'Menu Name' to something else, I got a white page. This has happened so many times today with, I don't know, about a hundred or more scripts. Is it related to what version php my provider is running or something more technical? Thanks in advance for any advice and help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 6, 2017 Share Posted May 6, 2017 because hooks are very fragile and if you get the slightest thing wrong, you'll get a blank screen... and if you get them very wrong, you can get a blank screen in both client and admin areas! use the "Display errors" option I mentioned previously. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted May 6, 2017 Share Posted May 6, 2017 Good advice from Brian. That should tell you what's failing, usually. Guessing what the problem might be; if the syntax is exactly the same (name enclosed by single quotes) I'd consider the editor being used, followed by upload method may be behind this. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.