Solved

Add PHP and Ajax to CSS popup

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…

762 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