Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem with AJAX/PHP

Featured Replies

I created a web page which makes an ajax call to a php page every time a value in an input box changes.

 

In addition to having that php script check the value in the input box for invalid characters (with preg) and other forms of validation, I also have it making a call to a database to see if the value is already in that database.

 

While everything works perfectly locally, when I upload it to my server the whole AJAX call still functions perfectly except the one clause for checking the database. Obviously I thought it may be an error with my PDO statements, so I copied them into a new file tried querying the database using the same object and it worked perfectly (although I didn't use ajax to make the call on the test file).

 

This is the first time I've tried to take a project of mine to a live server. Has anyone else experienced a similar issue and solved it? It's very odd because I know the AJAX call is working because the other validation is fine, and I know my PDO statements are working fine because of the test file, but for some reason the combination of the 2 won't seem to work (except locally).

 

Thanks for anyone who took the time to read this! :)

You would possibly get more response to your problem if you showed your coding. Is the live server running the same builds of PHP etc as that of your local config?

  • Author

Really stupid error based on some inexperience working with a live server on my part.

 

I exported my local database to an .sql file and imported it to my live server, unfortunately (for some reason I still don't know), it did not port all of my stored procedures for the associated database.

 

My PHP script was running these stored procedures in the functions handling AJAX call.

 

I've described my problem (and solution) here in case anyone else comes across a similar error, hopefully it saves them some time.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.