Jump to content

[SOLVED] JavaScript and PHP


timmy0320

Recommended Posts

Alright, so I have been looking and looking and came across that it's impossible to check if JavaScript is Enabled or not via PHP because it is server-side. What I am trying to do is for my registration page, I have some AJAX on the site (checking username, pw strength, etc.) but I want register.php to do an IF javascript=enabled show registration with ajax ELSE javascript=disabled show registration without AJAX.

 

The only way I have found to come remotely close to this would be to make a module and on every page that links to register.php have a link such as:

a href="register.php?pg=nojava" onclick="window.location='register.php';return false;"

 

I do NOT want to do that. Is there a way I can link do my main objective with the IF ELSE instead of creating a module? Because if I do the module I then have to figure out a way to code register.php?pg=nojava to someway say that their java is enabled if they try to remotely access it through the browser. Which brings me back to point A. Get my jist of things?

 

Thanks for any help you can provide.

Link to comment
https://forums.phpfreaks.com/topic/90209-solved-javascript-and-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.