2014-05-13 68 views
0

我创建了一个非常简单的html页面。以下是html文件的代码:通过网络上的链接访问php文件

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

此外,如果我添加一些php代码,我通过从apache服务器运行wamp。

我想问你,如果我想在互联网上加载到一个特定的URL我该怎么做? 例如,要打开我的网络浏览器并写入URL地址:http://www.exampleWebSite.com,然后显示我的页面。

谢谢

+2

这不是一个编程问题。但它的要点是1)得到一个域名2)获得虚拟主机3)上传你的文件到主机 – Populus

+0

如果你想显示的页面,首先你应该上传到服务器。并将文件名称索引.html/index.php.That是第一个页面服务器正在寻找。 – CodeCanyon

回答

0

可以使用标签或更改表单的action属性来样的网站。

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

不使用形式

<a href="http://www.example.com">Sign Up</a> 
0

您应该上传您的HTML文件到您的Web服务器。这是不可能的。

2

总之:你不能按照你的建议达到你想要的。 首先,你需要自己域名,并承载它。

如何:

  1. 购买一个域名从domain registrar (Google search)
  2. 购买托管域(可选与域名注册商)
  3. 上传文件到您的主机。
  4. 通过你的域访问你的文件(不管它是什么)。例如http://www.myderpydomain.com

这样,你现在可以运行你的文件(在这个例子中,我们将称之为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> 

,现在你可以看到,你的表单动作设置到Sign_up.php。你需要这个文件来处理你的表单,我记得你会写出来。但这里有一个“占位符”脚本。

<?php 

if(!empty($_POST)) { 
print_r($_POST); 
} 

?> 

我只注意到有一个表单链接到您的注册页面。为什么不使用专为这种事物设计的<a>(ANCHOR)元素。

<a href="Sign_up.php">Sign Up Now</a>