trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
I've not used this myself, just remember reading about it: http://go.aopphp.com Looks interesting yet scary.
-
Actually, there is a library that might be able to help you, just can't think of the name of it off the top of my head. Give me a second.
-
Yeah, if you can't change that function, that isn't going to happen.
-
return will work as expected. <?php function a() { include 'file.php'; echo 'work'; } file.php <?php echo 'play'; return; echo 'this will not be reached';
-
closing php tag in function to write html good practice?
trq replied to johnmerlino1's topic in PHP Coding Help
I wouldn't. I much prefer to go the template route. A *very* simple example: <?php function renderTemplate($template, array $data = []) { extract($data); include $template; } template.html.php <table width="100%" cellpadding="12" cellspacing="0" border="0"> <tr bgcolor ="black"> <td align ="left"><img src = "logo.gif" /></td> <td> <h1><?= $heading; ?></h1> </td> <td align ="right"><img src = "logo.gif" /></td> </tr> </table> <?php renderTemplate('template.html.php', ['heading' => 'TLA Consulting Pty Ltd']); -
No interface do not include implementation.
-
I don't think so. Unsetting a variable is like it was never initialized at all.
-
By your definition it does not support function overloading.
-
That is indeed what your looking for. It's not cheap, no. If you can find a freelance devops guy you could go down that route (hint hint). We have a freelance board, but I'm not sure where else you might search or how much activity you might get.
-
This is one of php's little quirks, there is no way to fix it now without breaking BC. Live with it.
-
Who cares?
-
You "try before it goes live" by installing a local http server to use when developing. You won't get any php working without one.
-
Data in responseText and responseJson is jumbled
trq replied to bobdillan_31's topic in PHP Coding Help
Do you have some relevant code? -
No, the code you're have in your form is fine. Judging from your error, you don't have a server setup. PHP requires a http server configured to execute PHP. You then need to access your site via urls, not file paths. eg; http://localhost/index.html, not file:///C:/ etc
-
No you don't need to "link" them, the form just needs to submit to your php script (by setting it as the action).
-
Your closing theEnd needs to be at the start of the line.
-
If this script is being executed by requested it via a web server then the script executes as that web server. eg; On a typical Debian machine, Apache Http for instance will be running as the www-data user.
-
What the hell are these classes? I mean, why does an Action extend a View in the first place? The two seem unrelated.
-
It's pretty hard to write SOLID code without interfaces.
-
People still use things like Wampserver? I thought we'd all moved to reproducible development environments via Vagrant?
-
That assumes Google_Service_Calendar_Acl_Resource is a function which it is not.
-
It shouldn't. spl_autoload_register adds autoloaders onto a stack of autoloaders. So, unless Joomla is doing something funky with its autoloading, your implementation looks fine. Another option to consider would be to simply use Composer. All you need to do then is include composer's autoloader into your project somewhere.
-
Website Server was upgraded to PHP 5.4.30 and now doesn't work
trq replied to Learning's topic in Third Party Scripts
That code is in some serious need of being thrown out. The session_is_registered function is deprecated. The mysql_* extension is deprecated Short tags have long been disabled by default. And in general it's just poor code. Moving forward, you might want the code maintained.- 1 reply
-
- 1
-
Don't put it within your http server's document root. There is no reason it needs to be executed via http.
-
have a script from someone that injects charecters to DB
trq replied to nubbyless's topic in PHP Coding Help
We are not here to fix code for people. If you have a specific question, ask it.