trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
Your code makes zero sense.
-
How do I plug a tone generated by a function into a var?
trq replied to Q695's topic in Javascript Help
We have absolutely no idea what that code does! We are not there in front of the code with you! You are going to need to provide relative information.- 11 replies
-
- tone
- javascript
-
(and 1 more)
Tagged with:
-
So, how does it make sense to use ajax to redirect a user to another page?
-
If {*} in the following line needs to be replaced dynamically, then that is the part your router would need to return. App\Core\Frontend\{*}Controller So, assuming you are trying to load the file App/Core/Frontend/Base/IndexController.php And your code looks like: $class = 'App\\Core\\Frontend\\Base\\' . $controller . 'Controller.php'; $controller = new $class; Your router would need to return 'Foo\Index'. Really though, why are you reinventing all this stuff? Its been done before.
- 6 replies
-
- mvc
- autoloading
-
(and 2 more)
Tagged with:
-
Your router is going to need to return more useful information about where you controller lives than just the short class name.
- 6 replies
-
- mvc
- autoloading
-
(and 2 more)
Tagged with:
-
Redirecting a page with Ajax? That makes no sense at all. Do you know what Ajax is?
-
Why do so Many Beginners Use a lot of Bad Practices?
trq replied to mogosselin's topic in Miscellaneous
Because of PHP's long history, unfortunately the internet is riddled with bad examples of PHP code. If not told otherwise, beginners learn by studying these existing (bad) examples. I always recommend newcomers read this first nowadays: http://www.phptherightway.com -
How do I plug a tone generated by a function into a var?
trq replied to Q695's topic in Javascript Help
Please.. you need to be more vague, I'm finding it far too easy to read your posts.- 11 replies
-
- tone
- javascript
-
(and 1 more)
Tagged with:
-
You need to find yourself some tutorials on a 'Join in SQL'. Executing queries within loops is terribly inefficient.
-
Your classes need to be namespaced properly, meaning you would instantiate your router using: $router = new App\Core\Router();
- 6 replies
-
- mvc
- autoloading
-
(and 2 more)
Tagged with:
-
What error are you getting?
-
How do I plug a tone generated by a function into a var?
trq replied to Q695's topic in Javascript Help
You want to store the result of calling startTone() in a variable? var foo = startTone(tone); The question however is, what does this function actually return? Obviously, there is no way for us to know the answer to that.- 11 replies
-
- tone
- javascript
-
(and 1 more)
Tagged with:
-
You are redefining $row within your while loop. Seriously, you need to look into how to query using joins, the way your going about things currently is wrong.
-
Error mysql_num_rows() expects parameter 1 to be resource
trq replied to merpati's topic in PHP Coding Help
Your query is failing for some reason and $run is the bool false, not what mysql_num_rows expects. Always check your queries succeed before using the value they return. -
That is not a question.
-
I do not understand the question / problem.
-
Change: if ($_SESSION['logged_in'] == true) { To: if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == true) {
-
Nope, it is not.
-
$_GET['menu_id'] will not exist until your form is submitted. So.. wrap all the php code at the top of your script in a condition that checks to see if the form has been submitted.
-
You tell us.
- 3 replies
-
- flipper
- javascript
-
(and 2 more)
Tagged with:
-
You have double quotes within a double quoted string, breaking that string. You are missing quotes around the strings 'body' and 'html'. You have quotes and braces places you don't need them. You need to escape the inner quotes: <?php include "./includes/egl_inc.php"; $secure = new secure(); $secure->secureGlobals(); page_protect(); $out['body'] = "<strong><a href=\"#1\">text here</a></strong><br>"; include $config['html'];
-
Just for that, your on my ignore list. Fend for yourself.
-
It's pretty self explanatory, $rows isn't defined anywhere in your code.
-
That has what to do with MySQL?
-
The idea of constants being defined via form submission sounds all together dodgy. They are "constant" for a reason. They are meant to be reliable. Why are you using constants for this data?