trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
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.
-
convert entire php/html page to dowloadable pdf
trq replied to Kova_Llano's topic in PHP Coding Help
No. You install wkhtml2pdf on the server. It's all done server side. -
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.
-
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?
-
$.post('query.php?param=foo'); Then, in php: <?php $param = $_GET['param'];
-
It sure could.
-
convert entire php/html page to dowloadable pdf
trq replied to Kova_Llano's topic in PHP Coding Help
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 -
What?
-
So, either create multiple "query.php" scripts or pass query.php some parameters via the url.
-
use wget's -O option to specify where you want the file to output to.
-
convert entire php/html page to dowloadable pdf
trq replied to Kova_Llano's topic in PHP Coding Help
wkhtml2pdf does exactly what your asking. Easy to use too. -
That is a terrible hack. Just put session_start() before your output. Simple.
-
That is some form of dreamweaver reported error. God knows.
- 6 replies
-
- testing server
- testing
-
(and 3 more)
Tagged with:
-
You have a bunch of output prior to session_start().
-
password is a reserved word.
-
substr_count.
-
So find a decent host that supports your requirements. We don't know what your requirements are.
-
Your question makes little sense. What is the issue?
-
Explain what that means.
-
Do yourself a favour and just use composer and it's autoloader like every other programmer writing modern code. http://getcomposer.org
-
Again... Do you have a question?
-
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.
-
Do you have a question? Or just talking to yourself?
-
Of course it does. What exactly do you expect to happen?
-
Understanding what a framework is doing behind the scenes.
trq replied to kutchbhi's topic in Frameworks
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.