Find Jobs
Hire Freelancers

Write a super simple PHP script

$10-30 USD

Selesai
Disiarkan lebih dari 10 tahun yang lalu

$10-30 USD

Dibayar semasa penghantaran
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 Projek: 5129909

Tentang projek

12 cadangan
Projek jarak jauh
Aktif 10 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
Dianugerahkan kepada:
Avatar Pengguna
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 dalam 0 hari
4.9 (326 ulasan)
6.7
6.7
12 pekerja bebas membida secara purata $76 USD untuk pekerjaan ini
Avatar Pengguna
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 dalam 2 hari
5.0 (489 ulasan)
7.3
7.3
Avatar Pengguna
10+ years experience. 500+ projects completed successfully. I am very interested in this project. Ready to start ASAP.
$99 USD dalam 3 hari
4.9 (178 ulasan)
6.7
6.7
Avatar Pengguna
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 dalam 1 hari
5.0 (13 ulasan)
4.4
4.4
Avatar Pengguna
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 dalam 4 hari
5.0 (16 ulasan)
4.2
4.2
Avatar Pengguna
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 dalam 5 hari
5.0 (2 ulasan)
2.3
2.3
Avatar Pengguna
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 dalam 1 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
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 dalam 10 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
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 dalam 2 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera ROMANIA
Botosani, Romania
5.0
1
Kaedah pembayaran disahkan
Ahli sejak Jan 9, 2013

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.