alphasil Posted December 4, 2014 Share Posted December 4, 2014 (edited) Hi I'm trying to get the layout like i want but it's not easy I have this file <?PHP require_once("./include/membersite_config.php"); if(!$fgmembersite->CheckLogin()) { $fgmembersite->RedirectToURL("login.php"); exit; } if(isset($_POST['submitted'])) { $fgmembersite->PesquisarPorDatas(); } ?> <div id='fg_membersite_content'> <div class="CSSTableGenerator" > //I want the result here </div> <br> I want the result of this $fgmembersite->PesquisarPorDatas(); in "//I want the result here" the r of my code, when the user use the "Pesquisar" button this fucntion is called but the result comes out of my css any help please?? Edited December 4, 2014 by alphasil Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/ Share on other sites More sharing options...
ginerjm Posted December 4, 2014 Share Posted December 4, 2014 Huh? Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498495 Share on other sites More sharing options...
mac_gyver Posted December 4, 2014 Share Posted December 4, 2014 a function/method will generally return data, that you can then assign to a variable or directly loop over. it may however make the data available as a class property. in either case, it would take looking at the documentation and/or code for the PesquisarPorDatas() method in order to find out what where, what, and what format the data is in. Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498496 Share on other sites More sharing options...
alphasil Posted December 4, 2014 Author Share Posted December 4, 2014 Thanks Resolved, the submit was wrong. After submit i want to keep 2 variable (dataInicio) and (dataFim) to pass to another query to make the pdf. <?php if(isset($_POST['submitted'])) { $fgmembersite->PesquisarPorDatas(); $dataInicio = $_POST["dataInicio"]; $dataFim = $_POST["dataFim"]; } then in the url <p><a href='pdfAct.php?dataInicio=$dataInicio&dataFim=$dataFim'>Imprimir estas atividades</a></p> but the result is blank http://xxxxxxxxxxx/atividades/pdfAct.php?dataInicio=$dataInicio&dataFim=$dataFim So i have no values....whats wrong?? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498499 Share on other sites More sharing options...
Ch0cu3r Posted December 4, 2014 Share Posted December 4, 2014 You cant just dump a PHP variable into raw HTML. You need to wrap the variable in PHP tags and then echo it <p><a href='pdfAct.php?dataInicio=<?php echo $dataInicio; ?>&dataFim=<?php echo $dataFim ?>'>Imprimir estas atividades</a></p> Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498502 Share on other sites More sharing options...
alphasil Posted December 4, 2014 Author Share Posted December 4, 2014 (edited) Thanks again...i'm learning a lot from you guys. Last question, it workings, i can see the dates in the url but the pages comes blank this is my query $dataInicio=$_GET['dataInicio']; $dataFim=$_GET['dataFim']; echo $dataInicio; echo $dataFim; $pdf->connect('localhost', 'xxxxxx', 'xxxxxx', 'xxxxxx'); $pdf->mysql_report("SELECT `atividade` , `data` , `hora` , `local` , `inter` FROM `pae_atividades` WHERE(`data` BETWEEN '$dataInicio' AND '$dataFim'") ORDER BY `data` ASC LIMIT 0 , 30"); ?> and the url is http://ebspma.edu.pt/atividades/pdfAct.php?dataInicio=2014-12-05&dataFim=2014-12-19 So it must be the query...any help? Edited December 4, 2014 by alphasil Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498509 Share on other sites More sharing options...
CroNiX Posted December 4, 2014 Share Posted December 4, 2014 See in your query above how most of the text is in green and some is in black? That's because you end your query by closing the double quote right after AND '$dataFim'" <-- premature double quote. You have 3 double quotes in your query, so there is an extra one or one is not closed. They should always be in pairs. Remove the one after $dataFim. Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498511 Share on other sites More sharing options...
alphasil Posted December 4, 2014 Author Share Posted December 4, 2014 Thank you it was the double you mentioned. Best regards Quote Link to comment https://forums.phpfreaks.com/topic/292888-call-function/#findComment-1498514 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.