Thanks. I did the following with your function in a file named
ajaxdebug.php:

$('#debug').load("ajaxdebug.php",{Title:'NewCourse'});

I get this: Array ( )

However, when I roll my own ajax using a select that calls a custom js
function that calls ajaxdebug.php, it shows the following:

Array ( [Title] => Golf Camp ) with "Golf Camp" replaced by whatever I
select.

So it seems that .load is not sending anything to the $_GET array
regardless of what I put in the name/value pair. Hmmmm.....

Doug Gough

On Apr 18, 2:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> $_GET is just an array.  I generally add a dbug function in PHP like
> so:
>
> function dbug($var)
> {
>     print "<pre>" . print_r($var) . "</pre>";
>
> }
>
> Then just call dbug($_GET); anywhere you want to see the name/value
> pairings.
>
> -khoker
>
> On Apr 18, 4:01 pm, duggoff <[EMAIL PROTECTED]> wrote:
>
> > I added some debug code to my php file, so that it will give a value
> > of -1 to it's $campname variable if it can't find anything in $_GET.
> > I've tried these:
>
> > var campName = 'NewCourse';
> > $('#table').load("camp_table2.php",{Title:campName});
> > returned value is -1 (didn't get the Title:Coursename pair from $_GET)
>
> > $('#table').load("camp_table2.php",{Title:"NewCourse"});
> > returned value is -1 (didn't get the Title:Coursename pair from $_GET)
>
> > $('#table').load("camp_table2.php",{"Title":"NewCourse"});
> > returned value is -1 (didn't get the Title:Coursename pair from $_GET)
>
> > I wish I understood $_GET better. Is there a way that I can watch the
> > value of $_GET while I'm debugging?
>
> > On Apr 18, 1:19 pm, Scott Sauyet <[EMAIL PROTECTED]> wrote:
>
> > > duggoff wrote:
> > > > I've gone through the tutorial for Quick and Dirty Ajax (http://
> > > > 15daysofjquery.com/quick-and-dirty-ajax/14/) and I'm having a problem.
> > > > I have a php file that queries a database and returns a populated
> > > > table. If I call it from my browser like this: camp_table.php?
> > > > Title=Campname it get a web page with the populated table. I want to
> > > > use this code: $('#table').load("camp_table2.php"{key:value}); but I
> > > > can't figure out how to format the key:value pair. ?Title=Campname
> > > > doesn't work, and everything else I've tried also fails. If I leave
> > > > off the key:value pair, the whole thing works but gives me an empty
> > > > table (of course).
>
> > > Have you tried
>
> > >      $('#table').load("camp_table2.php",{"Title": "Campname"});
>
> > > or, more realistically,
>
> > >      var campName = /// smething here
> > >      $('#table').load("camp_table2.php",{"Title": campname});
>
> > > ?  I think that should work.
>
> > > The key: value pairs are the names and values of any parameters you want
> > > to pass to the server in the query, so if your url looked like
>
> > >      shirt.php?size=XL&color=white&fabric=cotton
>
> > > then your call would look like {
>
> > >      $("#myDiv"").load("shirt.php", {
> > >          size: "XL",
> > >          color: "white",
> > >          fabric: "cotton"
> > >      });
>
> > > Good luck,
>
> > >    -- Scott

Reply via email to