Solved

Add PHP and Ajax to CSS popup

Posted on 2014-11-23
4
158 Views
Last Modified: 2014-11-29
How does one add PHP to a button on a form (popup) that is CSS?
0
Comment
Question by:DS928
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Shahzad Fateh Ali
ID: 40461539
Actually, you add a JavaScript function on the button in popup, which call the php script using Ajax Call. You cannot add php directly to any button.
0
 

Author Comment

by:DS928
ID: 40462225
Thank you.  Can you show me an example please?
0
 
LVL 33

Accepted Solution

by:
Slick812 earned 500 total points
ID: 40462608
greetings  DS928, , ,  Using AJAX on web sites is very common, and a very useful thing to add better user experience for an "Interactive" page. But unlike making a single web page (a PHP file), using AJAX requires a three step process, first is the web page Javascript that will be activated on a user touch of a button (your button in question).  The javascript gets the variables from user choices (like radio checkbox), and then sends them to a PHP page using the javascript   XMLHttpRequest( )   object. The second step is the PHP server process, that gets the request and then does code to get information (access database, do lookups), and then outputs this information using echo to a result string. This result string is sent back to the browser javascript, the third step is the javascript process for the AJAX onreadystatechange function that receives the string from the PHP server. This function will sort out and use the information in the server string to update elements on the web page, or for your case, create and show an overlay <div> (you call a popup). It usually takes some time for someone to learn how to use AJAX.

Maybe if you give some more information about what you are trying to do, me or someone can write example code?
0
 

Author Comment

by:DS928
ID: 40470737
Hello.  Here is the html.
 <li><a href='#'id="popup" onclick="div_show()">Log-In</a></li>

Open in new window

Once the pop-up comes up. The email and the password are filled in.  Then the user clicks on the Log In button.
The database is updated. and another css div pops up saying that you are now logged in.  I have included the files...
log.css
tips.html
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
can windows 10 wamp send mail()? 3 32
PHPStorm debugging issues 1 21
Centering Vertically 3 27
would like the bottom of this page to be smaller 3 16
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now