trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
Multiple Accounts with Individual Pages using PHP
trq replied to skolhustick's topic in PHP Coding Help
This thread I replied to in 2006 should help. http://forums.phpfreaks.com/topic/22932-now-that-i-know-what-to-ask-here-goes/?hl=%2Bprofile&do=findComment&comment=103630 -
I cover the basics here. What distro are you using?
-
I wouldn't bother with firePHP, get yourself a proper debugger like xdebug or phpdbg.
-
Then your connection is failing. You should always check that $con is what your expecting it to be before just going ahead and blindly using it.
-
I need to open a Bootstrap modal and pass a php var using jquery ajax
trq replied to rdkurth's topic in Javascript Help
Why would you need any Ajax for this? $(".launch-modal").click(function() { var id = $(this).attr('id'); }); -
elementId is the first argument passed into the setText function. Its a variable.
- 1 reply
-
- getelementbyid(elementid)
- javascript
-
(and 1 more)
Tagged with:
-
Take a look at this part "curdate()-1", and then have a guess.
-
Does "Application Design - Programming theory, database design, performance, etc." really sound like the right place for this question?
-
Why are you using a url with require_once ? That won't work on most servers and is VERY inefficient and slow anyway.
-
functions can not dump variables into the global namespace so that makes statement doesn't make any sense to me. Really, without seeing some example of what your talking about, I'm finding your post pretty hard to follow. Unless the code base was written with tests in mind it is highly unlikely that it is going to be very "testable". Your already talking about dependencies on variables from outside. This alone breaks the "unit" in "unit test".
-
Which frameworks would you recommend to start with
trq replied to CrimpJiggler's topic in Frameworks
Aww... my little framework Proem is on that list. -
Why are you storing your data like that in the first place?
-
You must have misread my replies.
-
public function setmyvar($varstring){ $myvartest = $varstring; return $myvartest; } Should be.... public function setmyvar($varstring){ $this->myvartest = $varstring; return $this; } And before you get too much further, please take a look at: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
-
Do you have a question?
-
Where was "var page = 'page1';" in the example I posted? It wasn't. You pass it in as an argument to the function. Do you know what a function is? Do you know what an argument is?
-
Again. Wrap the code you already have within your scroll.js in a function. You can then call this function passing it a page argument. scroll.js function scroll(page) { // your code // At some stage calls $.post('query.php?page=' + page); } Then you can just use: <script src="js/scroll.js"> </script> <script> scroll('page1'); </script> On page one and... <script src="js/scroll.js"> </script> <script> scroll('page2'); </script> on page two etc.
-
http://google.com
-
Class what is best practise? form->handler->class->db
trq replied to Ansego's topic in PHP Coding Help
It is one way of handling things, and is probably pretty close to how most frameworks would handle it. Most frameworks have some form of "form" handling built in. Don't reinvent the wheel. No and No. Classes should be auto loaded using an autoloader (see spl_autload) -
Sounds like you need to read some basic ajax tutorials. Were not going to write one for you, there are plenty already out there.
-
I'm not sure it can be explained any simpler.
-
Read my reply again.
-
Which frameworks would you recommend to start with
trq replied to CrimpJiggler's topic in Frameworks
CodeIgnitor is a terrible framework to learn anything from. It is poorly designed and poorly tested. it will teach new comers nothing but how to write poorly designed and poorly tested code. -
I'm not writing code for you. If you wrote the code you just posted you should have no issue implementing what I have described.