Solved

Add PHP and Ajax to CSS popup

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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

744 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

13 Experts available now in Live!

Get 1:1 Help Now