473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Using AJAX with a PHP Front Controller

I have a framework that uses the front controller design pattern for a
single point of entry to the application and the autoload function for
includes. I am trying to incorporate AJAX into the framework, but the
javascript calls to php ignore my front controller code when
instantiating classes.

Can someone please provide me with some hints on how I can make this
work? Thank you.

Feb 7 '07 #1
1 3014
Aquaren wrote:
I have a framework that uses the front controller design pattern for a
single point of entry to the application and the autoload function for
includes. I am trying to incorporate AJAX into the framework, but the
javascript calls to php ignore my front controller code when
instantiating classes.

Can someone please provide me with some hints on how I can make this
work? Thank you.
Hi,

Hard to say without knowing what your frontcontroller does, BUT the
bottomline is this: When you let JavaScript instantiate a XMLHTTPRequest
(or whatever it is called in different browsers), you feed it the url,
check what your app returns.
Just make an alert in your JS with that url, and type that into a browser.
(Or when it is long, use prompt, so you can copy/paste it)

What does your application return?

PHP doesn't care if the XMLHTTPRequest makes a request, or somebody visits
your page 'normal'.
PHP just runs its script and produces the output.

So just debug your AJAX (and/or PHP) via direct calls to the url in your
browser.

PS: In case you use cookies / sessions: The XMLHTTPRequest DOES send the
cookie(s) the same way as a direct invocation via a browser would do. So
that should work alright.

Regards,
Erwin Moller
Feb 7 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Prasad Patil | last post by:
Hi I am trying to understand the article http://msdn.microsoft.com/practices/type/Patterns/Enterprise/DesFrontController/...
2
by: Colin Basterfield | last post by:
Hi, has anyone (tried to) implement the Front Controller pattern as described at http://msdn.microsoft.com/architecture/patterns/ImpFrontControllerInASP/ I'm having trouble resolving the...
2
by: Mr Wizard | last post by:
I am going through the front controller http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpatterns/html/ImpFrontControllerInASP.asp and all works well except when the server.transfer...
1
by: NGM | last post by:
Hello All When implementing FrontController sample MSDN I am facing a lot of problems try implementing the front controller patterm sample provided by microsoft:...
5
by: garethdjames | last post by:
A while ago I read news about ASP.Net 2.0 having support for the Front Controller model, In all the reports I have read and in the latest beta download I can see no implicit support for this...
3
by: Ashish | last post by:
Is anyone aware of a good Front Controller Pattern implementation in ASP.Net, we are developing a new product, and contemplating whether we should use Front Controller Pattern implementation, due...
4
by: Kunle Odutola | last post by:
WebForms used to be a Page controller architecture (in .NET 1.x) which severely limited (prevented?) true MVC designs with WebForms. Any ideas? -- Don't talk unless you can improve the silence.
7
by: vjayis | last post by:
hi i hav a front page from which an ajax page is called and an text field is written in the front page using this ajax page. I need to validate the user access for this page: 1.the ajax page...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.