Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. It's a pretty simple idea. We haven't seen whats in your scroll.js. From your description we can assume that's its not very self contained. So, first thing is first, fix that. Make it into an object, or at very least a function that excepts an argument. You could then do something this: <script src="js/scroll.js"> </script> <script> scroll('page1'); </script> Then, within your scroll function, instead of simply calling: $.post('query.php'); You could do something like: $.post('query.php?page=' + page); (where page is the variable you pass into the function) Then, finally, within php you could do something like: <?php switch($_GET['page']) { case 'page1': $sql = "SELECT a,b,c FROM foo"; break; case 'page2': $sql = "SELECT a,b,c FROM bar"; break; } $query = mysqli_query($sql); Of course this is a very simple example that could (and should) be improved upon, but hopefully it's enough to get you started in the right direction.
  2. No. You install wkhtml2pdf on the server. It's all done server side.
  3. The error is caused by this line: $cmd =$_GET['cmd']; The 'cmd' does not yet exist and you have done nothing to set a default. This line: default: include_once "home.php"; break; Then causing the output "you are viewing home.php" because $cmd has fallen through all your switch statements and into the default clause.
  4. I'm not sure there is a particular term for it or anything to search for. If you "think" about your problem however, you should be able to come up with a solution. That is what programmers do. If your stuck, what have you tried?
  5. $.post('query.php?param=foo'); Then, in php: <?php $param = $_GET['param'];
  6. It sure could.
  7. I don't see what that has to do with it, wkhtml2pdf is a command line program but anyway... Composer has a manual. https://getcomposer.org/doc/00-intro.md
  8. So, either create multiple "query.php" scripts or pass query.php some parameters via the url.
  9. use wget's -O option to specify where you want the file to output to.
  10. wkhtml2pdf does exactly what your asking. Easy to use too.
  11. That is a terrible hack. Just put session_start() before your output. Simple.
  12. That is some form of dreamweaver reported error. God knows.
  13. You have a bunch of output prior to session_start().
  14. password is a reserved word.
  15. substr_count.
  16. So find a decent host that supports your requirements. We don't know what your requirements are.
  17. Your question makes little sense. What is the issue?
  18. Explain what that means.
  19. Do yourself a favour and just use composer and it's autoloader like every other programmer writing modern code. http://getcomposer.org
  20. Again... Do you have a question?
  21. That is not going to happen via a http request. Do you have ssh access to the remote server? Just execute it via that. Otherwise, if you really want to make the request via http, you'll need to write a php script that you can request which will in turn execute your script.
  22. Do you have a question? Or just talking to yourself?
  23. Of course it does. What exactly do you expect to happen?
  24. Laravel is much simpler than Symfony, and while there docs generally suck, they do have a few paragraphs on the Request Lifecycle. A great option when doing this sort of thing is to get yourself a decent PHP debugger and simply step through the process. eg; to do so in Symfony, start by adding a breakpoint to https://github.com/symfony/symfony-standard/blob/master/web/app_dev.php#L28 and hitting the default route. Then step through a few times to see what happens.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.