Solved

Add PHP and Ajax to CSS popup

Posted on 2014-11-23
4
162 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 34

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

840 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