-
Activating PHP code with Javascript - Help Please...
Hello,
Is there a way for me to activate php code on my page - perhaps with a button? Or are there any other methods?
Thanks
-
-
I think you should have a look at this resource
-
-
That's a very simplified version of "AJAX." See this tutorial for a generally preferable way of doing it -- the XHR object means that it's no longer necessary to bother with the iframe at all.
-
-
Thanks for that
Looking at the tutorials now. Thanks very much!
-
-
Wait. Using JavaScript to load PHP completely eliminates the purpose of PHP. When you write out PHP commands, when the user views the code, all she/he sees is the PHP output. With Javascript you can see all the variables, commands, etc. Doing so would enable a user to view your PHP code.
I'm thinking these resources may have a security leak.
- Mike
-
-
You're wrong.
Certain variables will be revealed to the client, yes, but these needn't be sensitive. If one wished to use Javascript to retrieve the address of a client on demand, for example, one would simply pass the client's name or ID to the PHP script. This is not sensitive information. The PHP script is the only part that touches the sensitive information such as the database access details.
-
-
Remember, Javascript only retrieves the visible elements of PHP. It's just like refreshing the page a bunch of times... you get some output, but it's not the secure data inside the PHP code.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks