# \[Pro\] Ajax PHP Mysql - need help

**URL:** <https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921>\
**Category:** Freeway\
**Created:** [February 15, 2010, 5:49am UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921 "2010-02-15T05:49:15Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![jan\_smoot](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jan\_smoot](https://discourse.softpress.com/u/jan_smoot)\
**Post date:** [March 12, 2010, 10:22pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/21 "2010-03-12T22:22:52Z")

</div>

Walt,  
Made your suggested changes. Still works in Firefox & IE. Safari’s error message now reads.

You don’t have permission to access /fanmail/.html on this server.

Looks like the evt.element().id is null. But, why? It is currently id=“fm\_2010\_01\_01”

Anything else up your magical sleeve? Thanks. Jan

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)\
**Post date:** [March 12, 2010, 11:05pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/22 "2010-03-12T23:05:53Z")

</div>

Okay, let’s try one additional step. Maybe the chaining part is  
failing here. Either one of these or the other, but not both, may work:

```
var file = this.id + '.html';

var elm = evt.element();
var file = elm.id + '.html';

```

See if either one brings you joy in Safari.

Walter

On Mar 12, 2010, at 5:22 PM, jan smoot wrote:

> Walt,  
> Made your suggested changes. Still works in Firefox & IE. Safari’s  
> error message now reads.
> 
> You don’t have permission to access /fanmail/.html on this server.
> 
> Looks like the evt.element().id is null. But, why? It is currently  
> id=“fm\_2010\_01\_01”
> 
> Anything else up your magical sleeve? Thanks. Jan
> 
> * * *
> 
> freewaytalk mailing list  
> email@hidden  
> Update your subscriptions at:  
> [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)\
**Post date:** [March 12, 2010, 11:09pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/23 "2010-03-12T23:09:27Z")

</div>

Oh, and don’t forget to put the folder name at the beginning as I  
mentioned previously, I left that part out here.

Walter

On Mar 12, 2010, at 6:05 PM, Walter Lee Davis wrote:

> Okay, let’s try one additional step. Maybe the chaining part is  
> failing here. Either one of these or the other, but not both, may  
> work:
> 
> var file = this.id + ‘.html’;
> 
> var elm = evt.element();  
> var file = elm.id + ‘.html’;
> 
> See if either one brings you joy in Safari.
> 
> Walter
> 
> On Mar 12, 2010, at 5:22 PM, jan smoot wrote:
> 
> > Walt,  
> > Made your suggested changes. Still works in Firefox & IE. Safari’s  
> > error message now reads.
> > 
> > You don’t have permission to access /fanmail/.html on this server.
> > 
> > Looks like the evt.element().id is null. But, why? It is currently  
> > id=“fm\_2010\_01\_01”
> > 
> > Anything else up your magical sleeve? Thanks. Jan
> > 
> > * * *
> > 
> > freewaytalk mailing list  
> > email@hidden  
> > Update your subscriptions at:  
> > [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)
> 
> * * *
> 
> freewaytalk mailing list  
> email@hidden  
> Update your subscriptions at:  
> [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![jan\_smoot](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jan\_smoot](https://discourse.softpress.com/u/jan_smoot)\
**Post date:** [March 24, 2010, 8:17pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/24 "2010-03-24T20:17:50Z")

</div>

Walt,

Things have gone awry on me! I had a system crash (needed a new battery) So I have had to recreate some of this. Before - I was having trouble getting the listener to work in Safari. I have backslid…

The page behavior is: nothing shows up in the scrolling content box - initially I have filled through a .inc. But - I see the content that should be displayed in the page source. pagename has a .shtml

I have made sure the lightbox function is gone. I have closed and restarted Freeway. I have republished everything.

I am using Protaculous with prototype.packed with the listener code as:

$$(‘button.thisbutton’).invoke(‘observe’,’click’,function(evt){  
evt.stop();  
var file = ‘fanmail/’ + evt.element().id + ‘.html’;  
new Ajax.Updater(‘content’, file, { parameters:{ method:’get’ }  
});  
});

Button html is:  
Current Mail

I am stumpted. Seems like some type of library conflict?

Other info about the page…

I am also using an accordian (settings=on pageload, slide up, some hidden some visible) along with a form and the include file shown in a scrolling box. The accordian is initially all open - which it shouldn’t be. I can close them though. It is functional, just doesn’t display correctly on page load.

Any help you can offer would be so appreciated. Otherwise, I guess I just start taking things off the page to debug? Welcome your input.  
Jan

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)\
**Post date:** [March 25, 2010, 2:11am UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/25 "2010-03-25T02:11:55Z")

</div>

Wow, tough luck!

On Mar 24, 2010, at 4:17 PM, jan smoot wrote:

> Walt,
> 
> Things have gone awry on me! I had a system crash (needed a new  
> battery) So I have had to recreate some of this. Before - I was  
> having trouble getting the listener to work in Safari. I have  
> backslid…
> 
> The page behavior is: nothing shows up in the scrolling content box
> 
> - initially I have filled through a .inc. But - I see the content  
> that should be displayed in the page source. pagename has a .shtml

And you are sure that other Server Side Includes work correctly (i.e.  
that your server is configured to allow this)? And you aren’t trying  
to preview this on your computer (where SSI won’t work at all, except  
in Web Sharing with some tweaking of the configuration files).

> I have made sure the lightbox function is gone. I have closed and  
> restarted Freeway. I have republished everything.
> 
> I am using Protaculous with prototype.packed with the listener code  
> as:
> 
> $$(‘button.thisbutton’).invoke(‘observe’,’click’,function(evt){  
> evt.stop();  
> var file = ‘fanmail/’ + evt.element().id + ‘.html’;  
> new Ajax.Updater(‘content’, file, { parameters:{ method:’get’ }  
> });  
> });

there’s your problem right there. method:‘get’ should not be inside  
the parameters hash, sorry if I mis-typed that earlier in this  
process. Make your function look like this:

```
$$(‘button.thisbutton’).invoke(‘observe’,’click’,function(evt){
	evt.stop();
	var file = 'fanmail/' + evt.element().id + '.html';
	new Ajax.Updater(‘content’, file, { method:’get’ });
});

```

> Button html is:  
> Current Mail

This is all fine.

> I am stumpted. Seems like some type of library conflict?
> 
> Other info about the page…
> 
> I am also using an accordian (settings=on pageload, slide up, some  
> hidden some visible) along with a form and the include file shown in  
> a scrolling box. The accordian is initially all open - which it  
> shouldn’t be. I can close them though. It is functional, just  
> doesn’t display correctly on page load.

Is this accordion built with the Freeway FX Actions, my  
ScriptAccordion Action, or was it made using the MooTools kit from  
Weaver? Either the first or second are fine, but the third option  
would be really a bad idea and nothing on the page would work at all.

> Any help you can offer would be so appreciated. Otherwise, I guess I  
> just start taking things off the page to debug? Welcome your input.

Get a copy of Firebug and install it in Firefox. View your site while  
Firebug is running and its console tab is open. You might not  
understand the error messages when they happen, but at least you’ll  
have something to start googling with or be able to post what the  
error says and get some more help here. JavaScript is a cruel  
mistress, but very very powerful.

Walter

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![jan\_smoot](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jan\_smoot](https://discourse.softpress.com/u/jan_smoot)\
**Post date:** [March 25, 2010, 4:24am UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/26 "2010-03-25T04:24:46Z")

</div>

Some Progress!  
I had an apostrope character not a ’ in the observer code… I knew something was screwing everything up! Fixing this cleared up everything.

So, now. I am back to the problem that the listener function isn’t working Safari. Getting a:

FORBIDDEN  
You don’t have permission to access /alphasite/fanmail/.html on this server.

I tried your suggestion (in your 12 Mar reply)  
var elm = evt.element(); var file = elm.id + ‘.html’;  
(beware - your code has the dreaded ’ ‘ not ’ in it!

Any other ideas? Sticky wicket!

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)\
**Post date:** [March 25, 2010, 12:23pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/27 "2010-03-25T12:23:20Z")

</div>

If you read the error message, it’s saying pretty clearly that the ID  
value is not there, since it’s asking for the file named .html rather  
than some\_id.html. How did you make your buttons? Check them carefully  
to see whether they have the ID property properly coded. If they  
don’t, that’s your problem.

Walter

On Mar 25, 2010, at 12:24 AM, jan smoot wrote:

> Some Progress!  
> I had an apostrope character not a ’ in the observer code… I knew  
> something was screwing everything up! Fixing this cleared up  
> everything.
> 
> So, now. I am back to the problem that the listener function isn’t  
> working Safari. Getting a:
> 
> FORBIDDEN  
> You don’t have permission to access /alphasite/fanmail/.html on this  
> server.
> 
> I tried your suggestion (in your 12 Mar reply)  
> var elm = evt.element(); var file = elm.id + ‘.html’;  
> (beware - your code has the dreaded ’ ‘ not ’ in it!
> 
> Any other ideas? Sticky wicket!
> 
> * * *
> 
> freewaytalk mailing list  
> email@hidden  
> Update your subscriptions at:  
> [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![jan\_smoot](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jan\_smoot](https://discourse.softpress.com/u/jan_smoot)\
**Post date:** [March 25, 2010, 3:06pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/28 "2010-03-25T15:06:27Z")

</div>

This is the button code

January 2010

This is the listener code:

$$(‘button.thisbutton’).invoke(‘observe’,‘click’,function(evt){  
evt.stop();  
var elm = evt.element();  
var file = ‘fanmail/’ + elm.id + ‘.html’;  
new Ajax.Updater(‘content’, file, { method:‘get’ } );  
});

Works fine in Firefox and IE - but not Safari. You had suggested this additional step earlier…

On Mar 12, 2010, at 6:05 PM, Walter Lee Davis wrote:

```
Okay, let’s try one additional step. Maybe the chaining part is failing here. Either one of these or the other, but not both, may work:

var file = this.id + ‘.html’;

var elm = evt.element(); var file = elm.id + ‘.html’;

See if either one brings you joy in Safari.

Walter

On Mar 12, 2010, at 5:22 PM, jan smoot wrote:

    Walt, Made your suggested changes. Still works in Firefox & IE. Safari’s error message now reads.

    You don’t have permission to access /fanmail/.html on this server.

    Looks like the evt.element().id is null. But, why? It is currently id=”fm_2010_01_01”

    Anything else up your magical sleeve? Thanks. Jan

```

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![jan\_smoot](https://discourse.softpress.com/letter_avatar_proxy/v4/letter/j/f9ae1b/32.png) [@jan\_smoot](https://discourse.softpress.com/u/jan_smoot)\
**Post date:** [March 25, 2010, 3:20pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/29 "2010-03-25T15:20:06Z")

</div>

Walt,

I decided to try your last suggestion - never give up!!

Don’t know why, but this fixed it:

var elm= ‘fanmail/’ + this.id + ‘.html’;

You have been so very helpful. Thank you.

Jan

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

---

<div class="post-metadata">

**Author:** ![waltd](https://discourse.softpress.com/user_avatar/discourse.softpress.com/waltd/32/2720_2.png) [@waltd](https://discourse.softpress.com/u/waltd)\
**Post date:** [March 25, 2010, 3:33pm UTC](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921/30 "2010-03-25T15:33:32Z")

</div>

Try adding a line to your script, after the var elm line:

```
console.log(elm.id);

```

In Safari, enable the Develop menu in the main preferences (Advanced  
tab) if it isn’t already.

From the Develop menu, choose Show Error Console and move this new  
window somewhere that you can see the entire thing while Safari has  
your page loaded.

Reload the page. If you see any errors in the Error Console, please  
note what they are.

Click one of the buttons, and see what (if anything) is printed to the  
console.

If you don’t see anything, then remove the parameter .id from the  
statement, so it reads only

```
console.log(elm)

```

and see what if anything is printed when the button is pressed.

Post back with your results. This really should just work, and I’m  
surprised it hasn’t.

Walter

On Mar 25, 2010, at 11:06 AM, jan smoot wrote:

> This is the button code
> 
> January 2010
> 
> This is the listener code:
> 
> $$(‘button.thisbutton’).invoke(‘observe’,‘click’,function(evt){  
> evt.stop();  
> var elm = evt.element();  
> var file = ‘fanmail/’ + elm.id + ‘.html’;  
> new Ajax.Updater(‘content’, file, { method:‘get’ } );  
> });
> 
> Works fine in Firefox and IE - but not Safari. You had suggested  
> this additional step earlier…
> 
> On Mar 12, 2010, at 6:05 PM, Walter Lee Davis wrote:
> 
> Okay, let’s try one additional step. Maybe the chaining part is  
> failing here. Either one of these or the other, but not both, may  
> work:
> 
> var file = this.id + ‘.html’;
> 
> var elm = evt.element(); var file = elm.id + ‘.html’;
> 
> See if either one brings you joy in Safari.
> 
> Walter
> 
> On Mar 12, 2010, at 5:22 PM, jan smoot wrote:
> 
> ```
> Walt, Made your suggested changes. Still works in Firefox &  
> 
> ```
> 
> IE. Safari’s error message now reads.
> 
> ```
> You don’t have permission to access /fanmail/.html on this  
> 
> ```
> 
> server.
> 
> ```
> Looks like the evt.element().id is null. But, why? It is  
> 
> ```
> 
> currently id=”fm\_2010\_01\_01”
> 
> ```
> Anything else up your magical sleeve? Thanks. Jan
> 
> ```
> 
> * * *
> 
> freewaytalk mailing list  
> email@hidden  
> Update your subscriptions at:  
> [http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

* * *

freewaytalk mailing list  
email@hidden  
Update your subscriptions at:  
[http://freewaytalk.net/person/options](http://freewaytalk.net/person/options)

[Previous page](https://discourse.softpress.com/t/pro-ajax-php-mysql-need-help/6921.md?page=1)
