Find Jobs
Hire Freelancers

Write a super simple PHP script

$10-30 USD

已完成
已发布超过 10 年前

$10-30 USD

货到付款
Hello, I have a one-page short (roughly 200 lines of code) PHP+HTML file. When the user loads the page he sees a simple form with several input fields and, of course, a button. When the button is pressed, the input is sent through the POST protocol to PHP_SELF. Here I have a function which uses the input provided by the user and some other variables defined by me to send another POST request using CURL to a remote server, to which I do not have any type of access. Here is what I want: Some type of security measure which will not let the user use the form more often then I will allow him to(a value which I want to be able to define in seconds inside the PHP script). So basically, when the user submits the form you will have to store the IP and the exact time when he used the form. Then, if that IP will visit the webpage again before the required time(which I have previously established in the PHP) passed, instead of showing him the form I want you to show him the text: "This IP address($ip) has to wait $time seconds before being able to use the form again. Please refresh the webpage when the counter reaches 0! ". Also, as a security measure, I want him to be shown the same page even if he clicks the button before the required time has passed(in case he opened the same page in 2 tabs simultaneously, so that the second request to the server has passed the initial verification since he hasn't used the from yet). As I think you may have figured out, $ip and $time are variables. Also, I want you to write some simple javascript to countdown the remaining seconds(because the PHP script will only echo the seconds remained at the very moment the user tried to use the form again, but I want the user to always know how much time he has to wait without clicking that refresh button). To sum up, you will have to provide me: [login to view URL] a piece of code to put at the very beginning of my script which will check if the IP has used the form in the past X(established by me)seconds. -if it did, echo the HTML with the text from above and the simple JS to do the countdown; -if it did not, then do nothing and let my existing script do it's job. [login to view URL] a piece of code to integrate into my existing function which will do the security check before letting my function send the CURL request to the other server(basically server side validation) explained above. -if the IP was trying to cheat, echo the same HTML text with countdown as at point 1; -if the request my legitimate, do nothing and let my existing function do the rest. [login to view URL] a piece of code to integrate into my function after the piece from point 2 which will store the IP and time in a file(required for point 1 and 2). Please do not use databases. Keep it as simple as possible. Store the IP and time into a file. Thank you!
项目 ID: 5129909

关于此项目

12提案
远程项目
活跃10 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hi! Although you have outlined teh functionality quite well I have some questions. Like: 1) SHould it trigger the "verification timeout" ONLY if the first submission to the other site (CURL) was successful or regardless of teh outcome? 2) On subsequent attempt to submit (trough sevelar initially opened, when it's allowed, forms in multiple browser tabs/windows) should it preserve teh submitted data and load that on the form when it's allowed again, or dismiss everytihng and always load a blank form when allowed? 3) Storing the user quasi-session (IP + timestamp) in a file has one major drawback in comparison with storing into a database, especially with the increase in visits count, teh file will grow larger and larger over time, and because the files are with sequential type of access it will take increasingly more time to find the IP record, if any, in it, not to mention when you have to substitute data in teh middle of it you'll have to go thgough the whole file from beginning to the end reading and subsequently writing. And you'll certainly have visits that ask to to the same in the mean time, so the potential for not being able to verify, due to file locks, or corrupt the file is considerably great. 4) When in "non-allowed" state should it load the form, as well as the message, but in some "disabled to use" state, or just the message? I think these are enough for now to get a better understanding for the assignemt. Regards, Dobri
$30 USD 在0天之内
4.9 (326条评论)
6.7
6.7
12威客以平均价$76 USD来参与此工作竞价
用户头像
Hello, With 99% completion rate, 650+ successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 !!)... you can never go wrong choosing me :) I look forward to your reply. Thanks. Kind Regards, Rajesh Soni
$154 USD 在2天之内
5.0 (489条评论)
7.3
7.3
用户头像
10+ years experience. 500+ projects completed successfully. I am very interested in this project. Ready to start ASAP.
$99 USD 在3天之内
4.9 (178条评论)
6.7
6.7
用户头像
Hey I have gone through the details I can do this job! Will you award me the project after i deliver the script to you? Although i have a question for you. The person who will be posting this form you are talking will he be registered to your site? I wont be storing the IP on any file, I will use session or cookies to do that part if its not a problem for you. let me know if you are willing to see my work. I can deliver this in few hours once you reply me. Thanks, Rajan Kaneria
$30 USD 在1天之内
5.0 (13条评论)
4.4
4.4
用户头像
Hi I'm sure I could achieve your goals.. I'm a 12 year experienced PHP developer... I will deliver high quality result in record time.... thanks for considering my proposal, do not forget to visit my profile to see what the employers are saying about me.
$89 USD 在4天之内
5.0 (16条评论)
4.2
4.2
用户头像
Good day! I am relatively new on freelancer.com, but I am experienced programmer, I would like to do your project and receive good feedback on my work. I would write three functions that you can easily include into your php script. One would write the IP address and time in a log file (not a database, as requested). Another would check if the user is recent or not (this is were your time limit comes in), which you can insert into the form page and in the submit action. And the last would be a wrapper script that renders the "please wait" page including the countdown javascript. Hope you like the plan. I'm bidding lower than average because I still looking for good feedback to build reputation. I will be available on chat and skype. As soon as you award me the project I can start working. Probably I will spend less time than 5 days, I just hate it if I gave you false hope of 0 days :) Looking forward to you reply. Have a nice day! Kind regards, Louwrens
$55 USD 在5天之内
5.0 (2条评论)
2.3
2.3
用户头像
Dear Sir I understand your Job and ready to give you quick and quality script I'll write the code with clear documentation I have one question: If i use sqlite, is there any problem ? as sqlite requires only a file Waiting for your response Thanks
$30 USD 在1天之内
0.0 (0条评论)
0.0
0.0
用户头像
i think you should be use the database concept to make your page more dynamic and more secure for users informaion that u get aftre sybmit the form by the user
$25 USD 在10天之内
0.0 (0条评论)
0.0
0.0
用户头像
Hi Stefanpatatu, I have experience in building web applications. I have read your application. Due to my skills in PHP,cURL and HTML/HTML5, I am interested in your project. Please feel free to ask questions, if you have in mind. Kind regards, Azeem
$155 USD 在2天之内
0.0 (0条评论)
0.0
0.0

关于客户

ROMANIA的国旗
Botosani, Romania
5.0
1
付款方式已验证
会员自1月 9, 2013起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。