Jump to content

Recommended Posts

index.php

<html>

    <head>

        <title>myproject</title>

        <script type="text/javascript" src="dropdowntabs.js"></script>

        <script type="text/javascript" src="A.js"></script>

        <script type="text/javascript" src="f.js"></script>

        <link rel="stylesheet" type="text/css" href="b.css" />

        <link href="Default.css" rel="stylesheet" type="text/css" />

        <style>

            #topmenu{

                width:600px;

            }

        </style>

    </head>



    <body>

        <div id="container" class="container">

            <div id="header" class="header"></div>

            <div id="topmenu">

                <div id="bluetab" class="bluetabs">

                    <ul>

                        <li><a href="" rel="" title="Home" ><span>Home</span></a></li>

                        <li><a href="" rel="dropmenu_soft" title="Software" ><span>Software</span></a></li>

                        <li><a href="" rel="dropmenu_prod" title="Product" ><span>Product</span></a></li>

                        <li><a href="" rel="dropmenu_docs" title="Documents And Tutorials"><span>Documents And Tutorials</span></a></li>

                        <li><a href="" rel="" title="Forum"><span>Forum</span></a></li>

                        <li><a href="" rel="" title="Blog"><span>Blog</span></a></li>

                        <li><a href="javascript:runAjax('login.php','holder')" rel="" title="Login"><span>Login</span></a></li>

                    </ul>

                </div>



                <div id="dropmenu_soft" class="dropmenudiv_b" style="width: 120px;">

                    <a href="student_allot.php">Windows</a>

                    <a href="javascript:runAjax('a.php','Ajax')">Linux</a>

                </div>



                <div id="dropmenu_prod" class="dropmenudiv_b" style="width: 120px;">

                    <a href="javascript:runAjax('a.php','holder')">Sell</a>

                    <a href="javascript:runAjax('a.php','holder')">Display</a>

                </div>



                <div id="dropmenu_docs" class="dropmenudiv_b" style="width: 120px;">

                    <a href="javascript:runAjax('b.php','holder')">Windows</a>

                    <a href="javascript:runAjax('b.php','holder')">Linux</a>

                </div>                



                <script type="text/javascript">

                    tabdropdown.init("bluetab", 0)

                </script>

            </div>

            <div id="holder" class="holder"></div>            

            <div id="footer" class="footer">

                Copyright 2009

            </div>

        </div>

    </body>

</html>

If i click the login button , the login form will come in "holder" div.

 

login.php

<script type="text/javascript" src="A.js"></script>
<script type="text/javascript" src="f.js"></script>

<form id="log" name="log">
    <table border="1">        
        <tr>
            <td>Username:</td>
            <td><input type="text" name="user" id="user"/></td>
        </tr>

        <tr> 
            <td>Password:</td>
            <td><input type="password" name="pass" id="pass"</td>
        </tr>

        <tr>
            <td align="center" colspan="2">
                <input type="button" name="sbt" id="sbt" value="Login" onclick="post('logadmin.php','','log')"/></td>
        </tr>
    </table>
</form>

If i sumit typing username and password, it will print message "successfully logged in".

How would i do that?

 

There is no div with id "holder" in the login form.

 

The div with id "holder" is in the first page (index.php) .

 

How would i print the message "successfully logged in" in the first page "holder" div?

 

How would i point to first page "holder" div from the login form page?

Link to comment
https://forums.phpfreaks.com/topic/180226-ajax-login-form-submit-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.