且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过网络上的链接访问php文件

更新时间:2023-12-03 09:15:28

总之: / strong>您无法按照您的建议达到您想要的效果。
首先,您需要拥有表示的域名并为其托管。



如何:




  1. 域名注册商(Google搜索)

  2. 购买 域名( )与域名注册机构
  3. 文件到你的主机。
  4. 通过你的域访问你的文件(不管它是什么)。例如 http://www.myderpydomain.com

这样你现在就可以运行你的文件了(在这个例子中,我们称之为 index.html

 < html> 
< head>
< title>客户端登录< /标题>
< / head>
< body>
< form method =postaction =Sign_up.php>
< table width ='400'cellpadding = '10'cellspacing ='1'align ='left'style ='margin:186 90'border ='0'>
< td>< font size =3face =arial,helvetica>没有账号?请注册
< td>< font size =3face =arial,helvetica>< input type ='submit'name ='signup'value ='Sign Up'/>
< / table>
< / form>
< / body>
< / html>

现在您可以看到,表单操作设置为 Sign_up。 PHP 。你需要这个文件来处理你的表单,我记得你会写出来。但同时还有一个placeholder脚本。

 <?php 

if(!empty($ _ POST)){
print_r($ _ POST);
}

?>



注意



我刚注意到你有链接到您的注册页面的表单。为什么不使用专为这种类型设计的 < a> (ANCHOR)元素。

 < a href =Sign_up.php>立即注册< / a> 


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

<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>

moreover if i add some php code inside I run it through wamp from an apache server.

I would like to ask you if i want to load this on the internet to a specific URL how can i do it ?? For example, to open my web browser and write at the URL address: http://www.exampleWebSite.com and then my page to show up.

Thank you

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>