Access php files through a link on the web

前端 未结 3 561
栀梦
栀梦 2021-01-26 15:52

I have created a very simple html page. Below is the code of the html file


    
        Client Login
    <         


        
相关标签:
3条回答
  • 2021-01-26 16:34

    In short: NO you can not achieve what you'd like to do in the way you suggested. First off, you'd need to own said domain and have hosting for it.

    How to:

    1. Purchase a domain name from a domain registrar (Google search)
    2. Purchase hosting for said domain (optionally with the domain registrar)
    3. Upload files to your hosting.
    4. Access your file through your domain (whatever it may be). For example http://www.myderpydomain.com

    That way you can now run your file (for this example we shall call it index.html)

    <html>
        <head>
            <title>Client Login</title>
        </head>
        <body>
            <form method="post" action="Sign_up.php">
                <table width='400' cellpadding='10' cellspacing='1' align='left' style='margin:186 90' border='0'>          
                    <td><font size="3" face="arial, helvetica">Don't have an account? Please register 
                    <td><font size="3" face="arial, helvetica"><input type='submit'  name='signup' value='Sign Up'/>
                </table>
            </form>     
        </body>
    </html>
    

    and now as you can see, your form action is set to Sign_up.php. You need this file to process your form, which I pressume you will write up. But here's a "placeholder" script in the mean time.

    <?php 
    
    if(!empty($_POST)) {
    print_r($_POST);
    }
    
    ?>
    

    NOTE

    I just noticed you have a form to link to your sign-up page. Why not use an <a> (ANCHOR) element which was designed for this kind of thing.

    <a href="Sign_up.php">Sign Up Now</a>
    
    0 讨论(0)
  • 2021-01-26 16:45

    you can use the tag or change your form's action attribute to your sample website.

    <form action="post" method="http://www.example.com">
    

    or

    not using a form

    <a href="http://www.example.com">Sign Up</a>
    
    0 讨论(0)
  • 2021-01-26 16:52

    You should upload your html file to your web server. That is not possible.

    0 讨论(0)
提交回复
热议问题