Passing $_GET variables.

A collection of tutorials and posts that show additional functionality of MATE

Moderator: KarelB

Re: Passing $_GET variables.

Postby KarelB » Fri Oct 15, 2010 6:37 am

You don't pass the the $_GET variable to the script.
Glue your $_GET variables to the aja xurl like
Code: Select all
setAjaxInfo({url: "'.$_SERVER["PHP_SELF"].'?Description='.$_GET["Description"].'", history: true});
KarelB
 
Posts: 458
Joined: Mon Dec 01, 2008 11:49 pm
Location: The Netherlands

Re: Passing $_GET variables.

Postby lexo » Fri Oct 15, 2010 3:25 pm

The browser give this error in the line i type your script...
Parse error: syntax error, unexpected '{', expecting ')' in


Code: Select all
setAjaxInfo({url: "'.$_SERVER["PHP_SELF"].'?Description='.$_GET["Description"].'", history: true});


what it be?

thanks for taking your time helping me! :D
lexo
 
Posts: 15
Joined: Sat Oct 09, 2010 1:35 pm

Re: Passing $_GET variables.

Postby lexo » Fri Oct 15, 2010 4:21 pm

I done!!!, Thanks!!, I put your script in ...

Code: Select all
<script type="text/javascript">
            ....
        setAjaxInfo({url: "'.$_SERVER["PHP_SELF"].'?Description='.$_GET["Description"].'", history: true});
</script>


and

Code: Select all
$this->Editor->setConfig('sqlFilters', "Description = '".$_GET["Description"]."'");
inside funtion initiateEditor()

Thanks a lot!!! :D :D
lexo
 
Posts: 15
Joined: Sat Oct 09, 2010 1:35 pm

Re: Passing $_GET variables.

Postby peelsasleep » Sun Jan 02, 2011 7:30 pm

Hi i've been having the exact same problem
it seems like the change in the displayHtml() function is the problem
using:
Code: Select all
   function displayHtml()
   {
         $eventIDRequest = $_REQUEST["eventIDD"];
         //echo"eventID = $eventIDRequest<br>";
      ?>
         <br />
   
         <div align="left" style="position: relative;"><div id="ajaxLoader1"><img src="images/ajax_loader.gif" alt="Loading..." /></div></div>
         
         <br />
         
         <div id="historyButtonsLayer" align="left">
         </div>
   
         <div id="historyContainer">
            <div id="information">
            </div>
      
            <div id="titleLayer" style="padding: 2px; font-weight: bold; font-size: 18px; text-align: center;">
            </div>
      
            <div id="tableLayer" align="center">
            </div>
            
            <div id="recordLayer" align="center">
            </div>      
            
            <div id="searchButtonsLayer" align="center">
            </div>
         </div>
         
         <script type="text/javascript">
         trackHistory = false;
         var ajaxUrl = '<?php echo $_SERVER['PHP_SELF']; ?>';
         toAjaxTableEditor('update_html','');
         setAjaxInfo({url: "'.$_SERVER["PHP_SELF"].'?Description='.$_GET["Description"].'", history: true});
         </script>

      <?php

   }


i get a javascript error:
missing } after property list
[Break on this error] setAjaxInfo({url: "'.$_SERVER["PHP...T["Description"].'", history: true});\n


anyone else have this problem or know what to do?

this is modified from the free version's example 3
but i can't get it to work with the paid version either
thanks!
peelsasleep
 
Posts: 11
Joined: Thu Dec 30, 2010 9:45 pm

Re: Passing $_GET variables.

Postby KarelB » Tue Jan 04, 2011 9:13 am

Could you tell us what the content is of both the $_SERVER["PHP_SELF"]variable and the $_GET["Description"] variable?
KarelB
 
Posts: 458
Joined: Mon Dec 01, 2008 11:49 pm
Location: The Netherlands

Re: Passing $_GET variables.

Postby donaldwoo » Thu Jan 06, 2011 3:09 pm

If I read this correctly you can define searches from within the URL. Would it be possible to define searches from multiple fields using this method( eg cpr=yes, hasmat=yes, etc.)?
donaldwoo
 
Posts: 5
Joined: Mon Jan 03, 2011 2:01 am

Re: Passing $_GET variables.

Postby KarelB » Mon Jan 10, 2011 12:51 pm

Yes but you have to code the logic for that yourself in the initiateEditor:
Code: Select all
if (! strcmp($_GET['passed_var'], "cpr"){
 $this->Editor->setConfig('sqlFilter","cpr=yes");
else if (! strcmp($_GET['passed_var'], "has_mat"){
  $this->Editor->setConfig('sqlFilter","has_mat=yes");
.....etc
}
KarelB
 
Posts: 458
Joined: Mon Dec 01, 2008 11:49 pm
Location: The Netherlands

Re: Passing $_GET variables.

Postby paulr » Tue Nov 08, 2011 1:40 pm

I really like the generic table editor in this example, it's very useful and I could use this to replace a lot of duplicated code, however the "export" doesn't work as it should for me. It always exports the contents of the default table, not the currently displayed table.

Can you confirm this, and if so do you have a fix?

Thanks

Paul
paulr
 
Posts: 45
Joined: Thu Mar 25, 2010 9:09 am

Re: Passing $_GET variables.

Postby KarelB » Tue Nov 08, 2011 2:06 pm

Paul

I still use this code and it works fine for me, but I also implemented this solution:
http://www.mysqlajaxtableeditor.com/discussmate/viewtopic.php?f=4&t=703

I am not sure but I think that will solve your issue.
(let me know and I will update the turtorial)

Karel
KarelB
 
Posts: 458
Joined: Mon Dec 01, 2008 11:49 pm
Location: The Netherlands

Re: Passing $_GET variables.

Postby paulr » Tue Nov 08, 2011 3:38 pm

Yes, that fixed it.

Thanks for the help.

Paul
paulr
 
Posts: 45
Joined: Thu Mar 25, 2010 9:09 am

PreviousNext

Return to How To

Who is online

Users browsing this forum: No registered users and 3 guests

cron